# Listing current facts from node

**URL:** <https://forum.ansible.com/t/listing-current-facts-from-node/15054>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [April 19, 2014, 10:50pm UTC](https://forum.ansible.com/t/listing-current-facts-from-node/15054 "2014-04-19T22:50:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [April 19, 2014, 10:50pm UTC](https://forum.ansible.com/t/listing-current-facts-from-node/15054/1 "2014-04-19T22:50:30Z")

</div>

How do I list all the fact variables for a given node?

Upgrade to the latest code from git today a previously working playbook stopped working.

This code is skipping Ubuntu machines

when: ansible\_os\_family == “Ubuntu”

At first I thought it was an issue against two new 14.04 machines I added, but it is failing the same against 12.04 machines.

This was working before… so I am trying to see what the playbook is seeing when it runs to adjust the playbook.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [April 20, 2014, 12:57am UTC](https://forum.ansible.com/t/listing-current-facts-from-node/15054/2 "2014-04-20T00:57:50Z")

</div>

this will show all vars for a host, includes facts and inventory group and host vars.

debug: var=hostvars[inventory\_hostname]​

---

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [April 20, 2014, 2:55am UTC](https://forum.ansible.com/t/listing-current-facts-from-node/15054/3 "2014-04-20T02:55:18Z")

</div>

Not finding the right syntax… this is what I am trying:

tasks:

- name: Create user in Ubuntu systems  
user: home=/home/{{item.uname}} name={{item.uname}} shell=/bin/bash state=present password={{item.passwd}} groups=sudo,adm  
when: ansible\_os\_family == “Ubuntu”  
with\_items: Ops
- debug: var=hostvars[inventory\_hostname]

Not sure if inventory\_hostname was meant to be a literal… or to replaced it with an actual hostname… tried both… Neither worked. Do I put that in a playbook?

---

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [April 20, 2014, 2:58am UTC](https://forum.ansible.com/t/listing-current-facts-from-node/15054/4 "2014-04-20T02:58:24Z")

</div>

> > - debug: var=hostvars[inventory\_hostname]  
> > …  
> > Not sure if inventory\_hostname was meant to be a literal… or to replaced it with an actual hostname… tried both… Neither worked. Do I put that in a playbook?

Nervemind… had  
debug: var=hostvars[[inventory\_hostname]

Notice the double bracked… .once I removed second bracked… got values.

“ansible\_os\_family”: “Debian”

I guess that changed…

I guess will go with this:  
“ansible\_distribution”: “Ubuntu”
