loop query

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

Refer this link: https://docs.ansible.com/ansible/2.7/user_guide/playbooks_loops.html?highlight=nested%20loops#with-list

I think you should have:

dev: “{{ item}}”
loop:

  • /dev/sda1

Harry

Where did this information come from? Recent documentation says:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html

  "We have not deprecated the use of with_<lookup> - that syntax will still
  be valid for the foreseeable future."