From 493a459466c454cab15a904d4a8447ad56a40bae Mon Sep 17 00:00:00 2001 From: Crest Date: Mon, 4 Jul 2022 02:46:45 +0200 Subject: [PATCH] Use path variables for mlmmj. Changes #31 --- roles/mlmmj/handlers/main.yml | 6 +++--- roles/mlmmj/tasks/main.yml | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/roles/mlmmj/handlers/main.yml b/roles/mlmmj/handlers/main.yml index 7a2797a..baeda5b 100644 --- a/roles/mlmmj/handlers/main.yml +++ b/roles/mlmmj/handlers/main.yml @@ -1,9 +1,9 @@ --- - 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: Reload Postfix - command: s6-svc -h /run/service/postfix + command: s6-svc -h {{ s6_scan_dir }}/postfix - name: Rebuild mlmmj virtual aliases command: postmap hash:/usr/local/etc/postfix/virtual_mlmmj @@ -17,4 +17,4 @@ state: reloaded - name: Restart mlmmj-maintd - command: s6-svc -wU -T 5000 -ru /run/service/mlmmj-maintd + command: s6-svc -wU -T 5000 -ru {{ s6_scan_dir }}/mlmmj-maintd diff --git a/roles/mlmmj/tasks/main.yml b/roles/mlmmj/tasks/main.yml index 4c3c3b3..0b8e73a 100644 --- a/roles/mlmmj/tasks/main.yml +++ b/roles/mlmmj/tasks/main.yml @@ -19,7 +19,6 @@ home: /var/vmail/mlmmj shell: /sbin/nologin - - name: Create lists directory file: path: /var/vmail/mlmmj @@ -73,7 +72,7 @@ - name: Create mlmmj-maintd service directories file: - path: '/etc/s6-rc/service/{{ item }}' + path: '{{ s6_etc_dir }}/service/{{ item }}' state: directory owner: root group: wheel @@ -85,7 +84,7 @@ - name: Generate mlmmj-maintd service scripts template: - dest: '/etc/s6-rc/service/{{ item }}' + dest: '{{ s6_etc_dir }}/service/{{ item }}' src: '{{ item }}.j2' mode: 0555 owner: root @@ -97,7 +96,7 @@ - name: Generate mlmmj-maintd service configuration copy: - dest: '/etc/s6-rc/service/{{ item.name }}' + dest: '{{ s6_etc_dir }}/service/{{ item.name }}' content: '{{ item.content }}' mode: 0444 owner: root @@ -113,13 +112,13 @@ meta: flush_handlers - name: Start mlmmj-maintd - command: fdmove -c 2 1 s6-rc -u -v 2 change mlmmj-maintd + command: fdmove -c 2 1 s6-rc -l {{ s6_live_dir }} -u -v 2 change mlmmj-maintd register: change changed_when: change.stdout | length > 0 - name: Enable mlmmj-maintd lineinfile: - path: /etc/s6-rc/service/enabled/contents + path: '{{ s6_etc_dir }}/service/enabled/contents' regexp: "^mlmmj-maintd$" line: "mlmmj-maintd" notify: @@ -269,7 +268,7 @@ - name: Set moderate subscription copy: dest: '/var/vmail/mlmmj/{{ item.name }}/control/submod' - content: '' + content: '{{ item.subscription_moderators | default([]) | join("\n") }}' force: no owner: mlmmj group: mlmmj