It is true that modules can generally only take key=value arguments.
What is the nature of the module you are writing? I am generally not
in favor of the idea of modules needing to read a config file and do
not want that to become common, but it may serve as a workaround in
your case.
On Mon, Dec 17, 2012 at 6:20 PM, Oren Shomron <
sho...@gmail.com> wrote:
> Hi,
>
> I have a case where I would like to pass a dictionary to a custom module I
> am writing.
> This is something that works find when passing to the template module, but
> not to a custom module,
> where _load_parameters seems to die with: "this module requires key=value
> arguments" if I nest everything under a node,
>
> or this:
>
> fatal: [db-master] => Traceback (most recent call last):
> File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line 236,
> in _executor
> exec_rc = self._executor_internal(host)
> File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line 292,
> in _executor_internal
> return self._executor_internal_inner(host, self.module_name,
> self.module_args, inject, port)
> File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line 340,
> in _executor_internal_inner
> module_args = utils.template(self.basedir, module_args, inject,
> expand_lists=True)
> File "/usr/lib/pymodules/python2.7/ansible/utils/template.py", line 240,
> in template
> text = varReplace(basedir, unicode(text), vars,
> expand_lists=expand_lists)
> File "/usr/lib/pymodules/python2.7/ansible/utils/template.py", line 196,
> in varReplace
> replacement = ",".join(replacement)
> TypeError: sequence item 0: expected string, dict found
>
> if I have a list of dictionaries directly.
>
> Is this something that should be possible?
>
> Thanks again,
> - Oren
>
> --
>
>