# Unable to get shared roles to work

**URL:** <https://forum.ansible.com/t/unable-to-get-shared-roles-to-work/38326>\
**Category:** AWX Project\
**Tags:** awx, galaxy-ng\
**Created:** [August 13, 2023, 9:04am UTC](https://forum.ansible.com/t/unable-to-get-shared-roles-to-work/38326 "2023-08-13T09:04:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Werner\_van\_der\_Merwe](https://avatars.discourse-cdn.com/v4/letter/w/5e9695/32.png) [@Werner\_van\_der\_Merwe](https://forum.ansible.com/u/Werner_van_der_Merwe)\
**Post date:** [August 13, 2023, 9:04am UTC](https://forum.ansible.com/t/unable-to-get-shared-roles-to-work/38326/1 "2023-08-13T09:04:49Z")

</div>

Firstly, apologies for cross-posting to Ansible group as well, I think that was the wrong location.

Due to policies, I cannot upload company code to Galaxy. I am trying to use git roles to work around this.

I based my approach off [this](https://stackoverflow.com/questions/55773505/where-to-place-requirements-yml-for-ansible-and-use-it-to-resolve-dependencies) answer, and by referencing the doco [here](https://galaxy.ansible.com/docs/using/installing.html#installing-multiple-roles-from-a-file).

All the Ansible code is in two repositories, a company-shared repo (acme), and an app-specific repo (simpleapp).

When I run the playbook from simpleapp, it errors out, stating it can’t find the shared role in acme, but looking in the cache dir, it seem to download both repositories.

This is a stripped-down version, just trying to call the shared debug role:

```auto
$ tree acme/
acme/
├── README.md
└── roles
└── users
├── defaults
│ └── main.yml
├── meta
│ └── main.yml
└── tasks
└── main.yml

5 directories, 4 files

```

```auto
$ tree simpleapp/
simpleapp/
├── README.md
├── playbooks
│ └── run_debug.yml
└── roles
└── requirements.yml

2 directories, 3 files

```

```auto
$ cat acme/roles/users/meta/main.yml
---
galaxy_info:
author: Werner van der Merwe
company: ICS
license: MIT
min_ansible_version: '2.0'
role_name: 'users'
description: Create shared users

```

```auto
$ cat simpleapp/roles/requirements.yml
- src: https://REDACTED
scm: git
version: main
name: acme

```

```auto
$ cat simpleapp/playbooks/run_debug.yml
---
- name: Playbooks that calls a role from the shared repo
hosts: all
gather_facts: false

roles:
- role: acme.users

```

The error I get in the AWX console:

```auto
ERROR! the role 'acme.users' was not found in /runner/project/playbooks/roles:/runner/requirements_roles:/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/runner/project/playbooks

```

Any assistance will be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Lorenzo\_Tanganelli](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@Lorenzo\_Tanganelli](https://forum.ansible.com/u/Lorenzo_Tanganelli)\
**Post date:** [August 14, 2023, 7:35am UTC](https://forum.ansible.com/t/unable-to-get-shared-roles-to-work/38326/2 "2023-08-14T07:35:53Z")

</div>

Hi,  
The error should be the structure of acme role.  
This should contain everything that now is under roles folder, like  
$ tree acme/  
acme/  
├── README.md

> ── defaults  
> └── main.yml  
> ├── meta  
> │ └── main.yml  
> └── tasks  
> └── main.yml

Then in your playbook requirements.yml you can include role similar as your example, like

- src: [https://REDACTED](https://redacted/)  
scm: git  
version: main  
name: acme.user

And call the role with acme.user keyword.

If you have more tha one role reletad acme, those roles can be wrapped in a Collection, but i suggest to start with standalone roles.

Good luck!
