# Ansible gather facts

**URL:** <https://forum.ansible.com/t/ansible-gather-facts/29849>\
**Category:** Ansible Project\
**Created:** [March 8, 2019, 3:50pm UTC](https://forum.ansible.com/t/ansible-gather-facts/29849 "2019-03-08T15:50:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fahad.riaz1718](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@fahad.riaz1718](https://forum.ansible.com/u/fahad.riaz1718)\
**Post date:** [March 8, 2019, 3:50pm UTC](https://forum.ansible.com/t/ansible-gather-facts/29849/1 "2019-03-08T15:50:39Z")

</div>

Hi All,  
I wrote the following playbook to gather facts about a particular datastore from vsphere.  
the playbook worked, however I had to add -vvv flag to see the facts.

2 questions  
1- is there a file that gets the output of the playbook  
2- the facts are shown in bytes, is there a way to see the facts in GB.

- name: gather facts from datacenter about datastore  
vmware\_datastore\_facts:  
hostname: DC-VCSA2  
username: “{{ vcenter\_username }}”  
password: “{{ vcenter\_password }}”  
datacenter: Datacenter  
name: datastore1  
validate\_certs: false  
delegate\_to: localhost  
register: facts

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 8, 2019, 4:25pm UTC](https://forum.ansible.com/t/ansible-gather-facts/29849/2 "2019-03-08T16:25:44Z")

</div>

> Hi All,  
> I wrote the following playbook to gather facts about a particular datastore  
> from vsphere.  
> the playbook worked, however I had to add -vvv flag to see the facts.
> 
> 2 questions  
> 1- is there a file that gets the output of the playbook

Sort of, you can set log\_path  
[https://github.com/ansible/ansible/blob/0e9a79a5893357b156de98c0cb07039b11f15b71/examples/ansible.cfg#L111](https://github.com/ansible/ansible/blob/0e9a79a5893357b156de98c0cb07039b11f15b71/examples/ansible.cfg#L111)

> 2- the facts are shown in bytes, is there a way to see the facts in GB.

No, not without changing the code.

> &nbsp;&nbsp;&nbsp;- name: gather facts from datacenter about datastore  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vmware\_datastore\_facts:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hostname: DC-VCSA2  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;username: "{{ vcenter\_username }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password: "{{ vcenter\_password }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;datacenter: Datacenter  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: datastore1  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;validate\_certs: false  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delegate\_to: localhost  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;register: facts

To see the content of fact variable just add this task

- debug: var=facts
