ansible-infra/roles/common/tasks/postfix.yml

49 lines
992 B
YAML
Raw Normal View History

2020-11-28 20:47:30 +01:00
- name: Install postfix package
apt:
name: postfix
state: present
- name: Copy postfix configuration file
template:
src: postfix/main.cf.j2
dest: /etc/postfix/main.cf
owner: root
group: root
mode: "644"
notify: reload postfix
- name: Copy aliases file
template:
src: postfix/aliases.j2
dest: "{{ smtp_aliases_path }}"
owner: root
group: root
mode: "644"
notify: update aliases
- name: Copy Postfix senders map
template:
src: postfix/senders.j2
dest: "{{ postfix_senders_map_path }}"
owner: root
group: root
mode: "644"
notify: update postfix senders
- name: Copy Postfix SASL secrets
template:
src: postfix/sasl_secrets.j2
dest: "{{ postfix_sasl_secrets_path }}"
owner: root
group: root
mode: "600"
notify: update postfix secrets
- name: Start postfix service
service:
name: postfix
state: started
enabled: yes
- name: Trigger Postfix handlers
meta: flush_handlers