# AAP 2.5 role not found

**URL:** <https://forum.ansible.com/t/aap-2-5-role-not-found/43084>\
**Category:** Get Help\
**Tags:** rhel9, fedora, aap\
**Created:** [May 30, 2025, 4:37pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084 "2025-05-30T16:37:12Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [May 30, 2025, 4:37pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/1 "2025-05-30T16:37:12Z")

</div>

**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.

```auto
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.

Any thoughts?

---

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [May 30, 2025, 8:56pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/2 "2025-05-30T20:56:18Z")

</div>

> [@Fracture7144](#):
>
> fedora.linux-system-roles

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](https://galaxy.ansible.com/ui/repo/published/fedora/linux_system_roles) 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.

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [May 31, 2025, 12:06am UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/3 "2025-05-31T00:06:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dbrennand](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dbrennand/32/7830_2.png) [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Post date:** [May 31, 2025, 10:20am UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/4 "2025-05-31T10:20:11Z")

</div>

Hi @Fracture7144

You have two options:

- Have the role installed in your execution environment that the Job Template is using.
- As you already have the `requirements.yml` at the root of your project, can you confirm that the role is being installed at runtime when the Job starts?

Assuming you have your Automation Hub credentials configured and this role is staged in your Automation Hub?

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [June 2, 2025, 1:17pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/5 "2025-06-02T13:17:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [June 2, 2025, 5:22pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/6 "2025-06-02T17:22:45Z")

</div>

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:

```yaml
- hosts: localhost
  gather_facts: no
  tasks:
    - name: List available roles
      shell: "{{ ansible_playbook_python }} $(command -v ansible-doc) --playbook-dir . -t role --list --json"
      args:
        chdir: "{{ playbook_dir }}"
      environment:
        ANSIBLE_CONFIG: "{{ lookup('config', 'CONFIG_FILE') }}"
      register: ansible_doc_roles

    - name: Display role count
      debug:
        msg: "Found {{ ansible_doc_roles.stdout | from_json | length }} roles"

    - name: Display role names
      debug:
        msg: "{{ item }}"
      loop: "{{ (ansible_doc_roles.stdout | from_json).keys() | list }}"

```

> I’ve also read to put a ansible.cfg in each role.

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:

```auto
project_root/
└── playbooks
    ├── collections
    │ └── ansible_collections
    │ └── ns
    │ └── col
    │ └── roles
    │ └── collection_role
    │ ├── meta
    │ │ └── main.yml
    │ └── tasks
    │ └── main.yml
    ├── roles
    │ └── standalone_role
    │ ├── meta
    │ │ └── main.yml
    │ └── tasks
    │ └── main.yml
    └── test.yml

```

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [June 2, 2025, 5:48pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/7 "2025-06-02T17:48:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [June 2, 2025, 6:16pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/8 "2025-06-02T18:16:26Z")

</div>

This is what a rh support engineer had me structure the role like:  
\*\*

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/5/522a3141780d937db1f7f404127797af99e326b5.png)  
\*\*

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [June 2, 2025, 7:13pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/9 "2025-06-02T19:13:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [June 2, 2025, 7:47pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/10 "2025-06-02T19:47:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [June 2, 2025, 7:58pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/11 "2025-06-02T19:58:51Z")

</div>

Try adding an ansible.cfg in the project root that contains

```auto
[defaults]
roles_path=./

```

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [June 2, 2025, 8:01pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/12 "2025-06-02T20:01:37Z")

</div>

ok, but I shouldn’t have to do that with each role, right?

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [June 2, 2025, 8:47pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/13 "2025-06-02T20:47:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![olanok](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/olanok/32/1210_2.png) [@olanok](https://forum.ansible.com/u/olanok)\
**Post date:** [June 3, 2025, 11:54am UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/14 "2025-06-03T11:54:44Z")

</div>

If **config\_adjoin** is the role, move that directory to the **roles** directory under **CONFIGE\_ADJOIN**.

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [June 3, 2025, 1:03pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/15 "2025-06-03T13:03:36Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [June 3, 2025, 2:09pm UTC](https://forum.ansible.com/t/aap-2-5-role-not-found/43084/16 "2025-06-03T14:09:01Z")

</div>

This is what I have configured in my “Paths to expose isolated jobs”

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/7/70a291f83fc8e2e7f5f9a4f9e9a6fb7762f3e016.png)

Not sure if this is going to help resolve my issue.
