# Back order for with\_items

**URL:** <https://forum.ansible.com/t/back-order-for-with-items/15179>\
**Category:** Ansible Project\
**Created:** [May 7, 2014, 10:43am UTC](https://forum.ansible.com/t/back-order-for-with-items/15179 "2014-05-07T10:43:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aleksey\_Chirkin](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@Aleksey\_Chirkin](https://forum.ansible.com/u/Aleksey_Chirkin)\
**Post date:** [May 7, 2014, 10:43am UTC](https://forum.ansible.com/t/back-order-for-with-items/15179/1 "2014-05-07T10:43:04Z")

</div>

Hello!

I use zfs module for creating necessary structure.  
Using “with\_items” I iterate over elements in config list. It’s ok, but after all I need to unmount creating volumes.  
This must be done in reverse order for preventing “busy device”.

I need something like with\_items\_desc.

What can you advise?

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [May 7, 2014, 12:46pm UTC](https://forum.ansible.com/t/back-order-for-with-items/15179/2 "2014-05-07T12:46:26Z")

</div>

This should do the trick I believe:

with\_tems: list|reverse

Look for ‘reverse’ on [http://jinja.pocoo.org/docs/templates/](http://jinja.pocoo.org/docs/templates/)

Serge

---

<div class="post-metadata">

**Author:** ![Nicolas\_Dupont-Jubie](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@Nicolas\_Dupont-Jubie](https://forum.ansible.com/u/Nicolas_Dupont-Jubie)\
**Post date:** [October 1, 2014, 8:03am UTC](https://forum.ansible.com/t/back-order-for-with-items/15179/3 "2014-10-01T08:03:45Z")

</div>

Hello,

The filter reverse returns a reverselistiterator and will be inappropriate here.  
I suggest you to use **with\_items:** your\_liste\*\*[::-1]\*\*

Regards,

---

<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:** [October 1, 2014, 12:01pm UTC](https://forum.ansible.com/t/back-order-for-with-items/15179/4 "2014-10-01T12:01:38Z")

</div>

Newer versions of Ansible can iterate across iterators in that “with” and should not present a problem.
