ansible/roles/base/tasks/postfix.yml

80 lines
1.9 KiB
YAML
Raw Normal View History

- name: /etc/postfix/main.cf
copy: src={{ item }} dest=/etc/postfix/main.cf
with_first_found:
- "{{ postfix_maincf }}"
- "postfix/main.cf/main.cf.{{ inventory_hostname }}"
- "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.{{ 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', 'mailman', 'noc02'))
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
2016-09-24 00:41:31 +00:00
when: inventory_hostname.startswith(('smtp-mm','bastion','noc02'))
notify:
- restart postfix
- rebuild postfix transport
tags:
- postfix
- base
- config
- name: install /etc/pki/tls/certs/{{name}}.csr
copy: >
src={{item}}
dest=/etc/pki/tls/certs/{{item | basename}}
owner=root
group=root
mode=0644
with_first_found:
- "{{private}}/files/httpd/{{cert}}.cert"
- "{{private}}/files/httpd/{{name}}.cert"
notify:
- restart postfix
tags:
- postfix
- name: Copy {{name}}.key
copy: >
src={{item}}
dest=/etc/pki/tls/private/{{item | basename}}
owner=root
group=root
mode=0600
with_first_found:
- "{{private}}/files/httpd/{{key}}.key"
- "{{private}}/files/httpd/{{name}}.key"
notify:
- restart postfix
tags:
- postfix