Eduardo Medeiros

Eduardo Medeiros

System Engineer.

© 2022

About me

Browse by categories

Molecule: Enabling roles dependencies

Molecule supports roles dependencies, however, we need to define the role-file parameter into the molecule.yml file to fetch the roles automatically.

1) Change the molecule.yml file according to the sample below.

dependency:
  name: galaxy
  options:
    role-file: ${MOLECULE_SCENARIO_DIRECTORY}/requirements.yml

2) Create a file called requirements.yml within molecule folder.

---
# sample for springboot role.
- src: [email protected]:/ansible/roles/springboot.git
  scm: git

3) Add the role into the playbook.yml file.

- name: Converge
  hosts: all
  roles:
    - role: springboot
    - role: myrole