# gather facts fails when inventory contains vault variable

**URL:** <https://forum.ansible.com/t/gather-facts-fails-when-inventory-contains-vault-variable/34342>\
**Category:** Ansible Project\
**Created:** [December 16, 2020, 6:30pm UTC](https://forum.ansible.com/t/gather-facts-fails-when-inventory-contains-vault-variable/34342 "2020-12-16T18:30:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Umesha\_A](https://avatars.discourse-cdn.com/v4/letter/u/59ef9b/32.png) [@Umesha\_A](https://forum.ansible.com/u/Umesha_A)\
**Post date:** [December 16, 2020, 6:30pm UTC](https://forum.ansible.com/t/gather-facts-fails-when-inventory-contains-vault-variable/34342/1 "2020-12-16T18:30:25Z")

</div>

Hi All,

With the following inventory file, gather facts gives error. The inventory file has root\_password which is defined in vault and I am passing vault-id in command line. Any ideas ? I am able to access the root\_password and root\_user within playbook, so there is no issue with vault-id parameter.

Thanks for your help,  
Umesha.

Inventory file:

---

<div class="post-metadata">

**Author:** ![Roberto\_J\_R\_Paz](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@Roberto\_J\_R\_Paz](https://forum.ansible.com/u/Roberto_J_R_Paz)\
**Post date:** [December 17, 2020, 4:11pm UTC](https://forum.ansible.com/t/gather-facts-fails-when-inventory-contains-vault-variable/34342/2 "2020-12-17T16:11:38Z")

</div>

Have you stored the variables in the vault file as ?:  
vault\_root\_user: xxxxx  
vaule\_root\_password: yyyyy

---

<div class="post-metadata">

**Author:** ![Umesha\_A](https://avatars.discourse-cdn.com/v4/letter/u/59ef9b/32.png) [@Umesha\_A](https://forum.ansible.com/u/Umesha_A)\
**Post date:** [December 17, 2020, 7:28pm UTC](https://forum.ansible.com/t/gather-facts-fails-when-inventory-contains-vault-variable/34342/3 "2020-12-17T19:28:21Z")

</div>

No. As  
root\_user and root\_password
