Open vicmunoz opened 5 months ago
Similar behaviour is observed with ansible-lint validation. When using ANSIBLE_VAULT_IDENTITY
and ANSIBLE_VAULT_IDENTITY_LIST
with environment variables I get syntax errors:
Unexpected error code 1 from execution of: ansible-playbook -i localhost, --syntax-check site.sample.production.yml
internal-error: Unexpected error code 1 from execution of: ansible-playbook -i localhost, --syntax-check site.sample.production.yml
site.sample.production.yml:1 [WARNING]: Error getting vault password file (credentials): The vault password
However using settings vault_identity
and vault_identity_list
into ansible.cfg
clear all above errors and all runs fine.
Issues that could be related: https://github.com/ansible/ansible-lint/discussions/2404 https://github.com/ansible/ansible-lint/issues/2443 https://github.com/ansible/ansible-lint/issues/2889
Summary
TLDR: Modules from collections are not recognized (no definition found) when COLLECTIONS_PATH is set via environment variable.
1)
ansible.cfg
does not havecollections_path
(https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths) setting in file. However env varANSIBLE_COLLECTIONS_PATH
is set❯ ansible-config dump | grep COLLECTIONS_PATHS COLLECTIONS_PATHS(env: ANSIBLE_COLLECTIONS_PATH) = ['/Users/victor/Code/Sandbox/automation/.collections']
2)
ansible.cfg
havecollections_path
setting in file. Works fine, modules are recognized.Extension version
v24.4.0
VS Code version
1.88.1
Ansible Version
OS / Environment
MACOS 14.4
Relevant log output
No response