[WARNING]: Error in vault password file loading (default)

67 views
Skip to first unread message

Vino B

unread,
Mar 18, 2018, 6:30:47 AM3/18/18
to Ansible Project
Hi All,

   Request you help, after upgrade ansible to 2.6 the password vault is not working as expected, and getting the below error, before the upgrade it was working fine without any issues.

ansible-playbook /home/ansible/playbooks/oscheck.yml --syntax-check

 [WARNING]: Error in vault password file loading (default): A vault password must be specified to decrypt data

ERROR! A vault password must be specified to decrypt data

ansible --version
ansible 2.6.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/ansible/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.13 (default, Jan 11 2017, 10:56:06) [GCC]

oscheck.yml
---
- hosts: target
  become: true
  become_method: sudo
  gather_facts: no
  vars_files:
  - "/home/ansible/playbooks/target.yml"

/etc/ansible/ansible.cfg
# If set, configures the path to the Vault password file as an alternative to
# specifying --vault-password-file on the command line.
vault_password_file = /home/ansible/playbooks/target.pass

From,
Vino.B

Vino B

unread,
Mar 18, 2018, 7:08:49 AM3/18/18
to Ansible Project
Hi All,

 Tried to re-create the Vault password, even then no luck, below are the step performed

vi target.yml
ansible_user: ansible
ansible_ssh_pass: <password>
ansible_become_pass: <password>
touch target.pass
ansible-vault encrypt target.pass
Enter the Vault password : <password>
Confirm New Vault password : <password>
ansible-vault encrypt target.yml --vault-password-file=target.pass

At this point : Error : 
 [WARNING]: Error in vault password file loading (default): A vault password must be specified to decrypt data

ERROR! A vault password must be specified to decrypt data

Even tried the below command, but still no luck.

ansible-vault encrypt /home/ansible/playbooks/target.yml --vault-password-file=/home/ansible/playbooks/target.pass

From,
Vino.B

Vino B

unread,
Mar 19, 2018, 1:30:42 AM3/19/18
to Ansible Project
Hi All,  Any help on this is much appriciated

From,
Vino.B

On Sunday, March 18, 2018 at 6:30:47 PM UTC+8, Vino B wrote:
Reply all
Reply to author
Forward
0 new messages