Add ansible roles + templates
This commit is contained in:
6
ansible/roles/dns-internal/handlers/main.yml
Normal file
6
ansible/roles/dns-internal/handlers/main.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
## Reload NSD on changes
|
||||
- name: restart nsd
|
||||
ansible.builtin.service:
|
||||
name: nsd
|
||||
state: restarted
|
35
ansible/roles/dns-internal/tasks/main.yml
Normal file
35
ansible/roles/dns-internal/tasks/main.yml
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
|
||||
- name: Install packages for local resolver
|
||||
tags: resolver-install
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- nsd
|
||||
- git
|
||||
state: latest
|
||||
|
||||
- name: NSD - Enable service
|
||||
tags: nsd-enable
|
||||
ansible.builtin.service:
|
||||
name: 'nsd'
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
- name: NSD - Define configuration
|
||||
tags: nsd-configure
|
||||
ansible.builtin.template:
|
||||
src: nsd.conf
|
||||
dest: /etc/nsd/nsd.conf
|
||||
validate: /usr/sbin/nsd-checkconf %s
|
||||
backup: yes
|
||||
notify: restart nsd
|
||||
|
||||
- name: Auto-update the git repo for the internal zone
|
||||
tags: nsd-dns-gitupdate
|
||||
ansible.builtin.git:
|
||||
repo: https://git.labolyon.fr/LOL-si/dns-lolinternal.git
|
||||
dest: /srv/nsd/
|
||||
version: main
|
||||
update: yes
|
||||
notify:
|
||||
- restart nsd
|
22
ansible/roles/dns-internal/templates/nsd.conf
Normal file
22
ansible/roles/dns-internal/templates/nsd.conf
Normal file
@ -0,0 +1,22 @@
|
||||
server:
|
||||
server-count: 1
|
||||
hide-version: yes
|
||||
debug-mode: no
|
||||
verbosity: 2
|
||||
zonesdir: "/srv/nsd/"
|
||||
|
||||
remote-control:
|
||||
control-enable: yes
|
||||
control-interface: /var/run/nsd.sock
|
||||
|
||||
zone:
|
||||
name: "int.labolyon.fr"
|
||||
zonefile: "int.labolyon.fr.zone"
|
||||
|
||||
zone:
|
||||
name: "labolyon.dn42"
|
||||
zonefile: "labolyon.dn42.zone"
|
||||
|
||||
zone:
|
||||
name: "labolyon.fr"
|
||||
zonefile: "labolyon.fr.zone"
|
Reference in New Issue
Block a user