2022-01-01 19:24:52 +01:00
|
|
|
---
|
|
|
|
- name: "Install Postfix via apt"
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
state: present
|
|
|
|
name:
|
|
|
|
- postfix
|
|
|
|
|
|
|
|
- name: Install Postfix mail gateway config
|
|
|
|
template:
|
|
|
|
src: templates/main.cf
|
|
|
|
dest: /etc/postfix/main.cf
|
|
|
|
|
2022-02-05 21:35:28 +01:00
|
|
|
- name: Build /etc/mailname
|
2022-02-05 21:49:58 +01:00
|
|
|
shell: hostname --fqdn > /etc/mailname
|
2022-02-05 21:35:28 +01:00
|
|
|
|
2022-01-01 19:24:52 +01:00
|
|
|
- name: Restart Postfix
|
|
|
|
service:
|
|
|
|
name: postfix
|
|
|
|
state: restarted
|
|
|
|
enabled: yes
|
2022-02-05 20:00:55 +01:00
|
|
|
|
|
|
|
- name: Allow smtp port via ufw
|
|
|
|
community.general.ufw:
|
|
|
|
rule: allow
|
|
|
|
port: smtp
|