Merge pull request #9824 from hashicorp/d-windows-restart-hcl2-example

provisioner/windows-restart: Add HCL2 example to documentation
This commit is contained in:
Megan Marsh 2020-08-25 16:35:36 -07:00 committed by GitHub
commit b90957d11c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 0 deletions

View File

@ -26,12 +26,25 @@ so Windows must be completely booted in order to continue.
The example below is fully functional.
<Tabs>
<Tab heading="JSON">
```json
{
"type": "windows-restart"
}
```
</Tab>
<Tab heading="HCL2">
```hcl
provisioner "windows-restart" {}
```
</Tab>
</Tabs>
## Configuration Reference
The reference of available configuration options is listed below.
@ -64,6 +77,9 @@ Optional parameters:
- `restart_check_command` (string) - A command to execute to check if the
restart succeeded. This will be done in a loop. Example usage:
<Tabs>
<Tab heading="JSON">
```json
{
"type": "windows-restart",
@ -71,6 +87,18 @@ Optional parameters:
}
```
</Tab>
<Tab heading="HCL2">
```hcl
provisioner "windows-restart" {
restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
}
```
</Tab>
</Tabs>
- `restart_timeout` (string) - The timeout to wait for the restart. By
default this is 5 minutes. Example value: `5m`. If you are installing
updates or have a lot of startup services, you will probably need to