# Yum module using nested variables

**URL:** <https://forum.ansible.com/t/yum-module-using-nested-variables/18595>\
**Category:** Ansible Project\
**Created:** [June 24, 2015, 5:18pm UTC](https://forum.ansible.com/t/yum-module-using-nested-variables/18595 "2015-06-24T17:18:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arie\_Bregman](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@Arie\_Bregman](https://forum.ansible.com/u/Arie_Bregman)\
**Post date:** [June 24, 2015, 5:18pm UTC](https://forum.ansible.com/t/yum-module-using-nested-variables/18595/1 "2015-06-24T17:18:37Z")

</div>

Hi everyone,

I have this task:

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 26, 2015, 4:22pm UTC](https://forum.ansible.com/t/yum-module-using-nested-variables/18595/2 "2015-06-26T16:22:07Z")

</div>

that won't work as you think, its appending a commas separated string  
as an item of the other list, not merging lists, you want something  
like this:

common\_rpm\_deps: "{{[ gcc, git, python-devel, python-tox,  
python-testrepository, python-mock, python-pip python-testscenarios,  
python-oslo]|union(hostvars[inventory\_hostname][tester.name]['rpm\_deps'])}}"

you might need to quote the package names
