diff --git a/handlers/main.yml b/handlers/main.yml index 6489ba2..ca22669 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -9,19 +9,19 @@ ansible.builtin.command: cmd: postmap "{{ __postfix_sender_canonical_path }}" changed_when: yes - listen: rebuild_sender_canonical_db + listen: Rebuild_sender_canonical_db # Restart postfix service - name: Restart postfix service ansible.builtin.service: name: "{{ __postfix_service }}" state: "{{ postfix_restart_state }}" - listen: "restart-postifx" + listen: Restart-postifx when: postfix_state | default('started') == 'started' - name: Reload postfix service ansible.builtin.service: name: "{{ __postfix_service }}" state: "reloaded" - listen: "reload-postfix" + listen: Reload-postfix when: postfix_state | default('started') == 'started' diff --git a/tasks/ldap_sender_canonical_cf.yml b/tasks/ldap_sender_canonical_cf.yml index ac4ad3d..e9e5e04 100644 --- a/tasks/ldap_sender_canonical_cf.yml +++ b/tasks/ldap_sender_canonical_cf.yml @@ -2,7 +2,7 @@ - name: Manage configuration parameter file when: postfix_sender_canonical_ldap_config.server_host is defined notify: - - reload-postfix + - Reload-postfix block: - name: Prepare template variable ansible.builtin.set_fact: @@ -21,7 +21,7 @@ - name: Remove mapping files when: postfix_sender_canonical_ldap_config.server_host is not defined notify: - - reload-postfix + - Reload-postfix block: - name: Remove map file ansible.builtin.file: diff --git a/tasks/main.yml b/tasks/main.yml index 610961e..d2b708a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -21,7 +21,7 @@ group: root setype: postfix_etc_t mode: 0644 - notify: restart-postifx + notify: Restart-postifx - name: Ensure Postfix is started and enabled at boot. ansible.builtin.service: @@ -36,7 +36,7 @@ line: "{{ item.key }}: {{ item.value if (item.value is string) else item.value | join(', ') }}" state: "{{ 'absent' if (item.value == 'undef') else 'present' }}" loop: "{{ postfix_alias_map | dict2items }}" - notify: rebuild_aliases_db + notify: Rebuild_aliases_db - name: Postfix is going to be removed from the system ansible.builtin.include_tasks: "uninstall_{{ ansible_os_family | lower }}.yml" diff --git a/tasks/sender_canonical_map.yml b/tasks/sender_canonical_map.yml index b863c59..44f0315 100644 --- a/tasks/sender_canonical_map.yml +++ b/tasks/sender_canonical_map.yml @@ -2,8 +2,8 @@ - name: Manage mapping entries when: postfix_sender_canonicals | length > 0 notify: - - rebuild_sender_canonical_db - - reload-postfix + - Rebuild_sender_canonical_db + - Reload-postfix block: - name: Prepare template variable ansible.builtin.set_fact: @@ -22,7 +22,7 @@ - name: Remove mapping files when: postfix_sender_canonicals | length == 0 notify: - - reload-postfix + - Reload-postfix block: - name: Remove map file ansible.builtin.file: diff --git a/tasks/uninstall_redhat.yml b/tasks/uninstall_redhat.yml index 1e49d2a..b3d8ba9 100644 --- a/tasks/uninstall_redhat.yml +++ b/tasks/uninstall_redhat.yml @@ -9,10 +9,9 @@ when: ansible_distribution_version is version('8', '>=') - name: Remove postfix from yum-based system - ansible.builtin.yum: + ansible.builtin.package: name: "{{ __postfix_packages }}" state: "absent" - autoremove: true when: ansible_distribution_version is version('8', '<') - name: Remove configuration files left on the system