# "ansible\_\*" variables not usable in playbook?

**URL:** <https://forum.ansible.com/t/ansible-variables-not-usable-in-playbook/13038>\
**Category:** Ansible Project\
**Created:** [June 28, 2013, 4:22pm UTC](https://forum.ansible.com/t/ansible-variables-not-usable-in-playbook/13038 "2013-06-28T16:22:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bo1](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@Bo1](https://forum.ansible.com/u/Bo1)\
**Post date:** [June 28, 2013, 4:22pm UTC](https://forum.ansible.com/t/ansible-variables-not-usable-in-playbook/13038/1 "2013-06-28T16:22:43Z")

</div>

Howdy!

I have been enjoying Ansible (v1.3, I believe, from GitHub) but something has really got me stumped.

Question 1: Am I able to reference ansible\_\* facts within a playbook if the facts have been gathered? Specifically, am I able to do something like:

> - debug: ansible\_kernel is {{ ansible\_kernel|d(‘’) }}

It always returns empty though each node actually has this value. So I figure the “debug” or “name” cannot reference such variables because they are not run on each node but rather the ansible server?

Question 2: In what ways are the host specific facts/variables usable in a playbook? As arguments to modules?

> - command: /bin/echo ansible\_kernel is {{ ansible\_kernel|d(‘’) }}

If there is a paragraph on the ansible site that explains this, please point me to the page. 🙂 I have thoroughly read all the documentation I could find (fascinating project).

Thank you for your time,  
-bo

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 28, 2013, 4:39pm UTC](https://forum.ansible.com/t/ansible-variables-not-usable-in-playbook/13038/2 "2013-06-28T16:39:36Z")

</div>

Question 1)

They are totally usable. You just need to specify the ‘msg’ argument to the debug module as you are calling it incorrectly:

debug: msg=“My fact value is {{ ansible\_kernel }}”

Question 2)

Yeah, they are usable all over the place. Take a look through [github.com/ansible/ansible-examples](http://github.com/ansible/ansible-examples) and the “language examples” in particular, and you will see lots of examples of facts being used for all sorts of things.
