# loop query

**URL:** <https://forum.ansible.com/t/loop-query/33057>\
**Category:** Ansible Project\
**Created:** [May 30, 2020, 5:17pm UTC](https://forum.ansible.com/t/loop-query/33057 "2020-05-30T17:17:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanna3k6](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kanna3k6/32/11075_2.png) [@kanna3k6](https://forum.ansible.com/u/kanna3k6)\
**Post date:** [May 30, 2020, 5:17pm UTC](https://forum.ansible.com/t/loop-query/33057/1 "2020-05-30T17:17:11Z")

</div>

Hi Team,

Recently i came to know that with.list is getting retired , so what it is the replacement of it.

For eg using the filesystem module i need to format the list of disc please let me know which format is correct first one or the second one

-name:Format the disk  
filesystem:  
fstype: xfs  
dev:

- /dev/sda1
- /dev/sdb1
- /dev/sdc1
- /dev/sdd1
- /dev/sde1

-name:Format the disk  
filesystem:  
fstype: xfs  
dev:  
name:

- /dev/sda1
- /dev/sdb1
- /dev/sdc1
- /dev/sdd1
- /dev/sde1

---

<div class="post-metadata">

**Author:** ![Ompragash](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ompragash/32/9070_2.png) [@Ompragash](https://forum.ansible.com/u/Ompragash)\
**Post date:** [May 30, 2020, 5:21pm UTC](https://forum.ansible.com/t/loop-query/33057/2 "2020-05-30T17:21:35Z")

</div>

Refer this link: [https://docs.ansible.com/ansible/2.7/user\_guide/playbooks\_loops.html?highlight=nested%20loops#with-list](https://docs.ansible.com/ansible/2.7/user_guide/playbooks_loops.html?highlight=nested%20loops#with-list)

---

<div class="post-metadata">

**Author:** ![harry\_devine](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/harry_devine/32/5293_2.png) [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Post date:** [May 30, 2020, 5:23pm UTC](https://forum.ansible.com/t/loop-query/33057/3 "2020-05-30T17:23:00Z")

</div>

I think you should have:

dev: “{{ item}}”  
loop:

- /dev/sda1

Harry

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [May 30, 2020, 8:01pm UTC](https://forum.ansible.com/t/loop-query/33057/4 "2020-05-30T20:01:55Z")

</div>

Where did this information come from? Recent documentation says:  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_loops.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html)

&nbsp;&nbsp;"We have not deprecated the use of with\_\<lookup\> - that syntax will still  
&nbsp;&nbsp;be valid for the foreseeable future."
