2014-03-21 19:16:55 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Author: Adham Helal
|
|
|
|
#
|
|
|
|
# Objective: Deploy msmtp
|
|
|
|
|
|
|
|
- name: Update apt cache
|
|
|
|
apt: update_cache=yes cache_valid_time=3600
|
|
|
|
tags: mail
|
2014-06-24 05:02:19 +00:00
|
|
|
when: ansible_os_family == "Debian"
|
2014-03-21 19:16:55 +00:00
|
|
|
|
|
|
|
- name: Install msmtp and mailx
|
|
|
|
apt: pkg={{item}} state=present
|
|
|
|
with_items:
|
|
|
|
- msmtp
|
|
|
|
- msmtp-mta
|
|
|
|
- bsd-mailx
|
|
|
|
tags: mail
|
|
|
|
notify: test mail
|
2014-06-24 05:02:19 +00:00
|
|
|
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"
|
2014-03-21 19:16:55 +00:00
|
|
|
|
|
|
|
- name: Copy mstprc conf file
|
2014-03-26 18:24:35 +00:00
|
|
|
template:
|
|
|
|
src=msmtprc.j2
|
|
|
|
dest=/etc/msmtprc
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0644
|
2014-03-21 19:16:55 +00:00
|
|
|
tags: mail
|
|
|
|
notify: test mail
|
|
|
|
|
|
|
|
- name: Copy aliases conf file
|
|
|
|
template: src=aliases.j2 dest=/etc/aliases
|
|
|
|
owner=root group=root mode=0644
|
|
|
|
tags: mail
|
2014-06-24 05:02:19 +00:00
|
|
|
notify: test mail
|