From 44b3d67ef31b3c4c5d33c6f4289ce011e1bbe8fe Mon Sep 17 00:00:00 2001 From: Eugen C Date: Mon, 26 Jun 2017 23:01:06 +0300 Subject: [PATCH] Fix ansible ad-hoc to respect ANSIBLE_STDOUT_CALLBACK (#26098) * Fix ansible ad-hoc to respect ANSIBLE_STDOUT_CALLBACK * Ansible ad-hoc 'stdout_callback' should work only with 'bin_ansible_callbacks' (cherry picked from commit 6d5916074447ecb8d3ff0ca9139c6ffde77a9335) --- lib/ansible/cli/adhoc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/cli/adhoc.py b/lib/ansible/cli/adhoc.py index d5d9ed1b4dd..807afbe0f03 100644 --- a/lib/ansible/cli/adhoc.py +++ b/lib/ansible/cli/adhoc.py @@ -174,6 +174,9 @@ class AdHocCLI(CLI): cb = self.callback elif self.options.one_line: cb = 'oneline' + # Respect custom 'stdout_callback' only with enabled 'bin_ansible_callbacks' + elif C.DEFAULT_LOAD_CALLBACK_PLUGINS and C.DEFAULT_STDOUT_CALLBACK != 'default': + cb = C.DEFAULT_STDOUT_CALLBACK else: cb = 'minimal'