From 39e9de8c77b65c0f4d63fd551a58eaba4e74bc53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Berthaud-M=C3=BCller?= Date: Thu, 29 Jul 2021 22:57:24 +0200 Subject: [PATCH] use catalog zone --- .gitlab-ci.yml | 24 +++++++++++++++--------- catalog-zones/dns-witch-catalog.zone | 3 +++ 2 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 catalog-zones/dns-witch-catalog.zone diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61f83e2..b7b082a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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' diff --git a/catalog-zones/dns-witch-catalog.zone b/catalog-zones/dns-witch-catalog.zone new file mode 100644 index 0000000..3ae4021 --- /dev/null +++ b/catalog-zones/dns-witch-catalog.zone @@ -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.