small refactoring
This commit is contained in:
parent
b2ab14c31a
commit
9d18d6c3c3
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: restart postfix
|
- name: Restart postfix
|
||||||
service:
|
service:
|
||||||
name: postfix
|
name: postfix
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: configure postfix
|
- name: Configure postfix
|
||||||
template:
|
template:
|
||||||
src: 'etc/postfix/main.cf.j2'
|
src: 'etc/postfix/main.cf.j2'
|
||||||
dest: '/etc/postfix/main.cf'
|
dest: '/etc/postfix/main.cf'
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: postfix_restart
|
notify: postfix_restart
|
||||||
|
|
||||||
- name: create sasl
|
- name: Create sasl
|
||||||
template:
|
template:
|
||||||
src: 'etc/postfix/sasl_passwd.j2'
|
src: 'etc/postfix/sasl_passwd.j2'
|
||||||
dest: '/etc/postfix/sasl_passwd'
|
dest: '/etc/postfix/sasl_passwd'
|
||||||
|
@ -17,18 +17,18 @@
|
||||||
mode: 0600
|
mode: 0600
|
||||||
register: sasl_result
|
register: sasl_result
|
||||||
|
|
||||||
- name: ensure sasl_passwd.db exist
|
- name: Ensure sasl_passwd.db exist
|
||||||
stat:
|
stat:
|
||||||
path: '/etc/postfix/sasl_passwd.db'
|
path: '/etc/postfix/sasl_passwd.db'
|
||||||
register: sasldb
|
register: sasldb
|
||||||
|
|
||||||
- name: create sasl_passwd.db
|
- name: Create sasl_passwd.db
|
||||||
command: '/usr/sbin/postmap hash:/etc/postfix/sasl_passwd'
|
command: '/usr/sbin/postmap hash:/etc/postfix/sasl_passwd'
|
||||||
when: sasldb.stat.exists == 'false' or sasl_result.changed
|
when: sasldb.stat.exists == 'false' or sasl_result.changed
|
||||||
register: sasldb_update
|
register: sasldb_update
|
||||||
notify: postfix_restart
|
notify: postfix_restart
|
||||||
|
|
||||||
- name: set permissions for sasl_passwd.db
|
- name: Set permissions for sasl_passwd.db
|
||||||
file:
|
file:
|
||||||
path: '/etc/postfix/sasl_passwd.db'
|
path: '/etc/postfix/sasl_passwd.db'
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
mode: 0600
|
mode: 0600
|
||||||
notify: postfix_restart
|
notify: postfix_restart
|
||||||
|
|
||||||
- name: override outgoing header
|
- name: Override outgoing header
|
||||||
template:
|
template:
|
||||||
src: 'etc/postfix/sender_canonical.j2'
|
src: 'etc/postfix/sender_canonical.j2'
|
||||||
dest: '/etc/postfix/sender_canonical'
|
dest: '/etc/postfix/sender_canonical'
|
||||||
|
@ -45,13 +45,13 @@
|
||||||
mode: 0600
|
mode: 0600
|
||||||
register: sender_result
|
register: sender_result
|
||||||
|
|
||||||
- name: ensure sender_canonical.db exist
|
- name: Ensure sender_canonical.db exist
|
||||||
stat:
|
stat:
|
||||||
path: '/etc/postfix/sender_canonical.db'
|
path: '/etc/postfix/sender_canonical.db'
|
||||||
register: senderdb
|
register: senderdb
|
||||||
|
|
||||||
- name: hash sender_canoncial
|
- name: Hash sender_canoncial
|
||||||
command: '/usr/sbin/postmap hash:/etc/postfix/sender_canonical'
|
command: '/usr/sbin/postmap hash:/etc/postfix/sender_canonical'
|
||||||
when: senderdb.stat.exists == false or sender_result.changed
|
when: senderdb.stat.exists == false or sender_result.changed
|
||||||
register: senderdb_update
|
register: senderdb_update
|
||||||
notify: postfix_restart
|
notify: postfix_restart
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: install postfix mta
|
- name: Install postfix mta
|
||||||
package:
|
package:
|
||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
state: latest
|
state: latest
|
||||||
with_items:
|
with_items:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user