# Order of roles execution in playbook

**URL:** <https://forum.ansible.com/t/order-of-roles-execution-in-playbook/21286>\
**Category:** Ansible Project\
**Created:** [April 27, 2016, 3:35am UTC](https://forum.ansible.com/t/order-of-roles-execution-in-playbook/21286 "2016-04-27T03:35:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_Richard](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Jim\_Richard](https://forum.ansible.com/u/Jim_Richard)\
**Post date:** [April 27, 2016, 3:35am UTC](https://forum.ansible.com/t/order-of-roles-execution-in-playbook/21286/1 "2016-04-27T03:35:25Z")

</div>

I have the following that as of 1.9.4, executed the roles in the order in which they are listed:

- hosts: all  
max\_fail\_percentage: 0  
gather\_facts: no  
roles:
- repositories
- yum-packages
- pip-packages
- java

With Ansible 2.X, this playbook begins by executing the java role.

Can I no longer assume a playbook like this will be executed in the listed order?

I’m stumped, am I missing something fundamental here re: Ansible 2.X ?

Thanks !

---

<div class="post-metadata">

**Author:** ![Jim\_Richard](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Jim\_Richard](https://forum.ansible.com/u/Jim_Richard)\
**Post date:** [April 30, 2016, 12:18am UTC](https://forum.ansible.com/t/order-of-roles-execution-in-playbook/21286/2 "2016-04-30T00:18:52Z")

</div>

nobody?

---

<div class="post-metadata">

**Author:** ![viper233](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/viper233/32/2060_2.png) [@viper233](https://forum.ansible.com/u/viper233)\
**Post date:** [April 30, 2016, 2:19am UTC](https://forum.ansible.com/t/order-of-roles-execution-in-playbook/21286/3 "2016-04-30T02:19:24Z")

</div>

The only thing I could suggest is that maybe you have/were or your Ansible environment is using a different strategy plugin.  
[http://docs.ansible.com/ansible/playbooks\_strategies.html](http://docs.ansible.com/ansible/playbooks_strategies.html)

or that you are using tags?

Do all the roles get executed? Is there any indents or tabs that have been added to the playbook so only some roles work?
