# ERROR: A vault password must be specified to decrypt data

**URL:** <https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018>\
**Category:** Ansible Project\
**Created:** [April 15, 2014, 12:05pm UTC](https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018 "2014-04-15T12:05:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [April 15, 2014, 12:05pm UTC](https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018/1 "2014-04-15T12:05:25Z")

</div>

Hi

I want to use Vault to load password as variable, so I just do:

`  
vars\_files:

- vault/passwords.yml  
`

where passwords.yml is just:

`password: XXXX`

Then:

`command: ... --password={{ password }} ...`

and here is what I get:

`  
ansible-playbook playbook.yml --ask-vault-pass

playbook: playbook.yml

ERROR: A vault password must be specified to decrypt data  
`

ansible-playbook 1.6

Any hints what am I doing wrong?

Edgars

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [April 15, 2014, 12:55pm UTC](https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018/2 "2014-04-15T12:55:47Z")

</div>

> Any hints what am I doing wrong?

Well, for one, you're confusing the heck out of me... 😉

You want to specify the password to a vault file in clear text in a  
playbook so that a task can unlock the vault? If that's the case, this  
is all wrong.

Vault is designed to \*hide\* passwords; I think what you're doing is  
security-through-confusion. 😉

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-JP

---

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [April 15, 2014, 1:01pm UTC](https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018/3 "2014-04-15T13:01:18Z")

</div>

No, no, it is not in clear text. passwords.yml is encrypted, created with ansible-vault. Here I was just showing its content

Edgars

otrdiena, 2014. gada 15. aprīlis 14:55:47 UTC+2, JP Mens rakstīja:

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [April 15, 2014, 1:26pm UTC](https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018/4 "2014-04-15T13:26:38Z")

</div>

I just did a quick visual audit of the code where vars\_files are loaded, but could see nothing that would break encrypted files.

Please file a bug with all the relevant data and I will try to troubleshoot/fix.

---

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [April 15, 2014, 1:50pm UTC](https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018/5 "2014-04-15T13:50:07Z")

</div>

Hi again

I did some troubleshooting and found that it does not work with --check, --list-hosts or --syntax-check options. When I remove these flags then it works as expected. I was actually trying with --check option before and it failed. So, I guess no need for ticket.

BR,  
Edgars

otrdiena, 2014. gada 15. aprīlis 15:26:38 UTC+2, James Tanner rakstīja:

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [April 15, 2014, 2:11pm UTC](https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018/6 "2014-04-15T14:11:28Z")

</div>

I should probably make it work with the check/list flags, so please open a bug if you don’t mind.

---

<div class="post-metadata">

**Author:** ![Michael\_Hauck](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@Michael\_Hauck](https://forum.ansible.com/u/Michael_Hauck)\
**Post date:** [June 10, 2014, 3:41pm UTC](https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018/7 "2014-06-10T15:41:23Z")

</div>

Since this affects me as well, I opened an issue:

[https://github.com/ansible/ansible/issues/7716](https://github.com/ansible/ansible/issues/7716)

Best regards,  
Michael

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 11, 2014, 10:35pm UTC](https://forum.ansible.com/t/error-a-vault-password-must-be-specified-to-decrypt-data/15018/8 "2014-06-11T22:35:19Z")

</div>

Per James’s comment, this is now resolved on the development branch!
