ansible - How to prevent 'changed' flag when 'register'-ing a variable? -


i have register task test installation of package:

tasks:   - name: test nginx     command: dpkg -s nginx-common     register: nginx_installed 

every run gets reported "change":

task: [test nginx] ******************************************************** changed: [vm1] 

i don't regard change... installed last run , still installed run. yeah, not biggy, 1 of untidy ocd type issues.

so doing wrong? there way use register without being regarded change?

the [verbose] output untidy, way i've found correct return code.

task: [test nginx] ******************************************************** changed: [vm1] => {"changed": true, "cmd": ["dpkg", "-s", "nginx-common"], "delta": "0:00:00.010231", "end": "2014-05-30 12:16:40.604405", "rc": 0, "start": "2014-05-30 12:16:40.594174", "stderr": "", "stdout": "package: nginx-common\nstatus: install ok ... \nhomepage: http://nginx.net"}

it’s described in official documentation here.

tasks:   - name: test nginx     command: dpkg -s nginx-common     register: nginx_installed     changed_when: false 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -