From 53f05a7071fe33610d40af17350a4830fab1261a Mon Sep 17 00:00:00 2001 From: Crest Date: Mon, 4 Jul 2022 02:56:34 +0200 Subject: [PATCH] Use path variables for Rspamd. Changes #31 --- roles/rspamd/handlers/main.yml | 10 +++++----- roles/rspamd/tasks/main.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/roles/rspamd/handlers/main.yml b/roles/rspamd/handlers/main.yml index 1f29368..a1792d0 100644 --- a/roles/rspamd/handlers/main.yml +++ b/roles/rspamd/handlers/main.yml @@ -5,16 +5,16 @@ state: reloaded - name: Restart Rspamd - command: s6-svc -wR -T 5000 -ru /run/service/rspamd + command: s6-svc -wR -T 5000 -ru {{ s6_scan_dir }}/rspamd - name: Restart Rspamd log - command: s6-svc -wR -T 5000 -ru /run/service/rspamd-log + command: s6-svc -wR -T 5000 -ru {{ s6_scan_dir }}/rspamd-log - name: Restart HAProxy - command: s6-svc -wU -T 5000 -ru /run/service/haproxy + command: s6-svc -wU -T 5000 -ru {{ s6_scan_dir }}/haproxy - name: Restart HAProxy log - command: s6-svc -wU -T 5000 -ru /run/service/haproxy-log + command: s6-svc -wU -T 5000 -ru {{ s6_scan_dir }}/haproxy-log - name: Reload HAProxy - command: s6-svc -2 /run/service/haproxy + command: s6-svc -2 {{ s6_scan_dir }}/haproxy diff --git a/roles/rspamd/tasks/main.yml b/roles/rspamd/tasks/main.yml index bf4a244..c872f38 100644 --- a/roles/rspamd/tasks/main.yml +++ b/roles/rspamd/tasks/main.yml @@ -43,7 +43,7 @@ - name: Create Rspamd service directories file: - path: '/etc/s6-rc/service/{{ item }}' + path: '{{ s6_etc_dir }}/service/{{ item }}' state: directory owner: root group: wheel @@ -56,7 +56,7 @@ - name: Generate Rspamd service scripts template: - dest: '/etc/s6-rc/service/{{ item }}' + dest: '{{ s6_etc_dir }}/service/{{ item }}' src: '{{ item }}.j2' mode: 0555 owner: root @@ -69,7 +69,7 @@ - name: Generate Rspamd service configuration copy: - dest: '/etc/s6-rc/service/{{ item.name }}' + dest: '{{ s6_etc_dir }}/service/{{ item.name }}' content: '{{ item.content }}' mode: 0444 owner: root @@ -86,13 +86,13 @@ meta: flush_handlers - name: Start Rspamd - command: fdmove -c 2 1 s6-rc -u -v 2 -t 15000 change rspamd + command: fdmove -c 2 1 s6-rc -l {{ s6_live_dir }} -u -v 2 -t 15000 change rspamd register: change changed_when: change.stdout | length > 0 - name: Enable Rspamd lineinfile: - path: /etc/s6-rc/service/enabled/contents + path: '{{ s6_etc_dir }}/service/enabled/contents' regexp: "^rspamd$" line: rspamd state: present