# with\_items introduces a '#' when using escaped braces

**URL:** <https://forum.ansible.com/t/with-items-introduces-a-when-using-escaped-braces/17839>\
**Category:** Ansible Project\
**Created:** [March 25, 2015, 5:14pm UTC](https://forum.ansible.com/t/with-items-introduces-a-when-using-escaped-braces/17839 "2015-03-25T17:14:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Carter](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@Andrew\_Carter](https://forum.ansible.com/u/Andrew_Carter)\
**Post date:** [March 25, 2015, 5:14pm UTC](https://forum.ansible.com/t/with-items-introduces-a-when-using-escaped-braces/17839/1 "2015-03-25T17:14:05Z")

</div>

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:

```auto
- 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:

```auto
- 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?
