(This is really a question for ansible-devel list)

In the argument_spec of the module that defines the argument, just do

type='dict'

It will accept complex arguments as well as quoted key=value pairs.

module_name:
  foo:
     x: 1
     y: "bar"
  baz: "glorp"

Is how complex args are passed

Or

module_name: 'foo="x=1 y=bar" baz="glorp"'

This is exactly how the ec2 module in 1.4/1.5 processes and passes instance
tags, if you want to take a look.

It also knows how to parse inline JSON, so it is very much a "do what you
mean" kind of input.




On Mon, Dec 9, 2013 at 5:18 AM, Giorgio Valoti <[email protected]> wrote:

> Hi,
> I’m trying to extend the ZFS module to add support for user properties.
>
> My plan was to add a new module argument, called (guess what)
> `user_properties` which accepts a list of dictionaries:
>
> [{key: 'my.module.name:key-name', value: 'whatever'}, ...]
>
> However, I get this error message:
>
> > msg: this module requires key=value arguments
>
> Even though I can pass an empty list or a list with string items, like
> ['a', 'b', 'c'].
>
> Is there a way to do this?
>
>
> Thank you.
>
> --
> Giorgio Valoti
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Michael DeHaan <[email protected]>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to