Altering dependency role order

23 views
Skip to first unread message

Ryan Oakes

unread,
May 26, 2017, 1:56:38 PM5/26/17
to Ansible Project
I currently have a role(role_one) that, as specified in its meta/main.yml, list another role dependency (role_two). 

dependencies:
    version: master

I would like this dependency (role_two) to run AFTER role_one. However, every time I invoke role_one, role_two always gets run first. 

Is there any way to alter this behavior? Or does having a dependency listed mean that dependency will always run first?

Any help would be appreciated!

-Ryan 

Brian Coca

unread,
May 30, 2017, 8:10:49 PM5/30/17
to Ansible Project
Dependency always run first. Either reverse the dependencies or bypass
by listing the roles in order in play or use include_role to run the
role at the exact point you want.


----------
Brian Coca

Ryan Oakes

unread,
May 30, 2017, 10:57:14 PM5/30/17
to Ansible Project
Thanks for the reply. I decided to just use a requirements.yml file and invoke the role with the "include_role" module to get the desired behavior. 
Reply all
Reply to author
Forward
0 new messages