move changed_when to tasks instead of block

This commit is contained in:
Robert Kaussow 2018-07-07 18:55:41 +02:00
parent 76f0635074
commit 8b23b1b3d5

View File

@ -5,19 +5,21 @@
src: /etc/mongod.conf src: /etc/mongod.conf
dest: /etc/mongod.conf.bak dest: /etc/mongod.conf.bak
remote_src: True remote_src: True
changed_when: False
- name: Deploy config file without auth - name: Deploy config file without auth
template: template:
src: etc/mongod_init.conf.j2 src: etc/mongod_init.conf.j2
dest: /etc/mongod.conf dest: /etc/mongod.conf
mode: 0644 mode: 0644
changed_when: False
- name: Restart service - name: Restart service
service: service:
name: mongod name: mongod
state: restarte state: restarte
become: True
changed_when: False changed_when: False
become: True
- name: Create admin user - name: Create admin user
mongodb_user: mongodb_user:
@ -33,6 +35,7 @@
src: /etc/mongod.conf.bak src: /etc/mongod.conf.bak
dest: /etc/mongod.conf dest: /etc/mongod.conf
remote_src: True remote_src: True
changed_when: False
- name: Restart service - name: Restart service
service: service: