# Ansible ask for vault password for a host that don't need any variable

**URL:** <https://forum.ansible.com/t/ansible-ask-for-vault-password-for-a-host-that-dont-need-any-variable/18642>\
**Category:** Ansible Project\
**Created:** [June 30, 2015, 10:29am UTC](https://forum.ansible.com/t/ansible-ask-for-vault-password-for-a-host-that-dont-need-any-variable/18642 "2015-06-30T10:29:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alessandro\_mazzoli](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@alessandro\_mazzoli](https://forum.ansible.com/u/alessandro_mazzoli)\
**Post date:** [June 30, 2015, 10:29am UTC](https://forum.ansible.com/t/ansible-ask-for-vault-password-for-a-host-that-dont-need-any-variable/18642/1 "2015-06-30T10:29:14Z")

</div>

Hi,

i’m a pretty satisfied Ansible user but

i got an issue maybe caused by a bad practice or a bad definition on my Inventory.

I have two inventories( production/ development) in /etc/ansible/invenories with several hosts defined like these:

example1 ansible\_ssh\_host=10.0.8.142  
example2 ansible\_ssh\_host=10.0.8.143

example3 ansible\_ssh\_host=10.0.8.144

[group1]  
example1  
example2  
example3

and some variables for each hosts encrypted by Ansible-vault:

(i.e) host\_vars/example1.yml , host\_vars/example2.yml **and i don’t have any vars on example3**

**`**

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [July 1, 2015, 8:45pm UTC](https://forum.ansible.com/t/ansible-ask-for-vault-password-for-a-host-that-dont-need-any-variable/18642/2 "2015-07-01T20:45:06Z")

</div>

If ansible is asked to open a vault file it will always try, if it  
does not have a password it will fail. There is no way to know if a  
variable inside the file is used unless you open it and examine it, so  
we enter the paradox of needing to open the file to find out if we  
need to open it.

If you know your play won't need those vault files, you should avoid  
referencing them directly or indirectly to avoid needing a password.
