Please replace this text with a description of your issue. You should:
My company is running AAP 2.5. We are in the process of standing it up. Getting closer day by day. However I am trying to test some roles now.
I am using the fedora.linux-system-roles in the requirments.yml and common collections as well
Here is the error i’m getting. I have a ticket with support open. They suggested I make some changes to the role itself.
ERROR! the role 'config_adjoin' was not found in /runner/project/tests/roles:/runner/requirements_roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/runner/project/tests
The error appears to be in '/runner/project/tests/test.yml': line 6, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
roles:
- config_adjoin
^ here
The changes the support rep suggested was to create a folder called roles and move everything under there and then create a playbook.yml to call the role. I’ve also read to put a ansible.cfg in each role.
I don’t have AAP myself but it seems like people come here with questions about it frequently.
Looks like this collection here Ansible Galaxy is your collection, right? Not sure why your support rep is telling you to rearrange your roles folder. As far as I know, you need your requirements.yml in a folder named collections at the base of your code repository. This is aside from things that might be affecting it like internet access, referencing an internal proxy mirror, etc.
So I have a requirements.yml file. I had it in there. It still flipped out and gave me the same error. I feel like the roles path should be an easy fix, right?
So thi is AAP on-prem. I believe the role is installed in the correct execution environment. I am using the default. I’m not sure I configured automation hub credentials.
Is config_adjoin a role in a collection, or is it a standalone role? Is the role defined in the project itself, or was a custom EE built which contains the role?
You can debug the available roles by running a playbook like this in the execution environment:
Ansible can’t be configured mid play, and only supports 1 ansible.cfg file. Not sure where you saw this, but don’t do that.
I’m not sure why you’d need an ansible.cfg at all. You’d only need to configure the roles path if the role isn’t installed in the EE and is defined in a non-standard project path.
Here’s an example layout of roles defined in the project (instead of installed in the EE) that will be located without special configuration:
Hi thanks for your response. config_adjoin is a standalone role. It is defined in a project. I did use the template that red hat provided and improved upon that.
I’m confused at what I’m looking at. Is that the project root? I don’t see the tests/test.yml playbook. The roles/ directory containing a requirements.yml seems odd. If you’re working with RH support, then it would be better to follow up there and as support for clarification.
Correct. This is the project root. I just didn’t show all the files and whatnot for security reasons. They suggested that I do this. I’m asking here, because honestly it seemed a bit strange that with the default file layout I couldn’t make AAP 2.5 on-prem get the job done. We were also having issues with isolated job paths.
Not unless the role isn’t in any of the already configured (or default) role directories. The ansible.cfg is optional. If the playbook was in the project root (i.e. test.yml instead of tests/test.yml), then roles in the project’s root directory (and any in roles/) would be picked up automatically.
That’s not in the search path in the error message either.
ERROR! the role ‘config_adjoin’ was not found in /runner/project/tests/roles:/runner/requirements_roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/runner/project/tests
Since the playbook is in tests/, the playbook-relative roles paths are /runner/project/tests/roles and /runner/project/tests.