homelab/roles/base/tasks/mail.yml

21 lines
398 B
YAML

- name: Install msmtp
ansible.builtin.apt:
name: "{{ item }}"
state: present
loop:
- msmtp
- msmtp-mta
- mailutils
- name: Install msmtp configuration
ansible.builtin.template:
src: msmtprc.j2
dest: /root/.msmtprc
mode: 0600
- name: Install /etc/aliases
ansible.builtin.copy:
dest: /etc/aliases
content: "root: {{ mail.rootalias }}"
mode: 0644