summaryrefslogtreecommitdiff
path: root/roles/postfix/tasks/main.yml
diff options
context:
space:
mode:
authorDmitry Ilvokhin <d@ilvokhin.com>2024-04-06 19:53:25 +0100
committerDmitry Ilvokhin <d@ilvokhin.com>2024-04-06 19:53:25 +0100
commita5105a330af202e5880c004d7c997882cdb96681 (patch)
tree70fb2bc74668470b90b10816836b4b3d72380993 /roles/postfix/tasks/main.yml
parent8cce1ff3e54c89dbfb80851cf51dfbb7232f2d76 (diff)
downloadinfra-a5105a330af202e5880c004d7c997882cdb96681.tar.gz
infra-a5105a330af202e5880c004d7c997882cdb96681.tar.bz2
infra-a5105a330af202e5880c004d7c997882cdb96681.zip
Add postfix role
Diffstat (limited to 'roles/postfix/tasks/main.yml')
-rw-r--r--roles/postfix/tasks/main.yml57
1 files changed, 57 insertions, 0 deletions
diff --git a/roles/postfix/tasks/main.yml b/roles/postfix/tasks/main.yml
new file mode 100644
index 0000000..63a760d
--- /dev/null
+++ b/roles/postfix/tasks/main.yml
@@ -0,0 +1,57 @@
+- name: Install postfix
+ ansible.builtin.package:
+ name:
+ - postfix
+ - postfix-pcre
+ state: present
+
+- name: Copy postfix lookup tables
+ ansible.builtin.copy:
+ src: '{{ item }}'
+ dest: /etc/postfix/
+ owner: root
+ group: root
+ mode: u+rw,g+r,o+r
+ loop:
+ - files/virtual
+ notify:
+ - Update postfix lookup tables
+ - Reload postfix
+
+- name: Copy postfix additional restriction files
+ ansible.builtin.copy:
+ src: '{{ item }}'
+ dest: /etc/postfix/
+ owner: root
+ group: root
+ mode: u+rw,g+r,o+r
+ loop:
+ - files/sender_access
+ - files/body_checks
+ notify:
+ - Reload postfix
+
+- name: Configure postfix
+ ansible.builtin.copy:
+ src: files/main.cf
+ dest: /etc/postfix/main.cf
+ owner: root
+ group: root
+ mode: u+rw,g+r,o+r
+ notify:
+ - Check postfix
+ - Reload postfix
+
+- name: Copy postfix certificate renewal hook
+ ansible.builtin.copy:
+ src: files/postfix.sh
+ dest: /etc/letsencrypt/renewal-hooks/deploy/postfix.sh
+ owner: root
+ group: root
+ mode: u+rwx,g+r,o+r
+
+- name: Enable postfix systemd service
+ ansible.builtin.service:
+ name: postfix
+ enabled: yes
+ state: started