Remove MTAs optional

This commit is contained in:
Unknown 2018-05-07 22:26:30 +08:00
parent dc3f1a83a1
commit 33820c140f
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
--- ---
msmtp_accounts: msmtp_accounts:
# Account 1 - a real account for testing # Account 1 - a real account for testing (feel free to use it for this role)
- account : yandex - account : yandex
host : smtp.yandex.com host : smtp.yandex.com
port : 587 port : 587
@ -29,4 +29,8 @@ msmtp_alias_default : emailer.tests@yandex.com
msmtp_alias_root : emailer.tests@yandex.com msmtp_alias_root : emailer.tests@yandex.com
msmtp_alias_cron : emailer.tests@yandex.com msmtp_alias_cron : emailer.tests@yandex.com
## Only enable, if the smtp account is working
msmtp_send_test_mail: no msmtp_send_test_mail: no
## This will remove most other mail transfer agents such as postfix, exim,...!
msmtp_remove_mtas: no

View File

@ -2,8 +2,8 @@
# Deploy msmtp # Deploy msmtp
- name: Update apt cache. - name: Update apt cache.
apt: apt:
upgrade: yes
update_cache: yes update_cache: yes
upgrade: no
cache_valid_time: 14400 # 4 hours cache_valid_time: 14400 # 4 hours
tags: mail tags: mail
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
@ -20,6 +20,7 @@
- sendmail* - sendmail*
tags: tags:
- mail - mail
when: msmtp_remove_mtas
- name: Install msmtp and mailx on Debian. - name: Install msmtp and mailx on Debian.
apt: apt:
@ -32,7 +33,7 @@
notify: test mail notify: test mail
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
# not tested my modifications with Archlinux # I've not tested my modifications with Archlinux
- name: Install msmtp and mailx on Archlinux. - name: Install msmtp and mailx on Archlinux.
pacman: name={{item}} state=present pacman: name={{item}} state=present
with_items: with_items: