From 6a8cee385b58342b274dc1a8010abd0bd0c4ab37 Mon Sep 17 00:00:00 2001 From: Crest Date: Mon, 4 Jul 2022 02:53:23 +0200 Subject: [PATCH] Use path variables for Postfix. Changes #31 --- roles/postfix/handlers/main.yml | 6 +++--- roles/postfix/tasks/main.yml | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/postfix/handlers/main.yml b/roles/postfix/handlers/main.yml index c6005b8..7706fe0 100644 --- a/roles/postfix/handlers/main.yml +++ b/roles/postfix/handlers/main.yml @@ -5,13 +5,13 @@ state: reloaded - name: Restart Postfix - command: s6-svc -wU -T 5000 -ru /run/service/postfix + command: s6-svc -wU -T 5000 -ru {{ s6_scan_dir }}/postfix - name: Restart Postfix log - command: s6-svc -wU -T 5000 -ru /run/service/postfix-log + command: s6-svc -wU -T 5000 -ru {{ s6_scan_dir }}/postfix-log - name: Reload Postfix - command: s6-svc -h /run/service/postfix + command: s6-svc -h {{ s6_scan_dir }}/postfix - name: Rebuild Postfix maps command: 'postmap {{ item.type }}:{{ item.name }}' diff --git a/roles/postfix/tasks/main.yml b/roles/postfix/tasks/main.yml index ce2b6b1..8827a1d 100644 --- a/roles/postfix/tasks/main.yml +++ b/roles/postfix/tasks/main.yml @@ -53,7 +53,7 @@ - name: Create Postfix service directories file: - path: '/etc/s6-rc/service/{{ item }}' + path: '{{ s6_etc_dir }}/service/{{ item }}' state: directory owner: root group: wheel @@ -62,7 +62,7 @@ - name: Generate Postfix service scripts template: - dest: '/etc/s6-rc/service/{{ item }}' + dest: '{{ s6_etc_dir }}/service/{{ item }}' src: '{{ item }}.j2' mode: 0555 owner: root @@ -74,7 +74,7 @@ - name: Generate Postfix service configuration copy: - dest: '/etc/s6-rc/service/{{ item.name }}' + dest: '{{ s6_etc_dir }}/service/{{ item.name }}' content: '{{ item.content }}' mode: 0444 owner: root @@ -129,13 +129,13 @@ meta: flush_handlers - name: Start Postfix - command: fdmove -c 2 1 s6-rc -u -v 2 change postfix + command: fdmove -c 2 1 s6-rc -l {{ s6_live_dir }} -u -v 2 change postfix register: change changed_when: change.stdout | length > 0 - name: Enable Postfix lineinfile: - path: /etc/s6-rc/service/enabled/contents + path: '{{ s6_etc_dir }}/service/enabled/contents' regexp: "^postfix$" line: "postfix" notify: