ansible-postfix icon indicating copy to clipboard operation
ansible-postfix copied to clipboard

transport_maps keeps records forever

Open markuman opened this issue 9 months ago • 3 comments

https://github.com/Oefenweb/ansible-postfix/blob/7afaba08ddff0803e193c2b2c094624de418cb59/tasks/main.yml#L165-L182

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_maps

That brings the possibility to drain single items from your postfix_transport_maps.

markuman avatar May 21 '24 08:05 markuman