Skip to content

Commit

Permalink
fix: make ansible-lint happy again
Browse files Browse the repository at this point in the history
As CentOS-7 support is fading out anyway, just switch to the package
module and later just remove it.
Not sure why notifies shall start with a capital letter too. Anyway,
just fix this.
  • Loading branch information
mrolli committed May 27, 2024
1 parent bcbbf7b commit 50b0a5a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 2 additions & 2 deletions tasks/ldap_sender_canonical_cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions tasks/sender_canonical_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions tasks/uninstall_redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 50b0a5a

Please sign in to comment.