Merge pull request #3019 from sergevanginderachter/debug-allways-verbose

Make debug module always verbose in playbooks
This commit is contained in:
Michael DeHaan 2013-05-24 18:55:10 -07:00
commit fd9bbeb4f3
2 changed files with 6 additions and 1 deletions

View file

@ -434,6 +434,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
host_result2 = host_result.copy() host_result2 = host_result.copy()
host_result2.pop('invocation', None) host_result2.pop('invocation', None)
verbose_always = host_result2.pop('verbose_always', None)
changed = host_result.get('changed', False) changed = host_result.get('changed', False)
ok_or_changed = 'ok' ok_or_changed = 'ok'
if changed: if changed:
@ -441,7 +442,8 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
# show verbose output for non-setup module results if --verbose is used # show verbose output for non-setup module results if --verbose is used
msg = '' msg = ''
if not self.verbose or host_result2.get("verbose_override",None) is not None: if (not self.verbose or host_result2.get("verbose_override",None) is not
None) and verbose_always is None:
if item: if item:
msg = "%s: [%s] => (item=%s)" % (ok_or_changed, host, item) msg = "%s: [%s] => (item=%s)" % (ok_or_changed, host, item)
else: else:

View file

@ -46,4 +46,7 @@ class ActionModule(object):
else: else:
result = dict(msg=args['msg']) result = dict(msg=args['msg'])
# force flag to make debug output module always verbose
result['verbose_always'] = True
return ReturnData(conn=conn, result=result) return ReturnData(conn=conn, result=result)