Code Monkey home page Code Monkey logo

Comments (6)

dhoeric avatar dhoeric commented on June 20, 2024 2

Thanks for comment @codestation @Dutchy- , just realized this feature and would be nice to be included in the extension :)

I will try to understand a bit and make it happen 👍

from vscode-ansible-vault.

dhoeric avatar dhoeric commented on June 20, 2024

In my understanding ansible reads the config file in following order, from ansible doc:

* ANSIBLE_CONFIG (an environment variable)
* ansible.cfg (in the current directory)
* .ansible.cfg (in the home directory)
* /etc/ansible/ansible.cfg

And right now the extension should check the ansible.cfg in the project directory (in step 2). I would opt to follow the convention from ansible.

from vscode-ansible-vault.

codestation avatar codestation commented on June 20, 2024

Yes, you are right, it should only read from those 3 locations. A proper fix is to remove the usage of vscode.workspace.rootPath (already deprecated) and migrate to multi-root workspace API.

For now i am using a workaround of editing my workspace file and putting the project that i am currently working on as the first entry.

Note: Vaulty can find the correct ansible.cfg, but i stick to your extension since Vaulty doens't encrypt back and shows a read-only yml.

from vscode-ansible-vault.

Dutchy- avatar Dutchy- commented on June 20, 2024

I also encountered this. I personally would love to have Vaulty's approach of finding the working directory by checking all parent paths.

https://github.com/codeflows/vaulty/blob/master/src/vault.ts#L8

I leave it up to you if you can integrate this with the default ansible configuration order.

from vscode-ansible-vault.

dhoeric avatar dhoeric commented on June 20, 2024

@codestation @Dutchy- Although I have added the support of multi-root workspace, is there any use cases of reading ansible.cfg from all parent paths?

Because of opening the workspace in sub-directory of Ansible playbooks or any?

TBH I am no longer using ansible-vault in my working place, your comments would be valuable :)

from vscode-ansible-vault.

Dutchy- avatar Dutchy- commented on June 20, 2024

My preferred setup is $workspace/ansibleprojects/project1/ansible.cfg, so one extra level.
It would be great if you can add support for that but I can work around it by opening the folders in the workspace directly.

from vscode-ansible-vault.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.