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:
```
$ tree acme/
acme/
├── README.md
└── roles
    └── users
        ├── defaults
        │   └── main.yml
        ├── meta
        │   └── main.yml
        └── tasks
            └── main.yml

5 directories, 4 files
```

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

2 directories, 3 files
```

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4feac56f-5c99-4752-acd5-61a2b37c3ae0n%40googlegroups.com.

Reply via email to