Merge branch 'ansible' into 'master'
add ansible configuration See merge request dns-witch/dns-witch-zones!1
This commit is contained in:
commit
3dbcf24381
4 changed files with 51 additions and 2 deletions
41
.gitlab-ci.yml
Normal file
41
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
image: debian:stable-slim
|
||||
|
||||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
build:
|
||||
stage: build
|
||||
before_script:
|
||||
- apt-get update
|
||||
- apt-get install -y knot-dnsutils
|
||||
script:
|
||||
- |
|
||||
for zonefile in zones/*; do
|
||||
zone=$(basename $zonefile .zone)
|
||||
echo "Checking zone $zone..."
|
||||
kzonecheck -v -o $zone $zonefile
|
||||
echo $(echo -n $zone | sha1sum | cut -f1 -d' ').zones 0 IN PTR $zone. >> catalog-zones/dns-witch-catalog.zone
|
||||
done
|
||||
artifacts:
|
||||
paths:
|
||||
- catalog-zones/*
|
||||
expire_in: 1 day
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
script:
|
||||
- scp -r zones catalog-zones ${SSH_PRIMARY_NS}:/var/lib/knot/
|
||||
- ssh ${SSH_PRIMARY_NS} /usr/sbin/knotc reload
|
||||
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 $HOME/.ssh
|
||||
- chmod 700 $HOME/.ssh
|
||||
- echo "$SSH_KNOWN_HOSTS" >> $HOME/.ssh/known_hosts
|
||||
- echo "$SSH_CONFIG" >> $HOME/.ssh/config
|
||||
- chmod 644 $HOME/.ssh/{known_hosts,config}
|
||||
when: manual
|
|
@ -2,3 +2,6 @@
|
|||
|
||||
A DNS zone management service to make accessible the [.eu.org](https://nic.eu.org) domain names to everyone.
|
||||
|
||||
### Deployment
|
||||
|
||||
Deploy the configuration using `ansible-playbook -i config/host config/deploy.yml`
|
||||
|
|
5
catalog-zones/dns-witch-catalog.zone
Normal file
5
catalog-zones/dns-witch-catalog.zone
Normal file
|
@ -0,0 +1,5 @@
|
|||
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.
|
||||
|
||||
version 0 IN TXT "2"
|
|
@ -17,8 +17,8 @@ autel.grimoire.eu.org. 3600 A 95.217.26.22
|
|||
; AAAA Records
|
||||
@ IN 3600 AAAA 2a01:4f9:c010:ed58::1
|
||||
*.grimoire.eu.org. IN 3600 AAAA 2a01:4f9:c010:ed58::1
|
||||
autel.grimoire.eu.org. 3600 A 2a01:4f9:c010:ed58::1
|
||||
*.autel.grimoire.eu.org. 3600 A 2a01:4f9:c010:ed58::1
|
||||
autel.grimoire.eu.org. 3600 AAAA 2a01:4f9:c010:ed58::1
|
||||
*.autel.grimoire.eu.org. 3600 AAAA 2a01:4f9:c010:ed58::1
|
||||
|
||||
; MX Records
|
||||
@ IN 3600 MX 10 familier.net.eu.org.
|
||||
|
|
Loading…
Reference in a new issue