diff --git a/ansible/hermes.yml b/ansible/hermes.yml index cfb49ba..fb6163a 100644 --- a/ansible/hermes.yml +++ b/ansible/hermes.yml @@ -8,7 +8,6 @@ state: started port: 22 host: "{{ internal_ip }}" - delay: 10 timeout: 300 connect_timeout: 300 search_regex: OpenSSH @@ -16,6 +15,8 @@ - name: Wait for cloud-init to finish command: cmd: cloud-init status --wait + register: cloudinit + changed_when: "'..' in cloudinit.stdout" - name: Gather facts setup: - name: Update repositories diff --git a/ansible/roles/nsd/files/nsd.conf b/ansible/roles/nsd/files/nsd.conf new file mode 100644 index 0000000..22a26ac --- /dev/null +++ b/ansible/roles/nsd/files/nsd.conf @@ -0,0 +1,13 @@ +server: + ip-address: ens3 + port: 5353 + server-count: 1 + verbosity: 1 + hide-version: yes + zonesdir: "/etc/nsd/zones" + ip-transparent: yes + ip-freebind: yes + +zone: + name: pim.kunis.nl + zonefile: pim.kunis.nl diff --git a/ansible/roles/nsd/files/zones/pim.kunis.nl b/ansible/roles/nsd/files/zones/pim.kunis.nl new file mode 100644 index 0000000..2378d7a --- /dev/null +++ b/ansible/roles/nsd/files/zones/pim.kunis.nl @@ -0,0 +1,22 @@ +$ORIGIN pim.kunis.nl. +$TTL 60 + +pim.kunis.nl. IN SOA ns.pim.kunis.nl. pim.kunis.nl. 2023020800 1800 3600 1209600 3600 + + NS ns.pim.kunis.nl. + A 84.245.14.149 + AAAA 2a02:58:19a:f730:c8fe:c0ff:feff:ee07 + TXT "v=spf1 ~all" + +_dmarc IN TXT "v=DMARC1; p=reject; aspf=s; adkim=s; rua=mailto:wpux1bq8@ag.eu.dmarcian.com;" + +www IN A 84.245.14.149 + IN AAAA 2a02:58:19a:f730:b62e:99ff:fe77:1bda +ns IN A 84.245.14.149 + IN AAAA 2a02:58:19a:f730:c8fe:c0ff:feff:ee07 + +social IN CNAME www.pim.kunis.nl. +dav IN CNAME www.pim.kunis.nl. +git IN CNAME www.pim.kunis.nl. +meet IN CNAME www.pim.kunis.nl. +rss IN CNAME www.pim.kunis.nl. diff --git a/ansible/roles/nsd/tasks/main.yml b/ansible/roles/nsd/tasks/main.yml index e69de29..39d1547 100644 --- a/ansible/roles/nsd/tasks/main.yml +++ b/ansible/roles/nsd/tasks/main.yml @@ -0,0 +1,18 @@ +- name: Install nsd + apt: + name: nsd +- name: Copy nsd.conf + copy: + src: "{{ role_path }}/files/nsd.conf" + dest: /etc/nsd/nsd.conf + register: config +- name: Copy zone directory + copy: + src: "{{ role_path }}/files/zones" + dest: /etc/nsd + register: zones +- name: Enable nsd + systemd: + name: nsd + enabled: true + state: "{{ 'restarted' if config.changed or zones.changed else 'started' }}"