Is it possible to use $hostvars in a custom module? I tried passing it to my custom module and was told that the module only wanted key/value pairs.
Thanks,
James
Is it possible to use $hostvars in a custom module? I tried passing it to my custom module and was told that the module only wanted key/value pairs.
Thanks,
James
I believe modules already get the host variables (inject dictionary IIRC).
If you mean a normal 'remote' module, they don't -- they only get what
is explicitly passed to them on the module line.
If you are writing a server side module, they have access to all of that info.
> I believe modules already get the host variables (inject dictionary
IIRC).If you mean a normal 'remote' module, they don't -- they only get what
is explicitly passed to them on the module line.
I'm dealing with a normal 'remote' module in this case. How do I pass
$hostvars to the remote module?
If you are writing a server side module, they have access to all of that
info.--
Thanks,
James
You can't. But you can do stuff like explicitly passing some
variables down, ex:
action: foo asdf=$asdf