]> arthur.barton.de Git - AnsibleRoles.git/commitdiff
postfix: Make sure that Debconf and main.cf are in sync
authorAlexander Barton <alex@barton.de>
Thu, 18 Jan 2018 17:07:08 +0000 (18:07 +0100)
committerAlexander Barton <alex@barton.de>
Thu, 18 Jan 2018 17:07:08 +0000 (18:07 +0100)
roles/postfix/tasks/main.yml

index 87e5155d1c8e3dc169f038a46a88bba7d5769167..de015fe50e7cb8f6421bff9da19d6dfd86580764 100644 (file)
@@ -1,6 +1,43 @@
 ---
 # postfix tasks
 
+# Make sure settings in /etc/postfix/main.cf are the same than for debconf!
+
+- name: set other destinations to accept mail for (main.cf)
+  tags:
+    - mail
+    - postfix
+  lineinfile: >
+    dest=/etc/postfix/main.cf
+    line="mydestination = {{ postfix_destinations }}"
+    regexp="^mydestination"
+  notify:
+    - restart "postfix"
+
+- name: set local networks (main.cf)
+  tags:
+    - mail
+    - postfix
+  lineinfile: >
+    dest=/etc/postfix/main.cf
+    line="mynetworks = {{ postfix_local_networks }}"
+    regexp="^mynetworks"
+  notify:
+    - restart "postfix"
+
+- name: set internet protocols to use (main.cf)
+  tags:
+    - mail
+    - postfix
+  lineinfile: >
+    dest=/etc/postfix/main.cf
+    line="inet_protocols = {{ postfix_protocols }}"
+    regexp="^inet_protocols"
+  notify:
+    - restart "postfix"
+
+# Debconf
+
 - name: 'debconf(1): configure Postfix as "Satellite system"'
   tags:
     - debconf