# ansible-vault doesn't prompt to create vault password

**URL:** <https://forum.ansible.com/t/ansible-vault-doesnt-prompt-to-create-vault-password/25214>\
**Category:** Ansible Project\
**Created:** [August 9, 2017, 10:29pm UTC](https://forum.ansible.com/t/ansible-vault-doesnt-prompt-to-create-vault-password/25214 "2017-08-09T22:29:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamullen13316](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mamullen13316/32/1774_2.png) [@mamullen13316](https://forum.ansible.com/u/mamullen13316)\
**Post date:** [August 9, 2017, 10:29pm UTC](https://forum.ansible.com/t/ansible-vault-doesnt-prompt-to-create-vault-password/25214/1 "2017-08-09T22:29:55Z")

</div>

I’m running 2.4.0 and trying to encrypt a file with ansible-vault. In past versions of Ansible, this command would prompt to create a vault password to encrypt the file:

C02NVAEGG3QJ:playbooks mullenma$ ansible-vault encrypt test.yml  
Usage: ansible-vault encrypt [options] file\_name

encryption/decryption utility for Ansible data files

Options:  
–ask-vault-pass ask for vault password  
-h, --help show this help message and exit  
–new-vault-id=NEW\_VAULT\_ID  
the new vault identity to use for rekey  
–new-vault-password-file=NEW\_VAULT\_PASSWORD\_FILES  
new vault password file for rekey  
–output=OUTPUT\_FILE output file name for encrypt or decrypt; use - for  
stdout  
–vault-id=VAULT\_IDS the vault identity to use  
–vault-password-file=VAULT\_PASSWORD\_FILES  
vault password file  
-v, --verbose verbose mode (-vvv for more, -vvvv to enable  
connection debugging)  
–version show program’s version number and exit

See ‘ansible-vault --help’ for more information on a specific  
command.  
ERROR! A vault password is required to use Ansible’s Vault

I also tried to utilize the create keyword, with similar results:

C02NVAEGG3QJ:playbooks mullenma$ ansible-vault create test.yml  
Usage: ansible-vault create [options] file\_name

encryption/decryption utility for Ansible data files

Options:  
–ask-vault-pass ask for vault password  
-h, --help show this help message and exit  
–new-vault-id=NEW\_VAULT\_ID  
the new vault identity to use for rekey  
–new-vault-password-file=NEW\_VAULT\_PASSWORD\_FILES  
new vault password file for rekey  
–output=OUTPUT\_FILE output file name for encrypt or decrypt; use - for  
stdout  
–vault-id=VAULT\_IDS the vault identity to use  
–vault-password-file=VAULT\_PASSWORD\_FILES  
vault password file  
-v, --verbose verbose mode (-vvv for more, -vvvv to enable  
connection debugging)  
–version show program’s version number and exit

See ‘ansible-vault --help’ for more information on a specific  
command.  
ERROR! A vault password is required to use Ansible’s Vault

Is there something I am missing, or is this not working correctly?

Thanks,  
Matt

---

<div class="post-metadata">

**Author:** ![alikins](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@alikins](https://forum.ansible.com/u/alikins)\
**Post date:** [August 14, 2017, 5:11pm UTC](https://forum.ansible.com/t/ansible-vault-doesnt-prompt-to-create-vault-password/25214/2 "2017-08-14T17:11:57Z")

</div>

hmm, thats a bug. I’ll take a look at it, but filing at issue at github wouldn’t hurt.

---

<div class="post-metadata">

**Author:** ![alikins](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@alikins](https://forum.ansible.com/u/alikins)\
**Post date:** [August 14, 2017, 5:14pm UTC](https://forum.ansible.com/t/ansible-vault-doesnt-prompt-to-create-vault-password/25214/3 "2017-08-14T17:14:01Z")

</div>

And for now, in 2.4:

ansible-vault --ask-vault-pass create foo.yml

or

ansible-vault --vault-id=prompt create foo.yml

---

<div class="post-metadata">

**Author:** ![mamullen13316](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mamullen13316/32/1774_2.png) [@mamullen13316](https://forum.ansible.com/u/mamullen13316)\
**Post date:** [August 14, 2017, 6:18pm UTC](https://forum.ansible.com/t/ansible-vault-doesnt-prompt-to-create-vault-password/25214/4 "2017-08-14T18:18:59Z")

</div>

That works, thanks!

For anyone else hitting this, it was an already open issue: [https://github.com/ansible/ansible/issues/27885](https://github.com/ansible/ansible/issues/27885)

---

<div class="post-metadata">

**Author:** ![alikins](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@alikins](https://forum.ansible.com/u/alikins)\
**Post date:** [August 16, 2017, 6:53pm UTC](https://forum.ansible.com/t/ansible-vault-doesnt-prompt-to-create-vault-password/25214/5 "2017-08-16T18:53:25Z")

</div>

And fixed in devel/ in [https://github.com/ansible/ansible/pull/28185](https://github.com/ansible/ansible/pull/28185)
