Closed triplepoint closed 6 years ago
Hi, I can't reproduce the same behavior. With the same configuration, i have this structure
/path_project/
- ansible.cfg (with vault_password_file variable = test/pass.txt )
- test/
- pass.txt
- vaulted_file.yml
and it works fine.
The ansible.cfg file need to be in root of projects of in some subdirectories.
Can you test it with ansible-vault command without using plugin ?
My project structure has the vaulted file deeper in the file structure, like this:
.
├── ansible.cfg
├── .ansible-vault-password
├── inventories
│ ├── production
│ ├── group_vars
│ │ └── all
│ │ ├── vars.vault.yml
│ │ └── some_other_vars.yml
│ └── groups
├── playbooks
│ └── some_project_name.yml
├── roles
└── {a whole bunch of roles}
my ./ansible.cfg
file has content like so:
[defaults]
....
vault_password_file = ./.ansible-vault-password
....
[ssh_connection]
....
If I open, say, ./inventories/production/group_vars/all/vars.vault.yml
, and use the ctrl-alt-0
hot key, I get the error notification:
No ansible.cfg file found.
Disable flag in preferencies or add ansible.cfg file
If I check the plugin's configuration:
use vault password file defined in ansible.cfg project
is enabledIf I do, from the project root:
ansible-vault view ./inventories/production/group_vars/all/vars.vault.yml
I see the contents of the file, without being prompted for any paswords.
Though it's worth noting that the file position doesn't matter, if I copy a vault file to the project root next to the ansible.cfg
file, the plugin still fails with the same error.
Hi, thank you for your clarifications, they have been very helpful to find the error. I fixed it, i think that it works again now!
Can confirm, the 0.7.3 release solved this issue. Thanks for your work @sydro.
Describe the bug A directory structure with an
ansible.cfg
in the root directory defining a vault password, and vault-encrypted files in a subdirectory, errors with a "No ansible.cfg file found." notification. Prior versions on this same repository worked fine.To Reproduce Steps to reproduce the behavior:
vault_password_file
Expected behavior The file would be decrypted, as before.
Desktop (please complete the following information):