-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add win_reboot action #15314
add win_reboot action #15314
Conversation
@trondhindenes @jhawkesworth as promised - review/feedback appreciated! |
if task_vars is None: | ||
task_vars = dict() | ||
|
||
# TODO: allow override via task args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you have already done this TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, oh yeah- I should probably remove the TODOs as I do them...
@nitzmahone from __future__ import (absolute_import, division, print_function)
__metaclass__ = type |
I have a kind of weird edge case that I'm not sure is worth addressing. Running Virtualbox try:
if not skip_reboot_check:
self.do_until_success_or_timeout(raise_if_port_open, shutdown_timeout_sec, what_desc="winrm port down")
else: time.sleep(pre_reboot_delay_sec+5)
def connect_winrm_port():
sock = socket.create_connection((winrm_host, winrm_port), connect_timeout_sec)
sock.close() |
also includes WinRM connection plugin change to support connection reset
@msheiny - one of the methods that I've considered for this (reflected in one of the FUTURE comments in the code) would probably address your situation nicely: sample the last boot time, then poll for it to change, ignoring failures, for up to |
Just to say I have run this successfully against a Server 2012 R2 test vm. |
May re-address later, but there are a couple of issues with switching to the high-level-only reboot, and I'd rather get it out there for the masses... |
Thanks for merging (I've started using this a bit already)! |
ISSUE TYPE
ANSIBLE VERSION
SUMMARY
Adds win_reboot action to wrap the several necessary tasks to reboot a windows box and wait for it to come back up into a single task.
Docs are at ansible/ansible-modules-core#3376