In general, modules take simple key=value pairs as arguments.
However, they return JSON. It's generally best to pass on just what
you need in particular.
Here is a trivial example of accessing variables from previous commands.
- command: /usr/bin/uptime
register: uptime_result
- command: echo Hi I have been up for ${uptime_result.stdout}
You can also get an entire variable result inside a template by doing:
{{ uptime_result | to_json }}
So should you want to really write a module that requires structured
inputs there are workarounds. In general though, while variables do
allow all the structure you want in the world, we strive to have all
the core modules have a really simple interface and not need to define
nested data structures to use them.
Hope that answers the question!