Back order for with_items

1,579 views
Skip to first unread message

Aleksey Chirkin

unread,
May 7, 2014, 6:43:04 AM5/7/14
to ansible...@googlegroups.com
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?

--
Aleksey

Serge van Ginderachter

unread,
May 7, 2014, 8:46:26 AM5/7/14
to ansible...@googlegroups.com
This should do the trick I believe:

    with_tems: list|reverse 



  Serge


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1c996331-aae1-420a-b1cc-f9fc2e186d0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas Dupont-Jubien

unread,
Oct 1, 2014, 4:03:45 AM10/1/14
to ansible...@googlegroups.com

Hello,


The filter reverse returns a reverselistiterator and will be inappropriate here.
I suggest you to use  with_items: your_liste[::-1]

Regards,

Michael DeHaan

unread,
Oct 1, 2014, 8:01:41 AM10/1/14
to ansible...@googlegroups.com
Newer versions of Ansible can iterate across iterators in that "with" and should not present a problem.



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages