Tracebacks are now catchable with ignore_errors and have streamlined output. Also removes 'baby-JSON' for bash modules.
This commit is contained in:
parent
f3249d72be
commit
5aa6ddef7f
1 changed files with 4 additions and 0 deletions
|
@ -37,6 +37,8 @@ EXAMPLES = '''
|
||||||
ansible webservers -m ping
|
ansible webservers -m ping
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import exceptions
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
|
@ -46,6 +48,8 @@ def main():
|
||||||
)
|
)
|
||||||
result = dict(ping='pong')
|
result = dict(ping='pong')
|
||||||
if module.params['data']:
|
if module.params['data']:
|
||||||
|
if module.params['data'] == 'crash':
|
||||||
|
raise exceptions.Exception("boom")
|
||||||
result['ping'] = module.params['data']
|
result['ping'] = module.params['data']
|
||||||
module.exit_json(**result)
|
module.exit_json(**result)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue