Browse code

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)

Eugen C authored on 2017/06/27 05:01:06
Showing 1 changed files
... ...
@@ -174,6 +174,9 @@ class AdHocCLI(CLI):
174 174
             cb = self.callback
175 175
         elif self.options.one_line:
176 176
             cb = 'oneline'
177
+        # Respect custom 'stdout_callback' only with enabled 'bin_ansible_callbacks'
178
+        elif C.DEFAULT_LOAD_CALLBACK_PLUGINS and C.DEFAULT_STDOUT_CALLBACK != 'default':
179
+            cb = C.DEFAULT_STDOUT_CALLBACK
177 180
         else:
178 181
             cb = 'minimal'
179 182