# nesting dictionary vars in vars

**URL:** <https://forum.ansible.com/t/nesting-dictionary-vars-in-vars/20097>\
**Category:** Ansible Project\
**Created:** [December 30, 2015, 12:01am UTC](https://forum.ansible.com/t/nesting-dictionary-vars-in-vars/20097 "2015-12-30T00:01:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Byrne](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Colin\_Byrne](https://forum.ansible.com/u/Colin_Byrne)\
**Post date:** [December 30, 2015, 12:01am UTC](https://forum.ansible.com/t/nesting-dictionary-vars-in-vars/20097/1 "2015-12-30T00:01:39Z")

</div>

Hey so I am trying to loop through a dictionary list of servers I want to create, and want to evaluate some variables based on the iteration I am on. I am not sure if I has a syntax error or I am trying something not supported by ansible, or if it’s caused by the dictionary not being evaluated at that point yet:

`

---

<div class="post-metadata">

**Author:** ![chrismeyersfsu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chrismeyersfsu/32/1016_2.png) [@chrismeyersfsu](https://forum.ansible.com/u/chrismeyersfsu)\
**Post date:** [December 30, 2015, 3:36am UTC](https://forum.ansible.com/t/nesting-dictionary-vars-in-vars/20097/2 "2015-12-30T03:36:06Z")

</div>

Colin,

The logic and code looks good to me. Maybe there is a spelling or similar simple error. Can you post everything? Also, can you get more specific with the error (i.e. what iteration it’s failing on).

---

<div class="post-metadata">

**Author:** ![Colin\_Byrne](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Colin\_Byrne](https://forum.ansible.com/u/Colin_Byrne)\
**Post date:** [January 4, 2016, 6:00pm UTC](https://forum.ansible.com/t/nesting-dictionary-vars-in-vars/20097/3 "2016-01-04T18:00:23Z")

</div>

Hey, sorry for the poor response time. It ended up being on the ‘production’ iteration that failed, which makes sense. The code works when I add values for production, so its all good. Thanks for checking it over though. Gave me confidence in debugging it. -C
