# Access group\_vars from custom network module

**URL:** <https://forum.ansible.com/t/access-group-vars-from-custom-network-module/31414>\
**Category:** Ansible Project\
**Created:** [October 3, 2019, 12:55pm UTC](https://forum.ansible.com/t/access-group-vars-from-custom-network-module/31414 "2019-10-03T12:55:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandru\_Obretin](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Alexandru\_Obretin](https://forum.ansible.com/u/Alexandru_Obretin)\
**Post date:** [October 3, 2019, 12:55pm UTC](https://forum.ansible.com/t/access-group-vars-from-custom-network-module/31414/1 "2019-10-03T12:55:28Z")

</div>

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
