use catalog zone

This commit is contained in:
Hannaeko 2021-07-29 22:57:24 +02:00
parent 507bb16188
commit 39e9de8c77
2 changed files with 18 additions and 9 deletions

View file

@ -1,17 +1,23 @@
image: ansible/ansible-runner image: debian:stable-slim
before_script: before_script:
- apt-get update
- apt-get install -y ssh-client
# from https://docs.gitlab.com/ee/ci/ssh_keys/ # from https://docs.gitlab.com/ee/ci/ssh_keys/
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p /root/.ssh - mkdir -p $HOME/.ssh
- chmod 700 /root/.ssh - chmod 700 $HOME/.ssh
- echo "$SSH_KNOWN_HOSTS" >> /root/.ssh/known_hosts - echo "$SSH_KNOWN_HOSTS" >> $HOME/.ssh/known_hosts
- chmod 644 /root/.ssh/known_hosts - chmod 644 $HOME/.ssh/known_hosts
deploy: deploy:
script: script:
# TODO: build image with dependencies installed - |
- ansible-galaxy collection install ansible.netcommon for zonefile in zones/*; do
- pip3 install netaddr zone=$(basename $zonefile)
- ansible-playbook -i config/hosts config/deploy.yml 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'

View 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.