Revert "Clear 'connection related' plugin vars for next loop iteration (#59024)"

This reverts commit 5e7e9b57c0.

This causes a new set of regressions from 2.8.2:
https://github.com/ansible/ansible/pull/59284#issuecomment-514021543

So this issue won't be fixed in 2.8.3 but work towards a fix for 2.8.4
will continue.
This commit is contained in:
Toshio Kuratomi 2019-07-22 18:54:45 -07:00
parent 37f8684330
commit a0688027a5
2 changed files with 0 additions and 16 deletions

View file

@ -1,2 +0,0 @@
bugfixes:
- Do not re-use remote_user from previous loop iteration (https://github.com/ansible/ansible/issues/58876)

View file

@ -410,20 +410,6 @@ class TaskExecutor:
results.append(res)
del task_vars[loop_var]
# clear 'connection related' plugin variables for next iteration
if self._connection:
clear_plugins = {
'connection': self._connection._load_name,
'shell': self._connection._shell._load_name
}
if self._connection.become:
clear_plugins['become'] = self._connection.become._load_name
for plugin_type, plugin_name in iteritems(clear_plugins):
for var in C.config.get_plugin_vars(plugin_type, plugin_name):
if var in task_vars:
del task_vars[var]
self._task.no_log = no_log
return results