[PATCH] Split postfix in a separate file for clarity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michael Scherer <misc@xxxxxxxx>

---
 roles/base/tasks/main.yml    | 51 ++------------------------------------------
 roles/base/tasks/postfix.yml | 51 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 49 deletions(-)
 create mode 100644 roles/base/tasks/postfix.yml

diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml
index 8139bb0..5ddb308 100644
--- a/roles/base/tasks/main.yml
+++ b/roles/base/tasks/main.yml
@@ -297,55 +297,8 @@
   - base
    - base
 
-- name: /etc/postfix/main.cf
-  copy: src={{ item }} dest=/etc/postfix/main.cf
-  with_first_found:
-    - "{{ postfix_maincf }}"
-    - "postfix/main.cf/main.cf.{{ ansible_fqdn }}"
-    - "postfix/main.cf/main.cf.{{ host_group }}"
-    - "postfix/main.cf/main.cf.{{ postfix_group }}"
-    - "postfix/main.cf/main.cf.{{ datacenter }}"
-    - "postfix/main.cf/main.cf"
-  notify:
-  - restart postfix
-  tags:
-  - postfix
-  - config
-  - base
-
-- name: install /etc/postfix/master.cf file
-  copy: src={{ item }} dest=/etc/postfix/master.cf mode=0644
-  with_first_found:
-    - "{{ postfix_mastercf }}"
-    - "postfix/master.cf/master.cf.{{ ansible_fqdn }}"
-    - "postfix/master.cf/master.cf.{{ inventory_hostname }}"
-    - "postfix/master.cf/master.cf.{{ host_group }}"
-    - "postfix/master.cf/master.cf.{{ postfix_group }}"
-    - "postfix/master.cf/master.cf"
-  when: inventory_hostname.startswith('smtp-mm')
-  notify:
-  - restart postfix
-  tags:
-  - postfix
-  - config
-  - base
-
-- name: enable postfix to start
-  service: name=postfix state=running enabled=true
-  tags:
-  - service
-  - base
-
-- name: install /etc/postfix/transport file
-  copy: src="postfix/{{ postfix_transport_filename }}" dest=/etc/postfix/transport
-  when: inventory_hostname.startswith(('smtp-mm','bastion'))
-  notify:
-  - restart postfix
-  - rebuild postfix transport
-  tags:
-  - postfix
-  - base
-  - config
+- name: Setup postfix
+  include: postfix.yml
 
 - name: install ntp.conf
   template: src=ntp/ntp.conf.j2 dest=/etc/ntp.conf
diff --git a/roles/base/tasks/postfix.yml b/roles/base/tasks/postfix.yml
new file mode 100644
index 0000000..f65ba44
--- /dev/null
+++ b/roles/base/tasks/postfix.yml
@@ -0,0 +1,51 @@
+- name: /etc/postfix/main.cf
+  copy: src={{ item }} dest=/etc/postfix/main.cf
+  with_first_found:
+    - "{{ postfix_maincf }}"
+    - "postfix/main.cf/main.cf.{{ ansible_fqdn }}"
+    - "postfix/main.cf/main.cf.{{ host_group }}"
+    - "postfix/main.cf/main.cf.{{ postfix_group }}"
+    - "postfix/main.cf/main.cf.{{ datacenter }}"
+    - "postfix/main.cf/main.cf"
+  notify:
+  - restart postfix
+  tags:
+  - postfix
+  - config
+  - base
+
+- name: install /etc/postfix/master.cf file
+  copy: src={{ item }} dest=/etc/postfix/master.cf mode=0644
+  with_first_found:
+    - "{{ postfix_mastercf }}"
+    - "postfix/master.cf/master.cf.{{ ansible_fqdn }}"
+    - "postfix/master.cf/master.cf.{{ inventory_hostname }}"
+    - "postfix/master.cf/master.cf.{{ host_group }}"
+    - "postfix/master.cf/master.cf.{{ postfix_group }}"
+    - "postfix/master.cf/master.cf"
+  when: inventory_hostname.startswith('smtp-mm')
+  notify:
+  - restart postfix
+  tags:
+  - postfix
+  - config
+  - base
+
+- name: enable postfix to start
+  service: name=postfix state=running enabled=true
+  tags:
+  - service
+  - base
+
+- name: install /etc/postfix/transport file
+  copy: src="postfix/{{ postfix_transport_filename }}" dest=/etc/postfix/transport
+  when: inventory_hostname.startswith(('smtp-mm','bastion'))
+  notify:
+  - restart postfix
+  - rebuild postfix transport
+  tags:
+  - postfix
+  - base
+  - config
+
+
-- 
1.8.3.1
_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux