ansible-development-environ.../roles/postfix/handlers/main.yml

38 lines
883 B
YAML

---
# handlers file for postfix
- name: rebuild alias database
ansible.builtin.command:
cmd: postmap "{{ postfix_alias_path }}"
- name: rebuild sender_access database
ansible.builtin.command:
cmd: postmap "{{ postfix_sender_access_path }}"
- name: rebuild recipient_access database
ansible.builtin.command:
cmd: postmap "{{ postfix_recipient_access_path }}"
- name: rebuild transport_maps database
ansible.builtin.command:
cmd: postmap /etc/postfix/transport
- name: validate configuration
ansible.builtin.command:
cmd: postconf
changed_when: no
- name: reload postfix
ansible.builtin.service:
name: "{{ postfix_service }}"
state: reloaded
when:
- not ansible_check_mode | bool
- name: restart postfix
ansible.builtin.service:
name: "{{ postfix_service }}"
state: restarted
when:
- not ansible_check_mode | bool