From 6af9638d8197a5a8dcafe6ade876f44a2cb5ef93 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Fri, 10 Mar 2017 15:46:42 -0500 Subject: [PATCH] job event data marked with _ansible_no_log should be censored see: #5691 --- awx/lib/tower_display_callback/module.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/lib/tower_display_callback/module.py b/awx/lib/tower_display_callback/module.py index c40c94ec5a..b69238026f 100644 --- a/awx/lib/tower_display_callback/module.py +++ b/awx/lib/tower_display_callback/module.py @@ -310,11 +310,15 @@ class BaseCallbackModule(CallbackBase): if result._task.get_name() == 'setup': result._result.get('ansible_facts', {}).pop('ansible_env', None) + res = result._result + if res.get('_ansible_no_log', False): + res = {'censored': "the output has been hidden due to the fact that 'no_log: true' was specified for this result"} + event_data = dict( host=result._host.get_name(), remote_addr=result._host.address, task=result._task, - res=result._result, + res=res, event_loop=result._task.loop if hasattr(result._task, 'loop') else None, ) with self.capture_event_data('runner_on_ok', **event_data):