]> arthur.barton.de Git - AnsibleRoles.git/commitdiff
postfix: Correct order of tasks, modify files after installing packages
authorAlexander Barton <alex@barton.de>
Fri, 26 Jan 2018 15:50:06 +0000 (16:50 +0100)
committerAlexander Barton <alex@barton.de>
Fri, 26 Jan 2018 15:50:06 +0000 (16:50 +0100)
This is required because otherwise the files aren't there at all ...

roles/postfix/tasks/main.yml

index de015fe50e7cb8f6421bff9da19d6dfd86580764..e65327fc28d0d5f6347b407a0d76bfcf3d0f12ec 100644 (file)
@@ -1,41 +1,6 @@
 ---
 # 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"'
   notify:
     - update "postfix" configuration
 
+# Install Debian package ...
+
 - name: install "postfix" package
   tags:
     - mail
     state=installed
     name=postfix
 
+# Update configuration files
+
 - name: setup "/etc/mailname"
   tags:
     - mail
   notify:
     - restart "postfix"
 
+# 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"
+
 - name: set Posfix "myorigin"
   tags:
     - mail
   notify:
     - restart "postfix"
 
+# Coinfigure service
+
 - name: ensure service "postfix" is enabled and started
   tags:
     - mail