2023-10-25 22:26:17 +02:00
|
|
|
---
|
2023-10-31 11:37:50 +01:00
|
|
|
- name: Ensure needed packages are installed
|
2023-10-25 22:26:17 +02:00
|
|
|
become: true
|
|
|
|
ansible.builtin.package:
|
|
|
|
name:
|
|
|
|
- postfix
|
|
|
|
- mailutils
|
2023-10-31 11:37:50 +01:00
|
|
|
# - libsasl2-modules
|
2023-10-25 22:26:17 +02:00
|
|
|
state: present
|
|
|
|
|
2023-10-31 11:37:50 +01:00
|
|
|
- name: kopiere sasl_passwd # entfernen
|
2023-10-25 22:26:17 +02:00
|
|
|
become: true
|
2023-10-31 11:37:50 +01:00
|
|
|
ansible.builtin.file:
|
|
|
|
path: /etc/postfix/sasl_passwd
|
|
|
|
state: absent
|
2023-10-25 22:26:17 +02:00
|
|
|
|
2023-10-31 11:37:50 +01:00
|
|
|
- name: kopiere sender_canonical # entfernen
|
2023-10-25 22:26:17 +02:00
|
|
|
become: true
|
2023-10-31 11:37:50 +01:00
|
|
|
ansible.builtin.file:
|
|
|
|
path: /etc/postfix/sasl_passwd
|
|
|
|
state: absent
|
2023-10-25 22:26:17 +02:00
|
|
|
|
2023-10-31 11:37:50 +01:00
|
|
|
- name: Template postfix configuration
|
2023-10-25 22:26:17 +02:00
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: main.cf
|
|
|
|
dest: /etc/postfix/main.cf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0644"
|
|
|
|
notify:
|
2023-10-31 11:37:50 +01:00
|
|
|
- reload postfix
|
|
|
|
- send testmail
|
2023-10-25 22:26:17 +02:00
|
|
|
|
2023-10-31 11:37:50 +01:00
|
|
|
- name: Ensure default cron mailing is disabled
|
2023-10-25 22:26:17 +02:00
|
|
|
become: true
|
|
|
|
ansible.builtin.cron:
|
|
|
|
name: MAILTO
|
|
|
|
env: true
|
|
|
|
job: ""
|