# Problem with variables variables

**URL:** <https://forum.ansible.com/t/problem-with-variables-variables/26081>\
**Category:** Ansible Project\
**Created:** [November 20, 2017, 3:11pm UTC](https://forum.ansible.com/t/problem-with-variables-variables/26081 "2017-11-20T15:11:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrvilda](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@jrvilda](https://forum.ansible.com/u/jrvilda)\
**Post date:** [November 20, 2017, 3:11pm UTC](https://forum.ansible.com/t/problem-with-variables-variables/26081/1 "2017-11-20T15:11:15Z")

</div>

Hi,

I have a problem with variables.

this is correct:

`  
…

- debug:  
msg: “{{ vm\_list.virtual\_machines.SRV1.uuid }}”  
…  
`

but, i need:

`  
…  
register: vmname

- debug:  
msg: “{{ vm\_list.virtual\_machines.{{ vmname }}.uuid }}”

…  
`

how do i have to do it?

thx

---

<div class="post-metadata">

**Author:** ![Pshem\_Kowalczyk](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@Pshem\_Kowalczyk](https://forum.ansible.com/u/Pshem_Kowalczyk)\
**Post date:** [November 21, 2017, 7:32am UTC](https://forum.ansible.com/t/problem-with-variables-variables/26081/2 "2017-11-21T07:32:40Z")

</div>

Hi,

Try this:

{{ vm\_list.virtual\_machines[vmname].uuid }}

kind regards

Pshem

---

<div class="post-metadata">

**Author:** ![jrvilda](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@jrvilda](https://forum.ansible.com/u/jrvilda)\
**Post date:** [November 21, 2017, 8:34am UTC](https://forum.ansible.com/t/problem-with-variables-variables/26081/3 "2017-11-21T08:34:42Z")

</div>

# Sincerely thanks.
