I got collection that has structure
namespace/
── collectionA/
├── docs/
├── galaxy.yml
├── README.md
└── roles/
├── roleA/
| └── tasks/
| ├──taskA.yml
| ├──taskB.yml
└── roleB/
└── tasks/
├──taskA.yml
├──taskB.yml
according to using collections if I wan to use that roles all I have to do is include_role with fqdn
- hosts: all
collections:
- my_namespace.my_collection
tasks:
- import_role:
name: role1
but it seems not working. I still get error:
ERROR! the role 'manage_users' was not found in edaas.post_provisioning:ansible.legacy:/home/jenkins/agent/workspace/Create_Infra/playbooks/roles:/home/cirunner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/jenkins/agent/workspace/Create_Infra/playbooks 12:10:53
12:10:53 The error appears to be in '/home/jenkins/agent/workspace/Create_Infra/playbooks/ansible_main_initial.yml': line 24, column 15, but may 12:10:53 be elsewhere in the file depending on the exact syntax problem. 12:10:53
12:10:53 The offending line appears to be: 12:10:53
12:10:53 - ansible.builtin.import_role: 12:10:53 name: manage_users 12:10:53 ^ here
Collection is installed correctly - checked by ansible-galaxy collection list
Any idea what can be still wrong? Role names are aligned to rules (lowercase and only characters with _ Collection is installed in /home/cirunner/.ansible/collections
ansible [core 2.11.12] config file = None configured module search path = ['/home/cirunner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible ansible collection location = /home/cirunner/.ansible/collections executable location = /usr/local/bin/ansible python version = 3.8.0 (default, Dec 9 2021, 17:53:27) [GCC 8.4.0] jinja version = 3.1.2 libyaml = True