From b52148d65da9d93c3442165c9bbfb343b2244df9 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Wed, 12 Sep 2018 21:17:24 -0400 Subject: [PATCH] [2.7] Exclude the whole ansible_failed_task block (#45587) It has lots of FieldAttributes that won't serialize. Also the connection doesn't care. (cherry picked from commit 3d0f19d) Co-authored-by: Nathaniel Case --- lib/ansible/executor/task_executor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 979bd472c9..86df0b57cd 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -843,7 +843,10 @@ class TaskExecutor: display.vvvv('attempting to start connection', host=self._play_context.remote_addr) display.vvvv('using connection plugin %s' % connection.transport, host=self._play_context.remote_addr) # We don't need to send the entire contents of variables to ansible-connection - filtered_vars = dict((key, value) for key, value in variables.items() if key.startswith('ansible')) + filtered_vars = dict( + (key, value) for key, value in variables.items() + if key.startswith('ansible') and key != 'ansible_failed_task' + ) socket_path = self._start_connection(filtered_vars) display.vvvv('local domain socket path is %s' % socket_path, host=self._play_context.remote_addr) setattr(connection, '_socket_path', socket_path)