Add a configuration setting that allows the user to specify printing of task arguments in the header.

Fixes #14554
This commit is contained in:
Toshio Kuratomi 2016-02-18 04:20:35 -08:00
parent 54942ee8ff
commit 86b8dc0e79
4 changed files with 53 additions and 3 deletions

View file

@ -113,7 +113,19 @@ class CallbackModule(CallbackBase):
self._display.banner("NO MORE HOSTS LEFT")
def v2_playbook_on_task_start(self, task, is_conditional):
self._display.banner("TASK [%s]" % task.get_name().strip())
args = ''
# args can be specified as no_log in several places: in the task or in
# the argument spec. We can check whether the task is no_log but the
# argument spec can't be because that is only run on the target
# machine and we haven't run it thereyet at this time.
#
# So we give people a config option to affect display of the args so
# that they can secure this if they feel that their stdout is insecure
# (shoulder surfing, logging stdout straight to a file, etc).
if not task.no_log and C.DISPLAY_ARGS_TO_STDOUT:
args = ', '.join(('%s=%s' % a for a in task.args.items()))
args = ' %s' % args
self._display.banner("TASK [%s%s]" % (task.get_name().strip(), args))
if self._display.verbosity > 2:
path = task.get_path()
if path: