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
Modules in roles included via 'import_role' are not detected #644
Comments
Hello, Any update on this issue ? |
Ansible Galaxy does not support role dependencies in Ansible Collections. According to ansible/galaxy#1938 instead of using role dependencies, the 'import_role' has to be used in this case. The ansible-lint script at the moment does not correctly detect custom Ansible modules in roles imported using the 'import_role' Ansible module (ansible/ansible-lint#644) and exits with an error in such case. To reconcile this issue, all of the role dependencies from DebOps roles have been dropped and they are imported via the 'import_role' module. To avoid broken tests, the 'ansible-lint' test in the DebOps test suite has been disabled for now.
As a workaround you could set
|
I seem to be getting this when I use a module from a collection that is called from a module using its shortname if the module has the collection defined in the
|
I have the same issue. // And ansible-lint doesn't seem to load "collection_path". |
ansible/ansible-lint#644 Signed-off-by: Christian Berendt <berendt@betacloud-solutions.de>
ansible/ansible-lint#644 Signed-off-by: Christian Berendt <berendt@betacloud-solutions.de>
ansible/ansible-lint#644 Signed-off-by: Christian Berendt <berendt@betacloud-solutions.de>
Current error no longer reproduces with code from master branch, running |
ansible/ansible-lint#644 Signed-off-by: Christian Berendt <berendt@betacloud-solutions.de>
Issue Type
Ansible and Ansible Lint details
Desired Behaviour
I have a set of roles where one role (
ansible_plugins
) contains custom Ansible modules. Other roles that use these modules, include theansible_plugins
role using theimport_role
module, and role works fine, similarly to how the role with custom modules could be included viadependencies
list inmeta/main.yml
file.Actual Behaviour (Bug report only)
Currently using
import_role
instead of putting the role in dependencies results inansible-lint
not being able to detect the custom Ansible modules. This can be verified by running commands on a host withansible-lint
installed:The
debops.cron
role uses a customdpkg_divert
Ansible module which is included in thedebops.ansible_plugins
role. When the above command is executed, the result is:This setup works fine in Ansible itself.
The text was updated successfully, but these errors were encountered: