# Can custom plugins access extra\_vars?

**URL:** <https://forum.ansible.com/t/can-custom-plugins-access-extra-vars/31839>\
**Category:** Ansible Project\
**Created:** [December 17, 2019, 5:34pm UTC](https://forum.ansible.com/t/can-custom-plugins-access-extra-vars/31839 "2019-12-17T17:34:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Garner](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@Andrew\_Garner](https://forum.ansible.com/u/Andrew_Garner)\
**Post date:** [December 17, 2019, 5:34pm UTC](https://forum.ansible.com/t/can-custom-plugins-access-extra-vars/31839/1 "2019-12-17T17:34:49Z")

</div>

There is a comment on an [Ansible GitHub issue](https://github.com/ansible/ansible/issues/10282#issuecomment-469707256) suggesting that an inventory plugin can access extra vars from a custom plugin, but the issue was closed without any details being added.

I have an inventory plugin and a lookup plugin and I’d like both to be able to use extra vars. Both share configuration values which I’d like to specify just once, and an extra\_vars would be preferable to environment variables.

Can anyone provide an example of how to do this, if it is possible?

[https://github.com/ansible/ansible/issues/10282#issuecomment-469707256](https://github.com/ansible/ansible/issues/10282#issuecomment-469707256)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [December 18, 2019, 6:11pm UTC](https://forum.ansible.com/t/can-custom-plugins-access-extra-vars/31839/2 "2019-12-18T18:11:10Z")

</div>

lookups get 'all vars' for templating, so extra vars are already  
available, for an inventory plugin, the code needs to request them via  
vars manager, see existing plugins for examples.
