ansible/roles/msmtp/tasks/main.yml

41 lines
866 B
YAML
Raw Normal View History

2020-08-04 22:51:58 +00:00
---
- name: Gather instance facts
setup:
- name: Update APT package cache
apt:
update_cache: "true"
cache_valid_time: "3600"
2020-08-04 22:51:58 +00:00
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:
2020-08-04 23:17:06 +00:00
src: msmtprc
2020-08-04 22:51:58 +00:00
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