2020-08-18 11:57:53 +02:00
|
|
|
### postfix fuer gmail; http://dokuwiki2.grote.lan/artikel/technik/postfix_mit_gmail_fuer_benachrichtigungen_einrichten
|
|
|
|
|
|
|
|
- name: postfix + Hilfsprogramme installieren
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.apt:
|
2020-08-18 11:57:53 +02:00
|
|
|
name:
|
|
|
|
- postfix
|
|
|
|
- mailutils
|
|
|
|
- libsasl2-modules
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: kopiere sasl_passwd
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.template:
|
2020-08-18 11:57:53 +02:00
|
|
|
src: sasl_passwd
|
|
|
|
dest: /etc/postfix/sasl_passwd
|
|
|
|
force: yes
|
|
|
|
notify:
|
|
|
|
- create_db_passwordfile
|
|
|
|
- postfix_testmail
|
|
|
|
|
|
|
|
- name: kopiere postfix_main.cf
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.template:
|
2020-08-18 11:57:53 +02:00
|
|
|
src: main.cf
|
|
|
|
dest: /etc/postfix/main.cf
|
|
|
|
notify:
|
|
|
|
- postfix_reload
|
|
|
|
- postfix_testmail
|
|
|
|
|
|
|
|
- name: Mail Cronjob - Anlegen
|
|
|
|
become: yes
|
2020-12-14 15:06:04 +01:00
|
|
|
when: gmail_mail_nach_cronjob # ohne parameter wird auf true geprueft https://www.buildahomelab.com/2018/11/12/using-ansible-when-statements/
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.cron:
|
2020-08-18 11:57:53 +02:00
|
|
|
name: MAILTO
|
|
|
|
env: yes
|
|
|
|
job: "{{ empfaenger_mail }}"
|
|
|
|
notify:
|
|
|
|
- postfix_testmail
|
|
|
|
|
|
|
|
- name: Mail Cronjob - Entfernen
|
|
|
|
become: yes
|
2020-12-14 15:06:04 +01:00
|
|
|
when: not gmail_mail_nach_cronjob
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.cron:
|
2020-08-18 11:57:53 +02:00
|
|
|
name: MAILTO
|
|
|
|
env: yes
|
|
|
|
job: ""
|