# passing data to roles via parameters without accidentally flattening it

**URL:** <https://forum.ansible.com/t/passing-data-to-roles-via-parameters-without-accidentally-flattening-it/13423>\
**Category:** Ansible Project\
**Created:** [September 5, 2013, 10:57pm UTC](https://forum.ansible.com/t/passing-data-to-roles-via-parameters-without-accidentally-flattening-it/13423 "2013-09-05T22:57:49Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![John\_Jarvis](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@John\_Jarvis](https://forum.ansible.com/u/John_Jarvis)\
**Post date:** [September 23, 2013, 3:36pm UTC](https://forum.ansible.com/t/passing-data-to-roles-via-parameters-without-accidentally-flattening-it/13423/21 "2013-09-23T15:36:51Z")

</div>

Here is a case where we need to use the old style variable naming to reference variables within data-structures.

[https://gist.github.com/jarv/35726a20c6c8d0353be9](https://gist.github.com/jarv/35726a20c6c8d0353be9)

Not sure if there is a way to get the desired output using Jinja syntax in my case.  
I’m fine using the old style variable syntax for now unless this behavior is likely to change in future releases.

-John

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [September 25, 2013, 12:26am UTC](https://forum.ansible.com/t/passing-data-to-roles-via-parameters-without-accidentally-flattening-it/13423/22 "2013-09-25T00:26:54Z")

</div>

Yep, we know about the reference thing and are going to find a good syntactical answer for it.

One is probably radically simplifying the Jinja2 code (there are some hacks in there that shouldn’t be) so “{{” operations can keep their types unless it’s very obvious it’s the “end result” time where they need to be a string.

[Previous page](https://forum.ansible.com/t/passing-data-to-roles-via-parameters-without-accidentally-flattening-it/13423.md?page=1)
