move to new module setup (#2)

Reviewed-on: https://git.pim.kunis.nl/home/hermes/pulls/2
This commit is contained in:
Pim Kunis 2023-04-10 11:21:58 +00:00
parent d13fb8ee95
commit 1088fefdb2
20 changed files with 9 additions and 64 deletions

18
roles/nsd/tasks/main.yml Normal file
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' }}"