MMA
MMA

Reputation: 458

How to give role dependencies path in Ansible?

I want to include role dependency. However looks like it downloads from galaxy. I already have a role in pc. How do I provide a path to it in "meta" file.

Say, I want to install a ROLE_B which is dependent on ROLE_A.

Here is the structure I have.

~/Ansible/Playbook.yml
~/Ansible/Roles/ROLE_B
~/Ansible/Roles/ROLE_A


Meta-file of ROLE_B:
---
dependencies: [
  - ~/Ansible/Roles/ROLE_A
]

Any idea if it is correct?

Upvotes: 0

Views: 883

Answers (1)

techraf
techraf

Reputation: 68439

The syntax is incorrect. Either you should use YAML or JSON to define a list, but not both.

dependencies:
  - ~/Ansible/Roles/ROLE_A

But you don't need to provide a full path to the roles if they are in roles directory. So the following should be sufficient:

dependencies:
  - ROLE_A

Upvotes: 1

Related Questions