summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2016-04-09 19:37:13 +0200
committerKevin Fenzi <kevin@scrye.com>2016-04-09 20:28:14 +0000
commit833269b1515b296480de3f58705430733d87e7bf (patch)
treed938c25c07d643a8cd2032360898f3262688d9e5
parent6eb40522d7bba1084f5d013397ead8df7476b6e1 (diff)
downloadansible-833269b1515b296480de3f58705430733d87e7bf.tar.gz
ansible-833269b1515b296480de3f58705430733d87e7bf.tar.xz
ansible-833269b1515b296480de3f58705430733d87e7bf.zip
Split postfix in a separate file for clarity
-rw-r--r--roles/base/tasks/main.yml51
-rw-r--r--roles/base/tasks/postfix.yml51
2 files changed, 53 insertions, 49 deletions
diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml
index 8139bb042..5ddb308c4 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 000000000..f65ba44df
--- /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
+
+