When running the test molecule is not picking up my collection, eventually resulting in a playbook error like:
fatal: [localhost]: FAILED! => {
"reason": "couldn't resolve module/action 'helm_repository'. This often indicates a misspelling, missing collection, or incorrect module path.\n\nThe error appears to be in '/Users/kameshs/git/kameshsampath/kameshsampath.kind/tasks/ingress.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Add stable chart Repo\n ^ here\n"
}
Could you please provide ansible-galaxy collection list output? helm_repository is added in Kubernetes collection 0.11.0. If your version Kubernetes collection is less than this then you need to update.
and during dependency step of the scenario I see the output like
...
Reading requirement file at '/Users/kameshs/git/kameshsampath/kameshsampath.kind/molecule/common/requirements.yml'
Process install dependency map
Opened /Users/kameshs/.ansible/galaxy_token
Processing requirement collection 'community.kubernetes'
Collection 'community.kubernetes' obtained from server default https://galaxy.ansible.com/api/
Starting collection install process
Installing 'community.kubernetes:0.11.1' to '/Users/kameshs/.cache/molecule/kameshsampath.kind/deploy_ingress/collections/ansible_collections/community/kubernetes'
Downloading https://galaxy.ansible.com/download/community-kubernetes-0.11.1.tar.gz to /Users/kameshs/.ansible/tmp/ansible-local-7917k7r02p09/tmph3nh7p5h
/
....
I tried using the fully qualified name like community.kubernetes.helm_repository, then it does pick it up. I don’t understand why that way inspite of me adding collections: ["community.kubernetes"] as part of the playbook