loop query

21 views
Skip to first unread message

Kannappan M

unread,
May 30, 2020, 1:17:11 PM5/30/20
to Ansible Project
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

Ompragash

unread,
May 30, 2020, 1:22:05 PM5/30/20
to ansible...@googlegroups.com

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/87b602b4-aceb-4087-b5e9-96ee49e83cbd%40googlegroups.com.

harry devine

unread,
May 30, 2020, 1:23:31 PM5/30/20
to ansible...@googlegroups.com
I think you should have:

dev: “{{ item}}”
loop:
  - /dev/sda1

Harry

Vladimir Botka

unread,
May 30, 2020, 4:02:12 PM5/30/20
to Kannappan M, ansible...@googlegroups.com
On Sat, 30 May 2020 10:17:11 -0700 (PDT)
Kannappan M <agile...@gmail.com> wrote:

> Recently i came to know that with.list is getting retired

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."

--
Vladimir Botka
Reply all
Reply to author
Forward
0 new messages