From 33820c140f71c883e7272d830ee9e80eb79b87d5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 7 May 2018 22:26:30 +0800 Subject: [PATCH] Remove MTAs optional --- defaults/main.yml | 6 +++++- tasks/main.yml | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 31ce075..adaac88 100755 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 1f673c3..16170f1 100755 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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: