Re: [⚠️] [ansible-devel] Re: Print Hostvar For All Host Under Group

2021-12-07 Thread 'Jitender J' via Ansible Development
Thanks @Todd, First solution is working for me thank you very much On Mon, Dec 6, 2021 at 9:54 PM Todd Lewis wrote: > Is this what you're looking for? > $ *cat groupvars-inventory.ini* > [test] > test1 ansible_host=1.1.1.1 > test2 ansible_host=2.2.2.2 > > [dev] > dev1 ansible_host=3.3.3.3 >

[ansible-devel] Re: Print Hostvar For All Host Under Group

2021-12-06 Thread Todd Lewis
Is this what you're looking for? $ *cat groupvars-inventory.ini* [test] test1 ansible_host=1.1.1.1 test2 ansible_host=2.2.2.2 [dev] dev1 ansible_host=3.3.3.3 dev2 ansible_host=4.4.4.4 $ *cat groupvars.yml* --- - name: Demo for accessing inventory group variables # ansible-playbook groupvars.y

Re: [⚠️] [ansible-devel] Re: Print Hostvar For All Host Under Group

2021-12-05 Thread 'Jitender J' via Ansible Development
Thanks .any other way to use hosname wildcard "{{hostvars['*test*']['ansible_host']}}" On Sun, 5 Dec, 2021, 5:25 AM james livulpi, wrote: > 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/ansib

[ansible-devel] Re: Print Hostvar For All Host Under Group

2021-12-04 Thread james livulpi
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: