Hello,

This doesn't look like its a supported way, you can use index of one and 
access but not full group:

https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-access-a-group-variable

- Jamer

On Friday, December 3, 2021 at 3:02:19 AM UTC-5 jiten...@zscaler.com wrote:

> Hi Team,
>
> Need your help got stuck 
>
> I want to use host vars from inventory for all host under a specific group
>
> I tried with the below example but only getting IP when I am passing 
> hostname not getting anything when trying to get ansbile_host variable 
> value for all host under that group with the group name 
>
>  ip: "{{hostvars['test']['ansible_host']}}"   ------Not working 
>  ip: "{{hostvars['test1']['ansible_host']}}" -------- Working 
>
>
> [test]
> test1 ansible_host=1.1.1.1
> test2 ansible_host=2.2.2.2
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/81261341-b525-4042-b8ba-a68fd5767a2en%40googlegroups.com.

Reply via email to