Is it expected that lookup plugins get a different value for ‘inject’ depending on how they’re called in a playbook? Here’s a simple test case: https://gist.github.com/DazWorrall/5584358 - in the first case, ‘inject’ is a collection of host/group/fact data, in the second case its a function (which when called, doesnt return the same data as in the first case).
Thanks
I’m not sure I really understand what your lookup plugin is supposed to do.
I’m also not sure why you think inject is a function.
The lookup plugin in the gist is purely to demonstrate the difference in behaviour, showing that the value of inject when you use the lookup function in a jinja template is the builtin vars function0, you can see it passed in here1.
We have a lookup plugin which reads host data from the value of inject when you call the plugin using the with_foo
syntax - not sure if that the right thing to do but it works in the with_foo
case. The value is inconsistent depending on how its called from a playbook, I’m not sure if that’s a bug, or that we just shouldn’t be relying on the value of that parameter inside a lookup plugin.
I think the vars error was leftover when the lookup function was defined in a closure.
Please make sure there’s a github ticket filed on this one and I’ll take care of it.