Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install ansible galaxy a collection's role dependencies?

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.

like image 375
Yuriy Gromov Avatar asked Nov 07 '22 08:11

Yuriy Gromov


1 Answers

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.

like image 189
Ehud Kaldor Avatar answered Nov 16 '22 20:11

Ehud Kaldor