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: service:
name: postfix name: postfix
state: restarted state: restarted

View File

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

View File

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