Can custom plugins access extra_vars?

10 views
Skip to first unread message

Andrew Garner

unread,
Dec 17, 2019, 12:34:50 PM12/17/19
to Ansible Project
There is a comment on an Ansible GitHub issue 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? 

Brian Coca

unread,
Dec 18, 2019, 1:12:10 PM12/18/19
to Ansible Project
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.


----------
Brian Coca

Reply all
Reply to author
Forward
0 new messages