mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Tracebacks are now catchable with ignore_errors and have streamlined output. Also removes 'baby-JSON' for bash modules.
This commit is contained in:
@@ -37,6 +37,8 @@ EXAMPLES = '''
|
||||
ansible webservers -m ping
|
||||
'''
|
||||
|
||||
import exceptions
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
@@ -46,6 +48,8 @@ def main():
|
||||
)
|
||||
result = dict(ping='pong')
|
||||
if module.params['data']:
|
||||
if module.params['data'] == 'crash':
|
||||
raise exceptions.Exception("boom")
|
||||
result['ping'] = module.params['data']
|
||||
module.exit_json(**result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user