From 2683c36a01adca343ce307aae18ee01bc9e54baf Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Wed, 28 Jun 2017 21:55:39 +0200 Subject: [PATCH] plugins,action: log stderr output if verbose (#25734) otherwise ansible eats out important error messages Signed-off-by: Tomas Tomecek --- lib/ansible/plugins/action/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index e3448bf74dc..c2aff519deb 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -270,7 +270,9 @@ class ActionBase(with_metaclass(ABCMeta, object)): 'Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". ' 'Failed command was: %s, exited with result %d' % (cmd, result['rc'])) if 'stdout' in result and result['stdout'] != u'': - output = output + u": %s" % result['stdout'] + output = output + u", stdout output: %s" % result['stdout'] + if self._play_context.verbosity > 3 and 'stderr' in result and result['stderr'] != u'': + output += u", stderr output: %s" % result['stderr'] raise AnsibleConnectionFailure(output) else: self._cleanup_remote_tmp = True