parent
f699abe9f2
commit
89a8bc0fc3
@ -1,3 +1,4 @@
|
||||
# Standards: 0.1
|
||||
---
|
||||
galaxy_info:
|
||||
author: xoxys
|
||||
@ -5,9 +6,9 @@ galaxy_info:
|
||||
license: MIT
|
||||
min_ansible_version: 2.4
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 7
|
||||
- name: EL
|
||||
versions:
|
||||
- 7
|
||||
galaxy_tags:
|
||||
- postfix
|
||||
- relay
|
||||
|
@ -1,60 +1,61 @@
|
||||
---
|
||||
- name: Setup postfix
|
||||
block:
|
||||
- name: Configure postfix
|
||||
template:
|
||||
src: etc/postfix/main.cf.j2
|
||||
dest: /etc/postfix/main.cf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: postfix_restart
|
||||
- name: Configure postfix
|
||||
template:
|
||||
src: etc/postfix/main.cf.j2
|
||||
dest: /etc/postfix/main.cf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: postfix_restart
|
||||
|
||||
- name: Create sasl
|
||||
template:
|
||||
src: etc/postfix/sasl_passwd.j2
|
||||
dest: /etc/postfix/sasl_passwd
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
register: sasl_result
|
||||
- name: Create sasl
|
||||
template:
|
||||
src: etc/postfix/sasl_passwd.j2
|
||||
dest: /etc/postfix/sasl_passwd
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
register: sasl_result
|
||||
|
||||
- name: Ensure sasl_passwd.db exist
|
||||
stat:
|
||||
path: /etc/postfix/sasl_passwd.db
|
||||
register: sasldb
|
||||
- name: Ensure sasl_passwd.db exist
|
||||
stat:
|
||||
path: /etc/postfix/sasl_passwd.db
|
||||
register: sasldb
|
||||
|
||||
- name: Create sasl_passwd.db
|
||||
command: /usr/sbin/postmap hash:/etc/postfix/sasl_passwd
|
||||
when: not sasldb.stat.exists or sasl_result.changed
|
||||
register: sasldb_update
|
||||
notify: postfix_restart
|
||||
- name: Create sasl_passwd.db
|
||||
command: /usr/sbin/postmap hash:/etc/postfix/sasl_passwd
|
||||
when: not sasldb.stat.exists or sasl_result.changed
|
||||
register: sasldb_update
|
||||
notify: postfix_restart
|
||||
|
||||
- name: Set permissions for sasl_passwd.db
|
||||
file:
|
||||
path: /etc/postfix/sasl_passwd.db
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
notify: postfix_restart
|
||||
- name: Set permissions for sasl_passwd.db
|
||||
file:
|
||||
path: /etc/postfix/sasl_passwd.db
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
notify: postfix_restart
|
||||
|
||||
- name: Override outgoing header
|
||||
template:
|
||||
src: etc/postfix/sender_canonical.j2
|
||||
dest: /etc/postfix/sender_canonical
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
register: sender_result
|
||||
- name: Override outgoing header
|
||||
template:
|
||||
src: etc/postfix/sender_canonical.j2
|
||||
dest: /etc/postfix/sender_canonical
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
register: sender_result
|
||||
|
||||
- name: Ensure sender_canonical.db exist
|
||||
stat:
|
||||
path: /etc/postfix/sender_canonical.db
|
||||
register: senderdb
|
||||
- name: Ensure sender_canonical.db exist
|
||||
stat:
|
||||
path: /etc/postfix/sender_canonical.db
|
||||
register: senderdb
|
||||
|
||||
- name: Hash sender_canoncial
|
||||
command: "/usr/sbin/postmap hash:/etc/postfix/sender_canonical"
|
||||
when: not senderdb.stat.exists or sender_result.changed
|
||||
register: senderdb_update
|
||||
notify: postfix_restart
|
||||
- name: Hash sender_canoncial
|
||||
command: "/usr/sbin/postmap hash:/etc/postfix/sender_canonical"
|
||||
when: not senderdb.stat.exists or sender_result.changed
|
||||
register: senderdb_update
|
||||
notify: postfix_restart
|
||||
become: True
|
||||
become_user: root
|
||||
|
Loading…
Reference in New Issue
Block a user