It seems that Ansible Galaxy will understand it has to download dependencies if those are specified in either meta/main.yml or a requirements.yml file.
Is there a best practice for this?
It seems that Ansible Galaxy will understand it has to download dependencies if those are specified in either meta/main.yml or a requirements.yml file.
Is there a best practice for this?
TL;DR:
meta/main.yml
is for roles-to-role dependencyrequirements.yml
is for playbook-to-role dependency.Playbook can contain dependencies in
meta/main.yml
. Dependent roles will be installed duringansible-galaxy install
, so if role A depends on role B, role B will be installed together with role A. Role B will be also applied before role A is applied automatically duringansible-playbook
run.Roles mentioned in
requirements.yml
are requirements of your local playbook. You can install roles from Galaxy withansible-galaxy -r requirements.yml
but therequirements.yml
file is used only for your convenience of installing roles needed to run the playbook. No automatic/automagic execution of roles mentioned there should happen.