mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-08 18:35:11 +00:00
Refactored mail-related roles to support running Infinito.Nexus on nodes without a dedicated mail server: - Introduced sys-svc-mail as central mail orchestration role. - Split msmtp handling into sys-svc-mail-msmtp. - Added sys-svc-mail-smtp to provide a localhost-only Postfix relay when Mailu is not present. - Updated alert/health roles to use the new mail orchestration. - Avoid installing postfix inside containers via IS_CONTAINER guard. - Adjusted WordPress role to use the new msmtp template path. This allows lightweight deployments (e.g. Raspberry Pi, robots, edge nodes) to send mail via localhost without requiring a full Mailu stack. ChatGPT discussion: https://chatgpt.com/share/6931edf1-cb98-800f-9e3c-a62d69ccb223
27 lines
636 B
YAML
27 lines
636 B
YAML
- include_tasks: utils/once/flag.yml
|
|
|
|
- name: "Ensure msmtp-mta is absent (conflicts with postfix smtp-forwarder)"
|
|
community.general.pacman:
|
|
name:
|
|
- msmtp-mta
|
|
state: absent
|
|
|
|
- name: "Install local SMTP relay (Postfix)"
|
|
community.general.pacman:
|
|
name:
|
|
- postfix
|
|
state: present
|
|
|
|
- name: "Configure Postfix as localhost-only relay"
|
|
ansible.builtin.template:
|
|
src: "postfix-main.cf.j2"
|
|
dest: "/etc/postfix/main.cf"
|
|
mode: "0644"
|
|
|
|
- name: "Ensure postfix is enabled and running"
|
|
ansible.builtin.systemd:
|
|
name: postfix
|
|
enabled: true
|
|
state: started
|
|
when: not( IS_CONTAINER | bool )
|