homeserver/roles/mgrote.postfix/tasks/main.yml
mg 03d10acea6 Rolle postfix erweitert und Mails per Strato (#12)
Tags angepasst

Postfix Rolle erweitert mit Sender-Mail rewrite

Port für Strato angepasst

Rolle postfix in haertung eingebaut

Bugfix: Vars2

Bugfix: Vars

Doku postfix angepasst

Defaults Postfix aktualisiert

f2b Vars in GroupVars

Fail2Ban parametrisiert

KeePass: Postfix Absenderpasswort aktualisiert

Vars und defaults ergänzt

Rolle umbenannt in anderen Rollen

Rolle umbenannt: mgrote.postfix-gmail --> mgrote.postfix

postfix GroupVars auf Strato umgestellt

postfix defaults aktualisiert

Variablennamen postfix umbenannt

Keepass: gmail_nutzer_passwort --> postfix_absender_passwort

Co-authored-by: Michael Grote <38253905+quotengrote@users.noreply.github.com>
Reviewed-on: mg/ansible#12
2020-12-25 18:37:14 +01:00

58 lines
1.4 KiB
YAML

### postfix fuer gmail; http://dokuwiki2.grote.lan/artikel/technik/postfix_mit_gmail_fuer_benachrichtigungen_einrichten
- name: postfix + Hilfsprogramme installieren
become: yes
ansible.builtin.apt:
name:
- postfix
- mailutils
- libsasl2-modules
state: present
- name: kopiere sasl_passwd
become: yes
ansible.builtin.template:
src: sasl_passwd
dest: /etc/postfix/sasl_passwd
force: yes
notify:
- hash_sasl_passwd
- postfix_testmail
- name: kopiere sender_canonical
become: yes
ansible.builtin.template:
src: sender_canonical
dest: /etc/postfix/sender_canonical
notify:
- hash_sender_canonical
- postfix_reload
- postfix_testmail
- name: kopiere postfix_main.cf
become: yes
ansible.builtin.template:
src: main.cf
dest: /etc/postfix/main.cf
notify:
- postfix_reload
- postfix_testmail
- name: Mail Cronjob - Anlegen
become: yes
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: yes
job: "{{ empfaenger_mail }}"
notify:
- postfix_testmail
- name: Mail Cronjob - Entfernen
become: yes
when: not postfix_mail_nach_cronjob
ansible.builtin.cron:
name: MAILTO
env: yes
job: ""