From 1204730924436ef9e1c7c49c9557837f9a5ed0e8 Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Wed, 8 Feb 2023 00:40:09 -0800 Subject: fork https://github.com/mattsta/mailweb --- ansible/roles/postfix/tasks/main.yml | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 ansible/roles/postfix/tasks/main.yml (limited to 'ansible/roles/postfix/tasks') diff --git a/ansible/roles/postfix/tasks/main.yml b/ansible/roles/postfix/tasks/main.yml new file mode 100644 index 0000000..57b0601 --- /dev/null +++ b/ansible/roles/postfix/tasks/main.yml @@ -0,0 +1,50 @@ +--- +# postfix install and configuration +# note: this postfix config requires open ports: 25 and 587 +- name: install postfix + apt: + state: latest + pkg: + - postfix + - postfix-doc + - postfix-pcre + +- name: give postfix user permission to read private keys + user: + name: postfix + groups: ssl-cert + append: yes + +- name: copy postfix config + copy: + src: postfix/ + dest: /etc/postfix/ + mode: preserve + notify: + - restart postfix # NB this could be a reload instead + - rehash postfix aliases + +- name: instantiate postfix main.cf template + template: + src: postfix/main.cf.j2 + dest: /etc/postfix/main.cf + notify: + - reload postfix + + +# verify everything is running +- name: verify services are running in dependency order + service: + name: "{{ item }}" + enabled: yes + state: started + loop: + - postfix + +- name: reload if certs newish + include_role: + name: certreload + vars: + certreload: + notifiers: + - reload postfix -- cgit v1.2.3