2020-08-09 05:13:26 +00:00
|
|
|
---
|
|
|
|
- name: Gather instance facts
|
|
|
|
setup:
|
|
|
|
- name: Update APT package cache
|
|
|
|
apt:
|
|
|
|
update_cache: "true"
|
|
|
|
cache_valid_time: "3600"
|
|
|
|
tags:
|
|
|
|
- msmtp-install
|
|
|
|
- name: Install msmtp
|
|
|
|
package:
|
|
|
|
name: "{{ packages }}"
|
|
|
|
state: present
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- msmtp
|
|
|
|
- msmtp-mta
|
|
|
|
- ca-certificates
|
|
|
|
tags:
|
|
|
|
- msmtp-install
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Generate msmtp configuration file
|
|
|
|
template:
|
|
|
|
src: msmtprc
|
|
|
|
dest: "/etc/msmtprc"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
tags:
|
|
|
|
- msmtp-config
|
|
|
|
- name: Generate aliases configuration file
|
|
|
|
template:
|
|
|
|
src: aliases
|
|
|
|
dest: "/etc/aliases"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
tags:
|
|
|
|
- msmtp-config
|
2020-08-09 05:38:28 +00:00
|
|
|
- name: Create msmtp log file
|
|
|
|
copy:
|
|
|
|
content: ""
|
|
|
|
dest: /var/log/msmtp.log
|
|
|
|
force: no
|
|
|
|
group: root
|
|
|
|
owner: root
|
|
|
|
mode: 0600
|