2019-10-27 23:35:12 +00:00
|
|
|
---
|
|
|
|
- name: gather OS specific variables
|
2022-08-31 03:19:06 +00:00
|
|
|
ansible.builtin.include_vars: "{{ item }}"
|
2019-10-27 23:35:12 +00:00
|
|
|
with_first_found:
|
|
|
|
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
|
|
|
|
- "{{ ansible_distribution }}.yaml"
|
|
|
|
- "{{ ansible_os_family }}.yaml"
|
|
|
|
|
|
|
|
- name: configure postfix
|
|
|
|
template:
|
|
|
|
src: main.cf.j2
|
|
|
|
dest: "{{ postfix_etc_path }}/main.cf"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: reload postfix
|
|
|
|
|
|
|
|
- name: install postfix
|
|
|
|
package:
|
|
|
|
name: "{{ postfix_package_name }}"
|
|
|
|
state: "{{ postfix_package_state }}"
|
|
|
|
|
|
|
|
- name: sasl_passwd map
|
|
|
|
template:
|
|
|
|
src: sasl_passwd.j2
|
|
|
|
dest: "{{ postfix_sasl_passwd_map_path }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
|
|
|
notify:
|
|
|
|
- postmap sasl_passwd
|
|
|
|
- reload postfix
|
|
|
|
|
2019-11-29 03:47:08 +00:00
|
|
|
- name: manage /etc/aliases
|
|
|
|
template:
|
|
|
|
src: aliases.j2
|
|
|
|
dest: "{{ postfix_aliases_map_path }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify:
|
|
|
|
- postmap aliases
|
|
|
|
|
2019-10-27 23:35:12 +00:00
|
|
|
- name: manage postfix service
|
|
|
|
service:
|
|
|
|
name: "{{ postfix_service_name }}"
|
|
|
|
state: "{{ postfix_service_state }}"
|
|
|
|
enabled: "{{ postfix_service_enabled }}"
|