the return of reset_connection

allows user to force persistent connection to close, needed for when
you want to benefit from changes applied to the current play but persistent connections
prevent them from being realized.
This commit is contained in:
Brian Coca 2017-02-15 16:02:54 -05:00 committed by Brian Coca
parent 36aad569d2
commit cc0bb54d2c
3 changed files with 26 additions and 22 deletions

View file

@ -902,8 +902,10 @@ class StrategyBase:
if not host.name in self._tqm._unreachable_hosts:
iterator._host_states[host.name].run_state = iterator.ITERATING_COMPLETE
msg="ending play"
#elif meta_action == 'reset_connection':
# connection_info.connection.close()
elif meta_action == 'reset_connection':
connection = connection_loader.get(play_context.connection, play_context, '/dev/null')
connection.reset()
msg= 'reset connection'
else:
raise AnsibleError("invalid meta action requested: %s" % meta_action, obj=task._ds)