diff options
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/alpine.yml | 24 | ||||
| -rw-r--r-- | tasks/main.yml | 13 |
2 files changed, 35 insertions, 2 deletions
diff --git a/tasks/alpine.yml b/tasks/alpine.yml new file mode 100644 index 0000000..7b73870 --- /dev/null +++ b/tasks/alpine.yml @@ -0,0 +1,24 @@ +- name: Install Runit service directory + file: + state: directory + path: /etc/sv/nsd + mode: '0755' +- name: Install Runit service command + template: + src: run.j2 + dest: /etc/sv/nsd/run + mode: '755' +- name: Install supervise symlink + file: + state: link + force: yes + src: /run/supervise.nsd + dest: /etc/sv/nsd/supervise + follow: false +- name: Enable NSD service + file: + state: link + force: yes + src: /etc/sv/nsd + dest: /var/service/nsd + follow: false diff --git a/tasks/main.yml b/tasks/main.yml index 0276545..346c088 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,8 +1,14 @@ --- -- name: Install NSD +- 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 @@ -11,13 +17,16 @@ template: src: 'zones/{{item}}' dest: '/etc/nsd/{{item}}.zone' - validate: '/usr/bin/nsd-checkzone {{item}} %s' + 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 |
