role dependencies question

hi,

i have role1 which depend on role2. and i want role2 to know the path of role1 without being hardcoded, how can i achieve this?

#role1/meta/main.yml
dependencies:

  • { role: role2, role_dir: “{{role_path}}” } → it doesn’t work, role_dir is always the path of role2

thanks

Use the role_path variable to get most of the path. Then go back a dir and into role1.

  • { role: role2, role_dir: “{{ role_path }}/…/role1” }

Thanks, this could be a solution.