# Variable pointer

**URL:** <https://forum.ansible.com/t/variable-pointer/23957>\
**Category:** Ansible Project\
**Created:** [March 14, 2017, 12:31am UTC](https://forum.ansible.com/t/variable-pointer/23957 "2017-03-14T00:31:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinicius\_Leal](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@Vinicius\_Leal](https://forum.ansible.com/u/Vinicius_Leal)\
**Post date:** [March 14, 2017, 12:31am UTC](https://forum.ansible.com/t/variable-pointer/23957/1 "2017-03-14T00:31:20Z")

</div>

I have following situation  
vars:  
var1: test  
var2: var1  
tasks:

- debug: msg=“{{ {{ var2 }} }}”

Exist some syntax to get “test” in debug msg?

---

<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:** [March 23, 2017, 3:42am UTC](https://forum.ansible.com/t/variable-pointer/23957/2 "2017-03-23T03:42:31Z")

</div>

- debug: msg="{{ hostvars[inventory\_hostname][var2] }}"
