ansible-base/roles/mail_server/tasks/postfix.yml

22 lines
578 B
YAML

---
- name: Update Postfix configuration.
lineinfile:
dest: "{{ postfix_config_file }}"
line: "{{ item.name }} = {{ item.value }}"
regexp: "^{{ item.name }} ="
with_items:
- name: inet_interfaces
value: "{{ postfix_inet_interfaces }}"
- name: inet_protocols
value: "{{ postfix_inet_protocols }}"
- name: myhostname
value: "{{ inventory_hostname }}"
notify: restart postfix
- name: Ensure postfix is started and enabled at boot.
service:
name: postfix
enabled: "{{ postfix_service_enabled }}"
notify: restart postfix