Use path variables for Postfix. Changes #31

This commit is contained in:
Crest 2022-07-04 02:53:23 +02:00
parent 96b6c8fe4b
commit 6a8cee385b
2 changed files with 8 additions and 8 deletions

View File

@ -5,13 +5,13 @@
state: reloaded state: reloaded
- name: Restart Postfix - 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 - 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 - name: Reload Postfix
command: s6-svc -h /run/service/postfix command: s6-svc -h {{ s6_scan_dir }}/postfix
- name: Rebuild Postfix maps - name: Rebuild Postfix maps
command: 'postmap {{ item.type }}:{{ item.name }}' command: 'postmap {{ item.type }}:{{ item.name }}'

View File

@ -53,7 +53,7 @@
- name: Create Postfix service directories - name: Create Postfix service directories
file: file:
path: '/etc/s6-rc/service/{{ item }}' path: '{{ s6_etc_dir }}/service/{{ item }}'
state: directory state: directory
owner: root owner: root
group: wheel group: wheel
@ -62,7 +62,7 @@
- name: Generate Postfix service scripts - name: Generate Postfix service scripts
template: template:
dest: '/etc/s6-rc/service/{{ item }}' dest: '{{ s6_etc_dir }}/service/{{ item }}'
src: '{{ item }}.j2' src: '{{ item }}.j2'
mode: 0555 mode: 0555
owner: root owner: root
@ -74,7 +74,7 @@
- name: Generate Postfix service configuration - name: Generate Postfix service configuration
copy: copy:
dest: '/etc/s6-rc/service/{{ item.name }}' dest: '{{ s6_etc_dir }}/service/{{ item.name }}'
content: '{{ item.content }}' content: '{{ item.content }}'
mode: 0444 mode: 0444
owner: root owner: root
@ -129,13 +129,13 @@
meta: flush_handlers meta: flush_handlers
- name: Start Postfix - 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 register: change
changed_when: change.stdout | length > 0 changed_when: change.stdout | length > 0
- name: Enable Postfix - name: Enable Postfix
lineinfile: lineinfile:
path: /etc/s6-rc/service/enabled/contents path: '{{ s6_etc_dir }}/service/enabled/contents'
regexp: "^postfix$" regexp: "^postfix$"
line: "postfix" line: "postfix"
notify: notify: