Ansible playbook fails with "ERROR! couldn't resolve module/action" due to square brackets in collections_path of ansible.cfg file.
Issue
-
Running an Ansible playbook fails with an error indicating that a module or action cannot be resolved, even though the collection is installed:
ERROR! couldn't resolve module/action 'community.general.rhsm_repository'. This often indicates a misspelling, missing collection, or incorrect module path. -
The failure occurs consistently on the command line/workstation, despite the playbook working previously or in other environments without changes to the playbooks themselves.
Environment
- Red Hat Ansible Automation Platform (AAP) 2.x
- ansible-core
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.