ansible/roles/postfix/tasks/main.yml

30 lines
576 B
YAML

---
- name: Install postfix
apt:
name: postfix
- name: Configure postfix
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: root
mode: u=rw,g=,o=
loop:
- src: main.cf.j2
dest: /etc/postfix/main.cf
- src: master.cf.j2
dest: /etc/postfix/master.cf
- src: virtual.j2
dest: /etc/postfix/virtual
- src: vmailbox.j2
dest: /etc/postfix/vmailbox
notify:
- Reload postfix
- name: Enable and start postfix
systemd:
name: postfix.service
state: started
enabled: true
...