-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Labels
Description
ansible-postfix/tasks/main.yml
Lines 165 to 182 in 7afaba0
| - name: configure transport maps | |
| ansible.builtin.lineinfile: | |
| dest: "{{ postfix_transport_maps_file }}" | |
| regexp: '^{{ item.pattern | regex_escape }}\s.*' | |
| line: '{{ item.pattern }} {{ item.result }}' | |
| owner: root | |
| group: root | |
| mode: 0644 | |
| create: true | |
| state: present | |
| with_items: "{{ postfix_transport_maps }}" | |
| notify: | |
| - postmap transport_maps | |
| - restart postfix | |
| tags: | |
| - configuration | |
| - postfix | |
| - postfix-transport-maps |
The role is not handling the transport_maps exclusive. Means, once you set one transport map item, it will life forever, even if you remove the item from postfix_transport_maps in your playbook.
One possible fix would be
--- /tmp/before.yml 2024-05-21 10:21:01.294611164 +0200
+++ /tmp/after.yml 2024-05-21 10:21:19.108152033 +0200
@@ -7,7 +7,7 @@
group: root
mode: 0644
create: true
- state: present
+ state: "{{ item.state | default('present') }}"
with_items: "{{ postfix_transport_maps }}"
notify:
- postmap transport_mapsThat brings the possibility to drain single items from your postfix_transport_maps.
Reactions are currently unavailable