0

I'm creating a company set of Ansible roles. One of them relies upon another.

All of these roles are hosted on their specific Gitlab repositories (one per role, obviously).

Instead of messing up with requirements.yml, I do prefer to use the dependencies tag of my meta/main.yml file. But I can't find which syntax use to create dependency links without declare them in Ansible galaxy (which is obviously impossible).

How can I do that ?

Riduidel
  • 22,052
  • 14
  • 85
  • 185

1 Answers1

0

I have not tested it but according to Ansible-Galaxy documentation about dependencies, it seems that:

You specify role dependencies in the meta/main.yml file by providing a list of roles. If the source of a role is Galaxy, you can simply specify the role in the format username.role_name. The more complex format used in requirements.yml is also supported, allowing you to provide src, scm, version, and name.

And an example follows:

dependencies:
  - src: geerlingguy.ansible
  - src: git+https://github.com/geerlingguy/ansible-role-composer.git
    version: 775396299f2da1f519f0d8885022ca2d6ee80ee8
    name: composer
Hadrien TOMA
  • 2,375
  • 2
  • 22
  • 32