summaryrefslogtreecommitdiff
path: root/tasks/linux.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/linux.yml')
-rw-r--r--tasks/linux.yml36
1 files changed, 36 insertions, 0 deletions
diff --git a/tasks/linux.yml b/tasks/linux.yml
new file mode 100644
index 0000000..346c088
--- /dev/null
+++ b/tasks/linux.yml
@@ -0,0 +1,36 @@
+---
+- name: 'Install NSD [Void]'
+ xbps:
+ state: present
+ name: nsd
+ when: ansible_facts['distribution'].lower() == "void"
+- name: 'Install NSD [Alpine]'
+ apk:
+ state: present
+ name: nsd
+ when: ansible_facts['distribution'].lower() == "alpine"
+- name: Install nsd.conf
+ template:
+ src: nsd.conf
+ dest: /etc/nsd/nsd.conf
+- name: Install zone files
+ template:
+ src: 'zones/{{item}}'
+ dest: '/etc/nsd/{{item}}.zone'
+ validate: 'nsd-checkzone {{item}} %s'
+ owner: root
+ group: nsd
+ mode: 0640
+ loop: "{{nsd_zones}}"
+ notify:
+ - Restart NSD
+- name: Include Alpine Linux Speicifc Tasks
+ include_tasks: alpine.yml
+ when: ansible_facts['distribution'].lower() == "alpine"
+- name: Enable NSD
+ file:
+ src: /etc/sv/nsd
+ dest: /var/service/nsd
+ owner: root
+ group: root
+ state: link