Working on complex argument support.

This commit is contained in:
Michael DeHaan 2013-02-17 15:01:49 -05:00
parent 711bc4db05
commit fba1d755d6

9
ping
View file

@ -36,10 +36,15 @@ author: Michael DeHaan
def main():
module = AnsibleModule(
argument_spec = dict(),
argument_spec = dict(
data=dict(required=False, default=None),
),
supports_check_mode = True
)
module.exit_json(ping='pong')
result = dict(ping='pong')
if module.params['data']:
result['ping'] = module.params['data']
module.exit_json(**result)
# this is magic, see lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>