# Reversed sorted inventory

**URL:** <https://forum.ansible.com/t/reversed-sorted-inventory/15957>\
**Category:** Ansible Project\
**Created:** [August 15, 2014, 11:26am UTC](https://forum.ansible.com/t/reversed-sorted-inventory/15957 "2014-08-15T11:26:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yorick\_Gersie](https://avatars.discourse-cdn.com/v4/letter/y/cc9497/32.png) [@Yorick\_Gersie](https://forum.ansible.com/u/Yorick_Gersie)\
**Post date:** [August 15, 2014, 11:26am UTC](https://forum.ansible.com/t/reversed-sorted-inventory/15957/1 "2014-08-15T11:26:55Z")

</div>

I have an issue when I want to reboot hosts in a sequence. I am using serial: 1 to make sure the playbook runs on 1 host at a time which works perfectly, but Ansible runs the inventory in reversed order.  
This was tested with Ansible version 1.6.6 and 1.7.1.

See: [http://pastebin.com/Hc18K7wX](http://pastebin.com/Hc18K7wX) for my test run.

Is this expected behaviour? For now I’ll reverse the inventory list to workaround the issue.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 16, 2014, 2:38pm UTC](https://forum.ansible.com/t/reversed-sorted-inventory/15957/2 "2014-08-16T14:38:50Z")

</div>

No, it’s definitely _not_ expected, gathering facts happens in the right order, but the hosts go backwards.

This is a bug for sure, and I’m filing it as a high priority item.

Thanks very much for the report.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 16, 2014, 2:45pm UTC](https://forum.ansible.com/t/reversed-sorted-inventory/15957/3 "2014-08-16T14:45:51Z")

</div>

You can follow this ticket at - [https://github.com/ansible/ansible/issues/8646](https://github.com/ansible/ansible/issues/8646) - thanks once again!

---

<div class="post-metadata">

**Author:** ![Yorick\_Gersie](https://avatars.discourse-cdn.com/v4/letter/y/cc9497/32.png) [@Yorick\_Gersie](https://forum.ansible.com/u/Yorick_Gersie)\
**Post date:** [August 16, 2014, 2:49pm UTC](https://forum.ansible.com/t/reversed-sorted-inventory/15957/4 "2014-08-16T14:49:03Z")

</div>

Thanks Michael, I’ll keep an eye on the report.

---

<div class="post-metadata">

**Author:** ![Imran\_Khan1](https://avatars.discourse-cdn.com/v4/letter/i/a4c791/32.png) [@Imran\_Khan1](https://forum.ansible.com/u/Imran_Khan1)\
**Post date:** [August 20, 2014, 10:33am UTC](https://forum.ansible.com/t/reversed-sorted-inventory/15957/5 "2014-08-20T10:33:58Z")

</div>

Has this issue been resolved, I used an apt-get installation method in Ubuntu 12.04 ,Precise. Currently I have ansible 1.7 installed.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 20, 2014, 11:44am UTC](https://forum.ansible.com/t/reversed-sorted-inventory/15957/6 "2014-08-20T11:44:02Z")

</div>

Yes, this issue has been resolved on the development branch for 1.8.

Should a 1.7.2 occur in the future (not currently in plan, but this will likely change), it will be included there as well.

The ticket is here: [https://github.com/ansible/ansible/issues/8646](https://github.com/ansible/ansible/issues/8646)

---

<div class="post-metadata">

**Author:** ![Imran\_Khan1](https://avatars.discourse-cdn.com/v4/letter/i/a4c791/32.png) [@Imran\_Khan1](https://forum.ansible.com/u/Imran_Khan1)\
**Post date:** [August 20, 2014, 11:49am UTC](https://forum.ansible.com/t/reversed-sorted-inventory/15957/7 "2014-08-20T11:49:32Z")

</div>

A bit too late for me, working on a workaround 🙂
