Michael Grote
7a24089031
Reviewed-on: #584 Co-authored-by: Michael Grote <michael.grote@posteo.de> Co-committed-by: Michael Grote <michael.grote@posteo.de>
66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
---
|
|
### postfix fuer gmail; http://dokuwiki2.grote.lan/artikel/technik/postfix_mit_gmail_fuer_benachrichtigungen_einrichten
|
|
- name: postfix + Hilfsprogramme installieren
|
|
become: true
|
|
ansible.builtin.package:
|
|
name:
|
|
- postfix
|
|
- mailutils
|
|
- libsasl2-modules
|
|
state: present
|
|
|
|
- name: kopiere sasl_passwd
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: sasl_passwd
|
|
dest: /etc/postfix/sasl_passwd
|
|
force: true
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify:
|
|
- hash_sasl_passwd
|
|
- postfix_testmail
|
|
|
|
- name: kopiere sender_canonical
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: sender_canonical
|
|
dest: /etc/postfix/sender_canonical
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify:
|
|
- hash_sender_canonical
|
|
- postfix_reload
|
|
- postfix_testmail
|
|
|
|
- name: kopiere postfix_main.cf
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: main.cf
|
|
dest: /etc/postfix/main.cf
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify:
|
|
- postfix_reload
|
|
- postfix_testmail
|
|
|
|
- name: Mail Cronjob - Anlegen
|
|
become: true
|
|
when: postfix_mail_nach_cronjob # ohne parameter wird auf true geprueft https://www.buildahomelab.com/2018/11/12/using-ansible-when-statements/
|
|
ansible.builtin.cron:
|
|
name: MAILTO
|
|
env: true
|
|
job: "{{ empfaenger_mail }}"
|
|
notify:
|
|
- postfix_testmail
|
|
|
|
- name: Mail Cronjob - Entfernen
|
|
become: true
|
|
when: not postfix_mail_nach_cronjob
|
|
ansible.builtin.cron:
|
|
name: MAILTO
|
|
env: true
|
|
job: ""
|