vm-ansible/roles/smtpgateway/tasks/main.yaml
Torma Kristóf 590f20de67
Some checks failed
continuous-integration/drone/push Build is failing
restart services
2022-05-29 15:24:02 +02:00

48 lines
877 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
- name: "Install postfix exporter"
apt:
update_cache: yes
state: present
name:
- prometheus-postfix-exporter
- name: Enable and restart exporter daemon
service:
name: prometheus-postfix-exporter
state: restarted
enabled: yes
- name: Allow postfix exporter via ufw
community.general.ufw:
rule: allow
port: 9706
proto: tcp
src: 192.168.69.0/24
...