Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.7.1 doesn't detect ansible.cfg file #35

Closed
triplepoint opened this issue Sep 14, 2018 · 5 comments
Closed

0.7.1 doesn't detect ansible.cfg file #35

triplepoint opened this issue Sep 14, 2018 · 5 comments
Labels

Comments

@triplepoint
Copy link

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:

  1. Have a directory structure with an ansible.cfg file in the root, defining a vault_password_file
  2. open an ecrypted vault file and use the ctrl-alt-0 keybinding to activate this plugin
  3. Observe the red "No ansible.cfg file found" error notification

Expected behavior
The file would be decrypted, as before.

Desktop (please complete the following information):

  • OS: Macos
  • Atom version: 1.30.0 x64
@sydro
Copy link
Owner

sydro commented Sep 17, 2018

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 ?

@triplepoint
Copy link
Author

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 enabled

If 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.

@triplepoint
Copy link
Author

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.

@sydro sydro closed this as completed in 1239989 Sep 18, 2018
@sydro
Copy link
Owner

sydro commented Sep 18, 2018

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!

@sydro sydro added the bug label Sep 18, 2018
@triplepoint
Copy link
Author

Can confirm, the 0.7.3 release solved this issue. Thanks for your work @sydro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants