vm-ansible/roles/smtpgateway/tasks/main.yaml

28 lines
481 B
YAML

---
- 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
- name: Build /etc/mailname
shell: hostname --fqdn > /etc/mailname
- name: Restart Postfix
service:
name: postfix
state: restarted
enabled: yes
- name: Allow smtp port via ufw
community.general.ufw:
rule: allow
port: smtp
...