# Evaluating variables in tasks

**URL:** <https://forum.ansible.com/t/evaluating-variables-in-tasks/17058>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [December 15, 2014, 11:54am UTC](https://forum.ansible.com/t/evaluating-variables-in-tasks/17058 "2014-12-15T11:54:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [December 15, 2014, 11:54am UTC](https://forum.ansible.com/t/evaluating-variables-in-tasks/17058/1 "2014-12-15T11:54:09Z")

</div>

Hi, I’m a little confused by the above, in particular this part:

stderr: kinit: Keytab contains no suitable keys for krb\_gdc\_co\_test01@MSGREEN.DOM while getting initial credentials

This looks like krb\_gdc\_co\_test01@MSGREEN.DOM is being substituted where you have {{ krb\_hostname }} correctly.

Can you elaborate on where the problem is in your view?

Thanks!

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [December 15, 2014, 3:41pm UTC](https://forum.ansible.com/t/evaluating-variables-in-tasks/17058/2 "2014-12-15T15:41:26Z")

</div>

Sorry for being dense, but these two values look the same to me:

krb\_gdc\_co\_test01  
krb\_gdc\_co\_test01

What part of that is the incorrect part?

Thanks!

---

<div class="post-metadata">

**Author:** ![Tomasz\_Kontusz](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@Tomasz\_Kontusz](https://forum.ansible.com/u/Tomasz_Kontusz)\
**Post date:** [December 15, 2014, 6:32pm UTC](https://forum.ansible.com/t/evaluating-variables-in-tasks/17058/3 "2014-12-15T18:32:15Z")

</div>

Try {{ hostvars[inventory\_hostname][variable\_with\_variable\_name] }}

Eric Van Steenbergen [vs.eric@gmail.com](mailto:vs.eric@gmail.com) napisał:
