From 8f23dd83b07fa418d30e15af8bbf2ac91046b173 Mon Sep 17 00:00:00 2001 From: Crest Date: Mon, 4 Jul 2022 02:47:17 +0200 Subject: [PATCH] Use path variables for NSD. Changes #31 --- roles/nsd/handlers/main.yml | 6 +++--- roles/nsd/tasks/main.yml | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/nsd/handlers/main.yml b/roles/nsd/handlers/main.yml index 2dace3e..e7573d1 100644 --- a/roles/nsd/handlers/main.yml +++ b/roles/nsd/handlers/main.yml @@ -5,10 +5,10 @@ state: reloaded - name: Reload nsd - command: s6-svc -h /run/service/nsd + command: s6-svc -h {{ s6_scan_dir }}/nsd - name: Restart nsd - command: s6-svc -wR -T 5000 -ru /run/service/nsd + command: s6-svc -wR -T 5000 -ru {{ s6_scan_dir }}/nsd - name: Restart nsd log - command: s6-svc -wR -T 5000 -ru /run/service/nsd-log + command: s6-svc -wR -T 5000 -ru {{ s6_scan_dir }}/nsd-log diff --git a/roles/nsd/tasks/main.yml b/roles/nsd/tasks/main.yml index c51a411..543a962 100644 --- a/roles/nsd/tasks/main.yml +++ b/roles/nsd/tasks/main.yml @@ -14,7 +14,7 @@ - name: Create nsd service directories file: - path: '/etc/s6-rc/service/{{ item }}' + path: '{{ s6_etc_dir }}/service/{{ item }}' state: directory owner: root group: wheel @@ -27,7 +27,7 @@ - name: Generate nsd service scripts template: - dest: '/etc/s6-rc/service/{{ item }}' + dest: '{{ s6_etc_dir }}/service/{{ item }}' src: '{{ item }}.j2' mode: 0555 owner: root @@ -40,7 +40,7 @@ - name: Generate nsd service configuration copy: - dest: '/etc/s6-rc/service/{{ item.name }}' + dest: '{{ s6_etc_dir }}/service/{{ item.name }}' content: '{{ item.content }}' mode: 0444 owner: root @@ -67,13 +67,13 @@ meta: flush_handlers - name: Start nsd - command: fdmove -c 2 1 s6-rc -u -v 2 -t 15000 change nsd + command: fdmove -c 2 1 s6-rc -l {{ s6_live_dir }} -u -v 2 -t 15000 change nsd register: change changed_when: change.stdout | length > 0 - name: Enable nsd lineinfile: - path: /etc/s6-rc/service/enabled/contents + path: '{{ s6_etc_dir }}/service/enabled/contents' regexp: "^nsd$" line: nsd state: present