use become

This commit is contained in:
Robert Kaussow 2018-07-06 23:13:11 +02:00
parent 7e19f2faca
commit 0692148543
3 changed files with 63 additions and 57 deletions

View File

@ -1,5 +1,5 @@
---
- name: Restart postfix
- name: Restart service
service:
name: postfix
state: restarted

View File

@ -1,4 +1,6 @@
---
- name: Setup postfix
block:
- name: Configure postfix
template:
src: etc/postfix/main.cf.j2
@ -55,3 +57,4 @@
when: not senderdb.stat.exists or sender_result.changed
register: senderdb_update
notify: postfix_restart
become: True

View File

@ -1,5 +1,7 @@
---
- name: Install postfix mta
block:
- name: Install required packages
package:
name: '{{ item }}'
state: latest
@ -7,3 +9,4 @@
- postfix
- cyrus-sasl-plain
- mailx
become: True