Created
April 19, 2014 17:19
-
-
Save halberom/11090979 to your computer and use it in GitHub Desktop.
change the 'changed' result of a task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
tasks: | |
- name: create a tmp file | |
lineinfile: dest=/tmp/head line=BODY create=yes | |
# the task will be marked 'ok', because the output contains 'BODY', not 'HEAD' | |
- name: cat head | |
command: cat /tmp/head | |
register: response | |
changed_when: "'HEAD' in response.stdout" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment