6

I'm trying to use Ansible Galaxy collections and can't find a way how to install dependencies of roles inside a collection which I specified in a role's meta/main.yml dependencies list. As I understand a galaxy.yml of a collection can have only the other collections as dependencies, but not roles.

What is the correct way to install a role's dependencies along with the installation of a collection?

Of course, it is possible to specify all dependencies in the readme file of a collection and use them in the requirements.yml, but it is not very convenient.

karel
  • 5,489
  • 46
  • 45
  • 50

2 Answers2

1

I am not sure this can be done.

I ran into the same issue today - i am converting a group of roles into a collection, and some of those roles call on public roles, which is easy for a role. but it seems like a collection can only pull other collections, and the items in the meta/main.yml only seem to agree with roles already in the collection, and there is no way i found to add an external role to a collection.

i ran ansible-galaxy collection install .... -vvvvv and it seems like it is calling on galaxy's v2 API, but looking a little into the API server responses, it seems like it knows only about collections. v1 knows roles too, but...

so, yes - i'm interested in pulling external roles into my collection, and it does not seem to be possible. for now, at least.

Ehud Kaldor
  • 753
  • 1
  • 7
  • 20
0

Didn't find the solution yet. While looking for a solution it is required to enlist all dependencies in a playbook requirements file