add nsd server

This commit is contained in:
Pim Kunis 2023-03-17 17:57:27 +01:00
parent 97f93b02a8
commit 19ccccfe93
4 changed files with 55 additions and 1 deletions

View file

@ -8,7 +8,6 @@
state: started state: started
port: 22 port: 22
host: "{{ internal_ip }}" host: "{{ internal_ip }}"
delay: 10
timeout: 300 timeout: 300
connect_timeout: 300 connect_timeout: 300
search_regex: OpenSSH search_regex: OpenSSH
@ -16,6 +15,8 @@
- name: Wait for cloud-init to finish - name: Wait for cloud-init to finish
command: command:
cmd: cloud-init status --wait cmd: cloud-init status --wait
register: cloudinit
changed_when: "'..' in cloudinit.stdout"
- name: Gather facts - name: Gather facts
setup: setup:
- name: Update repositories - name: Update repositories

View file

@ -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

View file

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

View file

@ -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' }}"