You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoking ansible-lint 24.9.2 on my example collection, ansible-lint shows warnings about being unable to load module and resolve FQCN for a dependent collection module:
In this example, it's community.general.pip_package_info:
INFO Set ANSIBLE_LIBRARY=/Users/dab/.cache/ansible-compat/0cb87f/modules:/Users/dab/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_ROLES_PATH=/Users/dab/.cache/ansible-compat/0cb87f/roles:roles:/Users/dab/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Provisioning collection community.general:10.0.1 from galaxy.yml
INFO Running from /Users/dab/repos/repro/ansible : ansible-galaxy collection install -vvv community.general:10.0.1
INFO Running from /Users/dab/repos/repro/ansible : ansible-galaxy collection install -vvv --force /Users/dab/repos/repro/ansible
WARNING Unable to load module community.general.pip_package_info at roles/example/tasks/main.yml:3 for options validation
WARNING Unable to resolve FQCN for module community.general.pip_package_info
The dependent collection is successfully installed to the ansible-compat cache during the initial run:
❯ ls -lah /Users/dab/.cache/ansible-compat/0cb87f/collections/ansible_collections
Permissions Size User Date Modified Name
drwxr-xr-x - dab 11 Nov 21:21 community
drwxr-xr-x - dab 11 Nov 21:21 community.general-10.0.1.info
drwxr-xr-x - dab 11 Nov 21:21 dbrennand
This only happends on the first run of ansible-lint, once the ~/.cache/ansible-compat/ is established, the warning disappears. This is not ideal when running ansible-lint in one-shot scenarios such as a CI/CD pipeline.
Issue Type
Bug Report
OS / ENVIRONMENT
ansible-lint 24.9.2 using ansible-core:2.18.0 ansible-compat:24.9.1 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.12
❯ ansible-lint -v
INFO Identified /Users/dab/repos/repro as project root due .git directory.
INFO Set ANSIBLE_LIBRARY=/Users/dab/.cache/ansible-compat/0cb87f/modules:/Users/dab/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_ROLES_PATH=/Users/dab/.cache/ansible-compat/0cb87f/roles:roles:/Users/dab/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Provisioning collection community.general:10.0.1 from galaxy.yml
INFO Running from /Users/dab/repos/repro/ansible : ansible-galaxy collection install -vvv community.general:10.0.1
INFO Running from /Users/dab/repos/repro/ansible : ansible-galaxy collection install -vvv --force /Users/dab/repos/repro/ansible
INFO Executing syntax check on playbook roles/example/tests/test.yml (0.24s)
INFO Executing syntax check on role roles/example (0.24s)
...
WARNING Unable to load module community.general.pip_package_info at roles/example/tasks/main.yml:3 for options validation
WARNING Unable to resolve FQCN for module community.general.pip_package_info
The text was updated successfully, but these errors were encountered:
#4402 is likely to fix that. Either update ansible-compat manually and test again or wait till we make the next linter release and check if this is sorted.
Hi @ssbarnea - Tested the latestansible-lint release - unfortunately, I'm still seeing this issue.
# Ensure ansible-compat cache is clear
rm -rf ~/.cache/ansible-compat/
❯ cat requirements.txt
ansible-core==2.18.0
ansible-lint==24.10.0
❯ pip install -r requirements.txt
❯ pip list | grep -E 'ansible-lint|ansible-compat'
ansible-compat 24.10.0
ansible-lint 24.10.0
❯ cd ansible
❯ ansible-lint -v
INFO Identified /Users/dab/repos/repro as project root due .git directory.
WARNING <unknown>:1: SyntaxWarning: invalid decimal literal
INFO Set ANSIBLE_LIBRARY=/Users/dab/.cache/ansible-compat/0cb87f/modules:/Users/dab/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_ROLES_PATH=/Users/dab/.cache/ansible-compat/0cb87f/roles:roles:/Users/dab/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Provisioning collection community.general:10.0.1 from galaxy.yml
INFO Running from /Users/dab/repos/repro/ansible : ansible-galaxy collection install -vvv community.general:10.0.1
INFO Running from /Users/dab/repos/repro/ansible : ansible-galaxy collection install -vvv --force /Users/dab/repos/repro/ansible
INFO Executing syntax check on playbook roles/example/tests/test.yml (0.24s)
INFO Executing syntax check on role roles/example (0.24s)
WARNING Ignored exception from CheckRequiresAnsibleVersion.matchyaml while processing meta/runtime.yml (meta-runtime): 'NoneType' object has no attribute 'get'
WARNING Unable to load module community.general.pip_package_info at roles/example/tasks/main.yml:3 for options validation
WARNING Unable to resolve FQCN for module community.general.pip_package_info
Please let me know how I can assist further with troubleshooting this.
Summary
Invoking ansible-lint
24.9.2
on my example collection, ansible-lint shows warnings about being unable to load module and resolve FQCN for a dependent collection module:In this example, it's
community.general.pip_package_info
:The dependent collection is successfully installed to the ansible-compat cache during the initial run:
This only happends on the first run of ansible-lint, once the
~/.cache/ansible-compat/
is established, the warning disappears. This is not ideal when runningansible-lint
in one-shot scenarios such as a CI/CD pipeline.Issue Type
OS / ENVIRONMENT
ansible-lint 24.9.2 using ansible-core:2.18.0 ansible-compat:24.9.1 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.12
STEPS TO REPRODUCE
Desired Behavior
No warnings are shown and the module and FQCN are resolved.
Actual Behavior
Minimal repro example:
The text was updated successfully, but these errors were encountered: