homelab/roles/base/tasks/mail.yml

21 lines
398 B
YAML
Raw Normal View History

2021-06-08 04:33:55 +00:00
- name: Install msmtp
2023-05-04 03:42:55 +00:00
ansible.builtin.apt:
2021-06-08 04:33:55 +00:00
name: "{{ item }}"
state: present
loop:
- msmtp
- msmtp-mta
- mailutils
- name: Install msmtp configuration
2023-05-04 03:42:55 +00:00
ansible.builtin.template:
2021-06-08 04:33:55 +00:00
src: msmtprc.j2
dest: /root/.msmtprc
2023-05-04 05:44:18 +00:00
mode: 0600
2021-06-08 04:33:55 +00:00
- name: Install /etc/aliases
2023-05-04 03:42:55 +00:00
ansible.builtin.copy:
2021-06-08 04:33:55 +00:00
dest: /etc/aliases
content: "root: {{ mail.rootalias }}"
2023-05-04 05:44:18 +00:00
mode: 0644