# Altering dependency role order

**URL:** <https://forum.ansible.com/t/altering-dependency-role-order/24582>\
**Category:** Ansible Project\
**Created:** [May 26, 2017, 5:56pm UTC](https://forum.ansible.com/t/altering-dependency-role-order/24582 "2017-05-26T17:56:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Oakes](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@Ryan\_Oakes](https://forum.ansible.com/u/Ryan_Oakes)\
**Post date:** [May 26, 2017, 5:56pm UTC](https://forum.ansible.com/t/altering-dependency-role-order/24582/1 "2017-05-26T17:56:38Z")

</div>

I currently have a role(role\_one) that, as specified in its meta/main.yml, list another role dependency (role\_two).

dependencies:

- src: git+https://wwwin-github.com/role\_two.git  
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

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [May 31, 2017, 12:10am UTC](https://forum.ansible.com/t/altering-dependency-role-order/24582/2 "2017-05-31T00:10:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ryan\_Oakes](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@Ryan\_Oakes](https://forum.ansible.com/u/Ryan_Oakes)\
**Post date:** [May 31, 2017, 2:57am UTC](https://forum.ansible.com/t/altering-dependency-role-order/24582/3 "2017-05-31T02:57:13Z")

</div>

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.
