Skip to content

Commit 506c60f

Browse files
committed
pkg/ansible/runner: logs the stdout and stderr from ansible-runner if the command exits non-zero
This is helpful in a case where ansible-runner itself is broken, such as when a python library it depends on gets installed at an incompatible version (a problem we've encountered multile times).
1 parent 8eb2edb commit 506c60f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/ansible/runner/runner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ func (r *runner) Run(ident string, u *unstructured.Unstructured, kubeconfig stri
245245
dc = r.cmdFunc(ident, inputDir.Path)
246246
}
247247

248-
err := dc.Run()
248+
output, err := dc.CombinedOutput()
249249
if err != nil {
250-
logger.Error(err, "error from ansible-runner")
250+
logger.Error(err, string(output))
251251
} else {
252252
logger.Info("ansible-runner exited successfully")
253253
}

0 commit comments

Comments
 (0)