# Can't pass seem to pass list of variables to ansible via variables file

**URL:** <https://forum.ansible.com/t/cant-pass-seem-to-pass-list-of-variables-to-ansible-via-variables-file/21191>\
**Category:** Ansible Project\
**Created:** [April 18, 2016, 12:22pm UTC](https://forum.ansible.com/t/cant-pass-seem-to-pass-list-of-variables-to-ansible-via-variables-file/21191 "2016-04-18T12:22:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_DJOMEDA](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Joseph\_DJOMEDA](https://forum.ansible.com/u/Joseph_DJOMEDA)\
**Post date:** [April 18, 2016, 12:22pm UTC](https://forum.ansible.com/t/cant-pass-seem-to-pass-list-of-variables-to-ansible-via-variables-file/21191/1 "2016-04-18T12:22:36Z")

</div>

Hello Gurus,

I have been banging my head against the wall about this issue. With the variable below:

serviceinstaller\_deployment\_details:

- {  
“service\_name”: “cardmanagement”,  
“artifact\_location”: “{{ javamicroapp\_deployment\_details[0].folder\_path }}”,  
“service\_artifact\_commands”: [  
“-Dproperties.path={{ appcardman\_deployment\_details[1].dest }}”,  
“-Dlocale.path={{ appcardman\_deployment\_details[0].dest }}”,  
“-Dlogging.config={{ appcardman\_deployment\_details[1].dest }}/logback.xml”,  
“{{ javamicroapp\_deployment\_details[0].artifact\_name }}”  
]  
}

I am trying to iterate over the service\_artifact\_command using a join(" ") to produce one line of commands and it keeps complaining about an undefined error. With or without a single quotes around the square brackets. Kindly find the full snippet at [pastbin.com](http://pastebin.com/YQEBUdiW) .

I have switched from this to map, using with\_dict iterating over item.value. Map looks like shown below:

serviceinstaller\_deployment\_details:  
cardman:  
service\_name: “cardmanagement”  
artifact\_location: “{{ javamicroapp\_deployment\_details[0].folder\_path }}”  
service\_artifact\_commands:

- “-Dproperties.path={{ appcardman\_deployment\_details[1].dest }}”
- “-Dlocale.path={{ appcardman\_deployment\_details[0].dest }}”
- “-Dlogging.config={{ appcardman\_deployment\_details[1].dest }}/logback.xml”
- “{{ javamicroapp\_deployment\_details[0].artifact\_name }}”

using map I get the error : fatal: [10.40.14.95]: FAILED! =\> {“failed”: true, “msg”: “with\_dict expects a dict”}

Can anyone point out what I am actually doing wrong? I can confirm that service\_name and artifact\_location values are used as expected.

Best Regards,

---

<div class="post-metadata">

**Author:** ![Joseph\_DJOMEDA](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Joseph\_DJOMEDA](https://forum.ansible.com/u/Joseph_DJOMEDA)\
**Post date:** [April 19, 2016, 8:46am UTC](https://forum.ansible.com/t/cant-pass-seem-to-pass-list-of-variables-to-ansible-via-variables-file/21191/2 "2016-04-19T08:46:33Z")

</div>

Hello Guys,

Never mind, it’s fixed.

Thanks anyway

Best Regards,
