From fba1d755d6019919ff7ed740238996eacf54bb39 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 17 Feb 2013 15:01:49 -0500 Subject: [PATCH] Working on complex argument support. --- ping | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ping b/ping index e52da3c9e94..4bb99de0454 100644 --- a/ping +++ b/ping @@ -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 #<>