# Issues with Playbook Order

**URL:** <https://forum.ansible.com/t/issues-with-playbook-order/34657>\
**Category:** Ansible Project\
**Created:** [February 19, 2021, 6:42pm UTC](https://forum.ansible.com/t/issues-with-playbook-order/34657 "2021-02-19T18:42:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Smith](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jeremy\_Smith](https://forum.ansible.com/u/Jeremy_Smith)\
**Post date:** [February 19, 2021, 6:42pm UTC](https://forum.ansible.com/t/issues-with-playbook-order/34657/1 "2021-02-19T18:42:35Z")

</div>

Hello All,  
I currently have a YAML playbook that is used to restart all servers in a specific environment. There are 2, sometimes 3 groups of hosts depending on the environment. My goal is to have the primary host in each group restart first and once this is done, it can proceed to restart the rest of the nodes. We want this done two nodes at a time and are specifying serial:2 for this purpose. We are using Order: Inventory, which is the default for this.

In one environment with two groups and four hosts, the inventory is ordered:  
host101  
host201  
host102  
host202.

When the playbook runs, it executes the play in the order they are listed in inventory, as expected.

In another environment, we have 3 groups of hosts, 7 nodes total. Even though the inventory is ordered as follows:  
host101  
host201  
host301  
host102  
host103  
host104  
host202

However when the playbook runs in this environment, it reboots the hosts in numerical order every time instead of as they are ordered in inventory.

The following is the playbook being used, with company specific details replaced the second play, which checks that a specific application site is up, can be ignored:

---

<div class="post-metadata">

**Author:** ![Jeremy\_Smith](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jeremy\_Smith](https://forum.ansible.com/u/Jeremy_Smith)\
**Post date:** [February 22, 2021, 7:06pm UTC](https://forum.ansible.com/t/issues-with-playbook-order/34657/2 "2021-02-22T19:06:44Z")

</div>

Addendum to this: We have tested the script outside of Tower and it executes as expected, as ordered in inventory. Seems this could be an issue with, or a bug in Tower.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 22, 2021, 7:43pm UTC](https://forum.ansible.com/t/issues-with-playbook-order/34657/3 "2021-02-22T19:43:43Z")

</div>

In that case best to use your Redhat support channel

---

<div class="post-metadata">

**Author:** ![Jeremy\_Smith](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jeremy\_Smith](https://forum.ansible.com/u/Jeremy_Smith)\
**Post date:** [February 23, 2021, 5:07pm UTC](https://forum.ansible.com/t/issues-with-playbook-order/34657/4 "2021-02-23T17:07:28Z")

</div>

This turns out to be a known bug. RedHat has been aware of it since 2019 but hasn’t fixed, nor have any plans to fix this issue anytime soon. Be aware, playlist ordering doesn’t work as it should and we are stuck with this fate until RedHat decides it’s important enough to fix.  
[https://github.com/ansible/awx/issues/2240#start-of-content](https://github.com/ansible/awx/issues/2240#start-of-content)
