Fix ansible console to respect ANSIBLE_STDOUT_CALLBACK (#77182)

* Fix ansible console to respect ANSIBLE_STDOUT_CALLBACK

This makes the ansible-console able to customize the stdout callback.
Ansible console currently uses statically minimal callback.

* Add changelog

* Move the fragment changelog in the right directory
pull/77180/head
Pierre Blanc 3 years ago committed by GitHub
parent 871b2ca73a
commit ea66cf189b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
minor_changes:
- ansible-console - Provide a way to customize the stdout callback

@ -205,6 +205,13 @@ class ConsoleCLI(CLI, cmd.Cmd):
module = 'shell'
module_args = arg
if self.callback:
cb = self.callback
elif C.DEFAULT_LOAD_CALLBACK_PLUGINS and C.DEFAULT_STDOUT_CALLBACK != 'default':
cb = C.DEFAULT_STDOUT_CALLBACK
else:
cb = 'minimal'
result = None
try:
check_raw = module in C._ACTION_ALLOWS_RAW_ARGS
@ -227,7 +234,6 @@ class ConsoleCLI(CLI, cmd.Cmd):
return False
try:
cb = 'minimal' # FIXME: make callbacks configurable
# now create a task queue manager to execute the play
self._tqm = None
try:

Loading…
Cancel
Save