Skip to content

Instantly share code, notes, and snippets.

@jcassee
Created January 2, 2014 11:29
Show Gist options
  • Save jcassee/8217906 to your computer and use it in GitHub Desktop.
Save jcassee/8217906 to your computer and use it in GitHub Desktop.
Because the variable `y` is converted to a string, the last debug message is always printed.
---
- debug: var=x
- debug: var=y
register: z
- debug: msg="This task should only be run if x is true"
when: y or z|changed
y: "{{ x | default(False) | bool }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment