hygienic-books 41a4104764 fix(role): Correctly rebuild Postfix files
We were accidentally looking for Jinja2 files ending in .j2. That was
a copy-paste error, those files do not have a .j2 file extension.
2025-04-10 02:25:09 +02:00

25 lines
984 B
YAML

# SPDX-License-Identifier: MIT
- name: 'Rebuild Postfix lookup tables'
loop_control:
loop_var: 'somta_postfix_postmap_handler'
label: 'Rebuild ''/etc/postfix/{{ somta_postfix_postmap_handler.lookup_table_source_file }}'' lookup table'
loop:
- { lookup_table_source_file: 'sasl_passwd' }
- { lookup_table_source_file: 'sender_canonical_maps' }
- { lookup_table_source_file: 'smtp_header_checks' }
ansible.builtin.shell: |
postmap '/etc/postfix/{{ somta_postfix_postmap_handler.lookup_table_source_file }}'
listen: 'Ensure that a Mail Transfer Agent is running with newest config'
- name: 'Rebuild e-mail aliases lookup tables'
ansible.builtin.shell: |
newaliases
listen: 'Ensure that a Mail Transfer Agent is running with newest config'
- name: 'Restart postfix.service'
ansible.builtin.service:
name: 'postfix.service'
state: 'restarted'
enabled: true
listen: 'Ensure that a Mail Transfer Agent is running with newest config'