Re: [ansible-project] Re: Ansible Get vSphere Virtual Machines

2020-04-30 Thread Mani
Hi David,

You can try the below loop:

- debug:
msg: "{{ item.guest_name }}"
  with_items:
- "{{ vm_info.virtual_machines }}"


On Wednesday, 8 April 2020 17:43:16 UTC+5:30, David Foley wrote:
>
> Hi Gobi,
>
>
> I was using that above, but it outputs all information,
> I was trying to only output the guest_name with the with_item loop 
>
>

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/eba8a86c-b65e-42e9-833b-e14b665b3125%40googlegroups.com.


Re: [ansible-project] Re: Ansible Get vSphere Virtual Machines

2020-04-08 Thread David Foley

>
> Hi Gobi,


I was using that above, but it outputs all information,
I was trying to only output the guest_name with the with_item loop 

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6a5bc48a-36ba-48db-8fc0-9e78af9beadd%40googlegroups.com.


Re: [ansible-project] Re: Ansible Get vSphere Virtual Machines

2020-04-08 Thread Gobi
Hi David,
You can do  a loop like this

- debug:
 msg: "{{ item.tags }}"
   with_items:
 - "{{ vm_info.virtual_machines }}"


On Wed, Apr 8, 2020 at 5:16 PM David Foley  wrote:
>>
>> Hi Gobi
>
>
> that outputs the first on the Json List, how would i do a loop ?
>
> i Tried with_items
>
>  - debug:
> msg: "{{ item.tags }}"
>   with_items:
> - "{{ vm_info.virtual_machines.guest_name }}"
>
> --
> 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-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/9d2f330c-e546-45f0-b8c4-a34b4d0efafd%40googlegroups.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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKuA%2BXeeE6Mo2L5hERoT%3D%3DydDdOqRSEMq0mGEkAw8PcqOwdz3A%40mail.gmail.com.


[ansible-project] Re: Ansible Get vSphere Virtual Machines

2020-04-08 Thread David Foley

>
> Hi Gobi
>

that outputs the first on the Json List, how would i do a loop ?

i Tried with_items

 - debug:
msg: "{{ item.tags }}"
  with_items:
- "{{ vm_info.virtual_machines.guest_name }}"

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9d2f330c-e546-45f0-b8c4-a34b4d0efafd%40googlegroups.com.