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:
# Account 1 - a real account for testing
# Account 1 - a real account for testing (feel free to use it for this role)
- account : yandex
host : smtp.yandex.com
port : 587
@ -29,4 +29,8 @@ msmtp_alias_default : emailer.tests@yandex.com
msmtp_alias_root : emailer.tests@yandex.com
msmtp_alias_cron : emailer.tests@yandex.com
## Only enable, if the smtp account is working
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
- name: Update apt cache.
apt:
upgrade: yes
update_cache: yes
upgrade: no
cache_valid_time: 14400 # 4 hours
tags: mail
when: ansible_os_family == "Debian"
@ -20,6 +20,7 @@
- sendmail*
tags:
- mail
when: msmtp_remove_mtas
- name: Install msmtp and mailx on Debian.
apt:
@ -32,7 +33,7 @@
notify: test mail
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.
pacman: name={{item}} state=present
with_items: