packer-cn/website/source/docs/provisioners/windows-restart.html.md

45 lines
1.2 KiB
Markdown
Raw Normal View History

2015-06-14 14:17:50 -04:00
---
2015-08-03 14:32:54 -04:00
description: |
The Windows restart provisioner restarts a Windows machine and waits for it to
come back up.
layout: docs
page_title: Windows Restart Provisioner
...
2015-06-14 14:17:50 -04:00
# Windows Restart Provisioner
Type: `windows-restart`
2015-08-03 14:32:54 -04:00
The Windows restart provisioner initiates a reboot on a Windows machine and
waits for the machine to come back online.
2015-06-14 14:17:50 -04:00
The Windows provisioning process often requires multiple reboots, and this
provisioner helps to ease that process.
## Basic Example
The example below is fully functional.
2015-08-03 14:32:54 -04:00
``` {.javascript}
2015-06-14 14:17:50 -04:00
{
"type": "windows-restart"
}
```
## Configuration Reference
The reference of available configuration options is listed below.
Optional parameters:
2015-08-03 14:32:54 -04:00
- `restart_command` (string) - The command to execute to initiate the restart.
By default this is `shutdown /r /c "packer restart" /t 5 && net stop winrm`.
A key action of this is to stop WinRM so that Packer can detect it
is rebooting.
2015-06-14 14:17:50 -04:00
2015-08-03 14:32:54 -04:00
- `restart_check_command` (string) - A command to execute to check if the
restart succeeded. This will be done in a loop.
2015-06-14 14:17:50 -04:00
2015-08-03 14:32:54 -04:00
- `restart_timeout` (string) - The timeout to wait for the restart. By default
this is 5 minutes. Example value: "5m"