Split postfix in a separate file for clarity

This commit is contained in:
Michael Scherer 2016-04-09 19:37:13 +02:00 committed by Kevin Fenzi
parent 6eb40522d7
commit 833269b151
2 changed files with 53 additions and 49 deletions

View file

@ -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

View file

@ -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