use catalog zone
This commit is contained in:
parent
507bb16188
commit
39e9de8c77
2 changed files with 18 additions and 9 deletions
|
@ -1,17 +1,23 @@
|
|||
image: ansible/ansible-runner
|
||||
image: debian:stable-slim
|
||||
|
||||
before_script:
|
||||
- apt-get update
|
||||
- apt-get install -y ssh-client
|
||||
# from https://docs.gitlab.com/ee/ci/ssh_keys/
|
||||
- eval $(ssh-agent -s)
|
||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||
- mkdir -p /root/.ssh
|
||||
- chmod 700 /root/.ssh
|
||||
- echo "$SSH_KNOWN_HOSTS" >> /root/.ssh/known_hosts
|
||||
- chmod 644 /root/.ssh/known_hosts
|
||||
- mkdir -p $HOME/.ssh
|
||||
- chmod 700 $HOME/.ssh
|
||||
- echo "$SSH_KNOWN_HOSTS" >> $HOME/.ssh/known_hosts
|
||||
- chmod 644 $HOME/.ssh/known_hosts
|
||||
|
||||
deploy:
|
||||
script:
|
||||
# TODO: build image with dependencies installed
|
||||
- ansible-galaxy collection install ansible.netcommon
|
||||
- pip3 install netaddr
|
||||
- ansible-playbook -i config/hosts config/deploy.yml
|
||||
- |
|
||||
for zonefile in zones/*; do
|
||||
zone=$(basename $zonefile)
|
||||
echo $(echo -n $zone | sha1sum | cut -f1 -d' ').zones 0 IN PTR $zone. >> catalog-zone/dns-witch-catalog.zone
|
||||
done
|
||||
- [ -n "$(git diff --name-only HEAD~ zones)" ] && scp $(git diff --name-only HEAD~ zones) ${SSH_PRIMARY_NS}:/var/lib/knot/zones
|
||||
- scp catalog-zones ${SSH_PRIMARY_NS}:/var/lib/knot
|
||||
- ssh ${SSH_PRIMARY_NS} 'chown -R knot:knot /var/lib/knot/{zones,catalog-zones} && knotc reload'
|
||||
|
|
3
catalog-zones/dns-witch-catalog.zone
Normal file
3
catalog-zones/dns-witch-catalog.zone
Normal file
|
@ -0,0 +1,3 @@
|
|||
dns-witch-catalog. 300 SOA ns1.dns-witch.net.eu.org. support.dns-witch.net.eu.org. 2021072102 28800 7200 2419200 300
|
||||
dns-witch-catalog. 3600 NS ns1.dns-witch.net.eu.org.
|
||||
dns-witch-catalog. 3600 NS ns2.dns-witch.net.eu.org.
|
Loading…
Reference in a new issue