ansible/ansible — pull request #1087 by dagwieers (2012-09-25 00:44:37+00:00)
Title: Make only_if expressions easier to make

This patch makes it no longer a requirement to quote variables in order to force it to be a string. However the current implementation forces variables in becoming strings for the expression. There might be a better (more expensive) way to do this only for variables that are strings.

Now instead of:

only_if: "'${color}' == 'blue'"
only_if: "is_unset('${ipaddress}')"
only_if: "is_set('${ipaddress}')"
only_if: "'${motd_cmdline.stdout}'.find('rd') != -1"

one can write:

only_if: "$color == 'blue'"
only_if: 'is_unset($ipaddress)'
only_if: 'is_set($ipaddress)'
only_if: '${motd_cmdline.stdout}.find("rd") != -1'

This builds on top of previous commit implementing only_if for prompts.