Using Ansible 1.7.2 on Centos 6.6 (installed from EPEL), I’m trying to execute a command which contains escaped brackets. I get different results when I move the command into an items list. Here it is boiled down to a trivial example:
This works:
- shell: echo special {{ '{{' }} string {{ '}}' }} test
Verbose output shows Ansible executes this:
ESTABLISH CONNECTION FOR USER: root
REMOTE_MODULE command echo special {{ string }} test #USE_SHELL
However, this doesn’t:
- shell: echo {{ item }}
with_items:
- special {{ '{{' }} string {{ '}}' }} test
When this same string is executed from a list of items, the resulting command has ‘#’ characters in place of one bracket in each occurance:
ESTABLISH CONNECTION FOR USER: root
REMOTE_MODULE command echo special {# string #} test #USE_SHELL
Anyone have a workaround?