From 96b6c8fe4bf154bb7e5dd4abb68b9294799a8e64 Mon Sep 17 00:00:00 2001 From: Crest Date: Mon, 4 Jul 2022 02:49:53 +0200 Subject: [PATCH] Use path variables for OpenNTPD. Changes #31 --- roles/openntpd/handlers/main.yml | 4 ++-- roles/openntpd/tasks/main.yml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/openntpd/handlers/main.yml b/roles/openntpd/handlers/main.yml index cbeb514..6196926 100644 --- a/roles/openntpd/handlers/main.yml +++ b/roles/openntpd/handlers/main.yml @@ -5,7 +5,7 @@ state: reloaded - name: Restart OpenNTPD - command: s6-svc -wR -T 5000 -ru /run/service/openntpd + command: s6-svc -wR -T 5000 -ru {{ s6_scan_dir }}/openntpd - name: Restart OpenNTPD log - command: s6-svc -wR -T 5000 -ru /run/service/openntpd-log + command: s6-svc -wR -T 5000 -ru {{ s6_scan_dir }}/openntpd-log diff --git a/roles/openntpd/tasks/main.yml b/roles/openntpd/tasks/main.yml index 87625ad..97f6648 100644 --- a/roles/openntpd/tasks/main.yml +++ b/roles/openntpd/tasks/main.yml @@ -14,7 +14,7 @@ - name: Create OpenNTPD 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 OpenNTPD 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 OpenNTPD 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 OpenNTPD - command: fdmove -c 2 1 s6-rc -u -v 2 -t 15000 change openntpd + command: fdmove -c 2 1 s6-rc -l {{ s6_live_dir }} -u -v 2 -t 15000 change openntpd register: change changed_when: change.stdout | length > 0 - name: Enable OpenNTPD lineinfile: - path: /etc/s6-rc/service/enabled/contents + path: '{{ s6_etc_dir }}/service/enabled/contents' regexp: "^openntpd$" line: openntpd state: present