Skip to content

Instantly share code, notes, and snippets.

@halberom
Created April 19, 2014 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halberom/11090979 to your computer and use it in GitHub Desktop.
Save halberom/11090979 to your computer and use it in GitHub Desktop.
change the 'changed' result of a task
---
- 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