Log Ansible Error Lines Completely

We truncate ansible log lines to 1024 chars. This can be troublesome
when dealing with Ansible errors containing tracebacks, which can
exceed this limit.
To make tracing errors more straight-forward, don't truncate lines that
indicate an Ansible error.

Change-Id: Ide8e0f2d960226cccef725047e509bd98f019d5b
This commit is contained in:
Benjamin Schanzel 2021-05-11 16:34:46 +02:00
parent fd028206de
commit 7b2e7a71d5
1 changed files with 4 additions and 1 deletions

View File

@ -2389,7 +2389,10 @@ class AnsibleJob(object):
idx += 1
if idx < BUFFER_LINES_FOR_SYNTAX:
syntax_buffer.append(line)
line = line[:1024].rstrip()
if not line.startswith(b'fatal'):
line = line[:1024].rstrip()
ansible_log.debug("Ansible output: %s" % (line,))
self.log.debug("Ansible output terminated")
try: