0

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?

techraf
  • 64,883
  • 27
  • 193
  • 198
MMA
  • 408
  • 3
  • 7
  • 19

1 Answers1

1

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
techraf
  • 64,883
  • 27
  • 193
  • 198