From 9960f28636b7398ec30eb65a621ad99b91dabb05 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 28 Jan 2021 20:00:06 +0100 Subject: [PATCH] Update to 2021-01-28 20:00 --- roles/postfix/handlers/main.yml | 4 +--- roles/postfix/tasks/main.yml | 10 +++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/postfix/handlers/main.yml b/roles/postfix/handlers/main.yml index 24fdff6..5c65f90 100644 --- a/roles/postfix/handlers/main.yml +++ b/roles/postfix/handlers/main.yml @@ -1,7 +1,5 @@ --- - name: restart postfix - service: name=postfix state=restarted enabled=yes + service: name=postfix state=restarted -- name: rehash relay_auth - command: postmap /etc/postfix/relay_auth ... diff --git a/roles/postfix/tasks/main.yml b/roles/postfix/tasks/main.yml index 9436106..f44aa11 100644 --- a/roles/postfix/tasks/main.yml +++ b/roles/postfix/tasks/main.yml @@ -20,7 +20,15 @@ - name: Deploy Relay authentication map template: src=relay_auth.j2 dest=/etc/postfix/relay_auth mode=600 owner=root group=root - notify: rehash relay_auth + register: relay_auth_file + +- name: Check if relay_auth has been hashed + stat: path=/etc/postfix/relay_auth.db + register: relay_auth_hashed + +- name: Rehash postfix relay auth + command: postmap /etc/postfix/relay_auth + when: relay_auth_file.changed or not relay_auth_hashed.stat.exists - name: Handle postfix port iptables_raw: