diff --git a/handlers/main.yml b/handlers/main.yml index 07ffa6c65984be8b153c1585e3490d147b1064eb..26d9fbe15d3fe8403459f0ecdb6b8b6bcc6734c3 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,5 +1,6 @@ --- - name: make postfix sasl_passwd.db + when: not ansible_check_mode environment: LC_MESSAGES: 'C' command: make sasl_passwd.db @@ -10,6 +11,7 @@ changed_when: "result.stdout != \"make: 'sasl_passwd.db' is up to date.\"" - name: make postfix transport.db + when: not ansible_check_mode environment: LC_MESSAGES: 'C' command: make transport.db diff --git a/tasks/main.yml b/tasks/main.yml index d7c8d2e65f1168b6ea70de817fa6a4a25e891656..d729cb2707835b579cab59391f8908362d65a138 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -58,6 +58,7 @@ state: present line: "# This file is managed by Ansible, changes will be overwritten\n" regexp: '^# This file is managed by Ansible' + create: yes - name: Merge the main_cf dictionaries set_fact: @@ -72,6 +73,7 @@ line: '{{ item.key }} = {{ item.value }}' regexp: '^\s*{{ item.key }}\s*=' state: present + create: yes with_dict: '{{ __postfix__main_cf_merged }}' notify: ['reload postfix'] ...