2024-01-04 19:24:50 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install needed packages
|
|
|
|
become: true
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name:
|
|
|
|
- postfix
|
2024-01-08 10:06:57 +01:00
|
|
|
|
|
|
|
- name: Copy configuration files
|
|
|
|
become: true
|
|
|
|
loop:
|
|
|
|
- sql-virtual-mailbox-domains.cf
|
|
|
|
- sql-virtual-mailbox-maps.cf
|
|
|
|
- sql-virtual-alias-maps.cf
|
2024-07-25 17:12:26 +02:00
|
|
|
- sql-email-as-alias.cf
|
2024-01-08 10:06:57 +01:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: "{{ item }}.j2"
|
|
|
|
dest: "/etc/postfix/{{ item }}"
|
|
|
|
owner: root
|
|
|
|
group: postfix
|
|
|
|
mode: "640"
|
|
|
|
|
2024-01-27 13:21:06 +01:00
|
|
|
- name: Copy main.cf
|
2024-01-08 10:06:57 +01:00
|
|
|
become: true
|
2024-01-27 13:21:06 +01:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: main.cf.j2
|
|
|
|
dest: /etc/postfix/main.cf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "644"
|
2024-01-27 13:49:09 +01:00
|
|
|
notify: Restart postfix service
|
2024-01-27 13:47:17 +01:00
|
|
|
|
|
|
|
- name: Copy master.cf
|
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: master.cf.j2
|
|
|
|
dest: /etc/postfix/master.cf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "644"
|
2024-01-27 13:49:09 +01:00
|
|
|
notify: Restart postfix service
|
2024-09-28 11:40:02 +02:00
|
|
|
|
2024-10-11 16:26:13 +02:00
|
|
|
- name: Copy /etc/aliases
|
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: aliases.j2
|
|
|
|
dest: /etc/aliases
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "644"
|
|
|
|
notify: Run newaliases
|
|
|
|
|
2024-10-06 11:40:05 +02:00
|
|
|
- name: Allow incoming and outgoing SMTP/submission
|
2024-09-28 11:40:02 +02:00
|
|
|
become: true
|
2025-02-01 20:59:14 +01:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: "nftables/{{ item }}.d/smtp-submission.conf.j2"
|
2024-10-06 11:40:05 +02:00
|
|
|
dest: "/etc/nftables/{{ item }}.d/smtp-submission.conf"
|
2024-09-28 11:40:02 +02:00
|
|
|
mode: 0640
|
|
|
|
notify: Reload nftables service
|
2024-10-06 11:40:05 +02:00
|
|
|
loop:
|
|
|
|
- input
|
|
|
|
- output
|