[ansible-devel] Re: Retrieve facts from a lookup plugin

2021-08-23 Thread Sloane Hertel
Make sure the vars are documented, since the documentation doubles as the arg spec: DOCUMENTATION = """ ... options: option_name: description: ... vars: - name: my_var """ And use self.get_option('option_name') to retrieve the value after setting options wi

[ansible-devel] Re: Retrieve facts from a lookup plugin

2021-08-23 Thread John Day
I partially answered my own question, from what should have been obvious. The variable stack is passed to the lookup plugin. self.set_options(var_options=variables, direct=kwargs) x = variables['vars'][''] But I am still stuck with a problem. That returns the literal string value that wa

[ansible-devel] Re: Retrieve facts from a lookup plugin

2021-08-23 Thread John Day
I should add that I tried setting environment variables using "environment:" in the play, but those do not appear to be set yet in the process that is running the jinja2 templating. On Monday, August 23, 2021 at 10:51:16 AM UTC-4 John Day wrote: > I am building a lookup plugin to help with iden