Some observations regarding using dependencies in ansible roles
My ansible role papanito.ttrss is the first one using external dependencies i.e. roles made by others, as you can see in the meta/main.yml
I was under the assumption that with this declaration in the meta/main.yml, dependencies would be installed automatically when using the role - apparently not. I have the following playbook for testing:
However this fails, cause the respective dependencies are missing:
Roles can also be dependent on other roles, and when you install a role that has dependencies, those dependencies will automatically be installed to the roles_path.
There are two ways to define the dependencies of a role:
using meta/requirements.yml
using meta/main.yml
Still this does not make it magically appear, the above only take place if you run ansible-galaxy install -r requirements.yml. So for your ansible project you define papanito.ttrss in the requirements.yml …
… and then run ansible-galaxy install -r requirements.yml. Now we can see that the role papanito.ttrss and it’s dependencies are installed successfully.
So the issue with testing your own role - with dependencies - is that you also need a requirements.yml and run ansible-galaxy install -r requirements.yml to get the dependencies installed. Here my requirements.yml - so in addition to the declaration in meta/main.yml we also have to define the roles there: