The call pattern I'd suggest for ansible-inventory would be like

ansible-inventory -i my_inventory.yml --list --export

With the export option, group_vars should show under the group. I don't
understand the rest of your problem about expecting vars from module_utils,
but I hope this gets you closer on a few of your points.

Alan
github: AlanCoding


On Thu, Oct 3, 2019 at 8:52 AM Alexandru Obretin <
alexandru.obreti...@gmail.com> wrote:

> Hello,
>
> I am developing some custom Ansible modules used for configuring network
> TAPs and they basically rely on a HTTP connection. Therefore, I have
> designed a httapi plugin module and I want to get the group_vars
> information associated to the current host directly from my custom
> module_utils file. In other words, just before I send HTTP requests to my
> equipment I need to read the group_vars for that particular IP address in
> order to set the user/password/timeout and other variables to the request.
>
> So far I have achieved this task using "ansible-invetory --list" but this
> does not consider scenarios like using a specific inventory file other than
> /etc/ansible/hosts or defining vars directly inside the playbook.
>
> Is there another way to access the group vars from my module_utils/network
> custom implementation or from plugins/httpapi?
>
> Regards,
> Alex
>
> --
> 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/cd616b92-4e5e-4017-9541-f595738103d9%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-devel/cd616b92-4e5e-4017-9541-f595738103d9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAADLLLj0eCkRNH%2BM1BzezjqviNLcF5A5_834kt_3%2Bnz2CVonJg%40mail.gmail.com.

Reply via email to