# Vaulted variables missing, password accepted

**URL:** <https://forum.ansible.com/t/vaulted-variables-missing-password-accepted/26100>\
**Category:** Ansible Project\
**Created:** [November 22, 2017, 12:33am UTC](https://forum.ansible.com/t/vaulted-variables-missing-password-accepted/26100 "2017-11-22T00:33:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Fisher](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@Ryan\_Fisher](https://forum.ansible.com/u/Ryan_Fisher)\
**Post date:** [November 22, 2017, 12:33am UTC](https://forum.ansible.com/t/vaulted-variables-missing-password-accepted/26100/1 "2017-11-22T00:33:53Z")

</div>

I’m having an odd issue with vaulted variable files when running playbooks from my local machine. The vaulted vars are not defined, even though I am supplying the correct password at the prompt. I’ve also tried using --vault-password-file and the outcome doesn’t change.

I’m not sure how to troubleshoot this. The vaulted vars are working fine when I run the playbook from a remote Jenkins box, they only fail locally. Could there be something in my local ansible.cfg, or a setting in another area that ansible is looking at that would override the supplied vault password?

Here is an example playbook:

> * * *
> 
> - hosts: all
> 
> gather\_facts: False
> 
> become: False
> 
> tasks:
> 
> - name: Test unvaulted var
> 
> debug:
> 
> var: msr\_office\_ip
> 
> - name: Test vaulted var
> 
> debug:
> 
> var: vaulted\_var

And some output showing the problem:

> $ ansible-playbook --vault-id @prompt -i environments/test run\_ping\_test.yml  
> Vault password (default):
> 
> PLAY [all] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> TASK [Test unvaulted var] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> ok: [127.0.0.1] =\> {  
> “unvaulted\_var”: “this text is not vaulted”  
> }
> 
> TASK [Test vaulted var] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> ok: [127.0.0.1] =\> {  
> “vaulted\_var”: “VARIABLE IS NOT DEFINED!”  
> }
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> 127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0

And the contents of test.vault:

> $ ansible-vault view environments/test/group\_vars/all/test.vault
> 
> ## Vault password:
> 
> vaulted\_var: this text is vaulted

Anyone have any idea what I am doing wrong? TIA
