mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
add win_reboot action
also includes WinRM connection plugin change to support connection reset
This commit is contained in:
parent
040893a677
commit
336b1ae84b
2 changed files with 145 additions and 0 deletions
|
@ -213,6 +213,11 @@ class Connection(ConnectionBase):
|
|||
self._connected = True
|
||||
return self
|
||||
|
||||
def _reset(self): # used by win_reboot (and any other action that might need to bounce the state)
|
||||
self.protocol = None
|
||||
self.shell_id = None
|
||||
self._connect()
|
||||
|
||||
def exec_command(self, cmd, in_data=None, sudoable=True):
|
||||
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
|
||||
cmd_parts = shlex.split(to_bytes(cmd), posix=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue