vm-ansible/roles/internalsmtp/tasks/main.yaml
Torma Kristóf 41753eab2e
Some checks reported errors
continuous-integration/drone/push Build was killed
add the Prometheus user to postdrop group
2022-11-30 09:58:36 +01:00

54 lines
1.0 KiB
YAML

---
- name: "Install Postfix via apt"
apt:
update_cache: yes
state: present
name:
- postfix
- name: Install Postfix forwarder config
template:
src: templates/main.cf
dest: /etc/postfix/main.cf
- name: Restart Postfix
service:
name: postfix
state: restarted
enabled: yes
- name: "Install postfix exporter"
apt:
update_cache: yes
state: present
name:
- prometheus-postfix-exporter
- name: Copy postfix exporter config
ansible.builtin.copy:
src: prometheus-postfix-exporter
dest: /etc/default/prometheus-postfix-exporter
owner: root
group: root
mode: '0644'
- name: Add the prometheus user to postdrop group
ansible.builtin.user:
name: prometheus
groups: postdrop
append: yes
- 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: "9154"
proto: tcp
src: 192.168.69.0/24
...