]> arthur.barton.de Git - AnsibleRoles.git/commitdiff
postfix: Let debconf regenerate main.cf on changes
authorAlexander Barton <alex@barton.de>
Thu, 17 Aug 2017 15:09:54 +0000 (17:09 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 17 Aug 2017 15:09:54 +0000 (17:09 +0200)
And reload configuration afterwards.

roles/postfix/handlers/main.yml
roles/postfix/tasks/main.yml

index 2ba9b82d4c69c9238bf0300ca554882b7de8bd2e..2736cd7230f130ae5943024a2b0cf1fe15b829d3 100644 (file)
@@ -1,6 +1,11 @@
 ---
 # postfix handlers
 
+- name: update "postfix" configuration
+  command: dpkg-reconfigure -fnoninteractive postfix
+  notify:
+    - restart "postfix"
+
 - name: restart "postfix"
   service: >
     name=postfix
index 6acc7862ce315f89e17d9b06294b519d23092e05..965a5107b67967e53b4a8aea53427e7b5bf9779a 100644 (file)
@@ -11,6 +11,8 @@
     question=postfix/main_mailer_type
     value="Satellite system"
     vtype=select
+  notify:
+    - update "postfix" configuration
 
 - name: 'debconf(1): set system mail name'
   tags:
@@ -22,6 +24,8 @@
     question=postfix/mailname
     value="{{ postfix_mailname }}"
     vtype=string
+  notify:
+    - update "postfix" configuration
 
 - name: 'debconf(1): set SMTP relay host'
   tags:
@@ -33,6 +37,8 @@
     question=postfix/relayhost
     value="{{ smtp_relay_host }}"
     vtype=string
+  notify:
+    - update "postfix" configuration
 
 - name: 'debconf(1): set root and postmaster recipient'
   tags:
@@ -44,6 +50,8 @@
     question=postfix/root_address
     value="{{ postfix_root_address }}"
     vtype=string
+  notify:
+    - update "postfix" configuration
 
 - name: 'debconf(1): set other destinations to accept mail for'
   tags:
@@ -55,6 +63,8 @@
     question=postfix/destinations
     value="{{ postfix_destinations }}"
     vtype=string
+  notify:
+    - update "postfix" configuration
 
 - name: 'debconf(1): set local networks'
   tags:
@@ -66,6 +76,8 @@
     question=postfix/mynetworks
     value="{{ postfix_local_networks }}"
     vtype=string
+  notify:
+    - update "postfix" configuration
 
 - name: 'debconf(1): set mailbox size limit'
   tags:
@@ -77,6 +89,8 @@
     question=postfix/mailbox_limit
     value="{{ postfix_mailbox_limit }}"
     vtype=string
+  notify:
+    - update "postfix" configuration
 
 - name: 'debconf(1): set local address extension character'
   tags:
     question=postfix/recipient_delim
     value="{{ postfix_recipient_delim }}"
     vtype=string
+  notify:
+    - update "postfix" configuration
 
 - name: 'debconf(1): set internet protocols to use'
   tags:
     question=postfix/protocols
     value="{{ postfix_protocols }}"
     vtype=string
+  notify:
+    - update "postfix" configuration
 
 - name: 'debconf(1): configure synchronous updates on mail queue'
   tags:
     question=postfix/chattr
     value="{{ postfix_sync_updates }}"
     vtype=boolean
+  notify:
+    - update "postfix" configuration
 
 - name: install "postfix" package
   tags: