From 5298cbaf934b77172ad86fdce1eff0c526158ce0 Mon Sep 17 00:00:00 2001 From: Mike C Date: Tue, 24 Jun 2014 01:02:19 -0400 Subject: [PATCH 1/2] Make Arch aware --- tasks/msmtp.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tasks/msmtp.yml b/tasks/msmtp.yml index e2b30be..e1884f4 100644 --- a/tasks/msmtp.yml +++ b/tasks/msmtp.yml @@ -7,6 +7,7 @@ - name: Update apt cache apt: update_cache=yes cache_valid_time=3600 tags: mail + when: ansible_os_family == "Debian" - name: Install msmtp and mailx apt: pkg={{item}} state=present @@ -16,6 +17,15 @@ - bsd-mailx tags: mail notify: test mail + when: ansible_os_family == "Debian" + +- name: Install msmtp and mailx + pacman: name={{item}} state=present + with_items: + - msmtp + - msmtp-mta + - mailutils + when: ansible_os_family == "Archlinux" - name: Copy mstprc conf file template: @@ -31,4 +41,4 @@ template: src=aliases.j2 dest=/etc/aliases owner=root group=root mode=0644 tags: mail - notify: test mail \ No newline at end of file + notify: test mail From 65fb55beb241a7bd44f4b2490c7aa25a7ccb0bf3 Mon Sep 17 00:00:00 2001 From: Mike C Date: Tue, 24 Jun 2014 01:43:16 -0400 Subject: [PATCH 2/2] Add option to change tls trust file --- templates/msmtprc.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/msmtprc.j2 b/templates/msmtprc.j2 index defc4b5..aefbecc 100644 --- a/templates/msmtprc.j2 +++ b/templates/msmtprc.j2 @@ -3,7 +3,11 @@ defaults auth on tls on +{% if msmtp_tls_trust_file is defined %} +tls_trust_file {{msmtp_tls_trust_file}} +{% else %} tls_trust_file /etc/ssl/certs/ca-certificates.crt +{% endif %} # Logging {% if msmtp_log is defined %} @@ -33,4 +37,4 @@ password {{msmtp_account.password}} # Default account to use account default : {{msmtp_default_account}} -aliases /etc/aliases \ No newline at end of file +aliases /etc/aliases