Commit 07eff4c0 authored by Chris Bednarski's avatar Chris Bednarski

Reformat docs

parent f5abdffa
--- ---
layout: "docs" description: |
page_title: "Local Shell Provisioner" The shell Packer provisioner provisions machines built by Packer using shell
description: |- scripts. Shell provisioning is the easiest way to get software installed and
The shell Packer provisioner provisions machines built by Packer using shell scripts. Shell provisioning is the easiest way to get software installed and configured on a machine. configured on a machine.
--- layout: docs
page_title: Local Shell Provisioner
...
# Local Shell Provisioner # Local Shell Provisioner
Type: `shell-local` Type: `shell-local`
The local shell provisioner executes a local shell script on the machine The local shell provisioner executes a local shell script on the machine running
running Packer. The [remote shell](/docs/provisioners/shell.html) Packer. The [remote shell](/docs/provisioners/shell.html) provisioner executes
provisioner executes shell scripts on a remote machine. shell scripts on a remote machine.
## Basic Example ## Basic Example
The example below is fully functional. The example below is fully functional.
```javascript ``` {.javascript}
{ {
"type": "shell-local", "type": "shell-local",
"command": "echo foo" "command": "echo foo"
...@@ -31,15 +33,14 @@ required element is "command". ...@@ -31,15 +33,14 @@ required element is "command".
Required: Required:
* `command` (string) - The command to execute. This will be executed - `command` (string) - The command to execute. This will be executed within
within the context of a shell as specified by `execute_command`. the context of a shell as specified by `execute_command`.
Optional parameters: Optional parameters:
* `execute_command` (array of strings) - The command to use to execute the script. - `execute_command` (array of strings) - The command to use to execute
By default this is `["/bin/sh", "-c", "{{.Command}"]`. The value is an array the script. By default this is `["/bin/sh", "-c", "{{.Command}"]`. The value
of arguments executed directly by the OS. is an array of arguments executed directly by the OS. The value of this is
The value of this is treated as [configuration
treated as [configuration template](/docs/templates/configuration-templates.html). template](/docs/templates/configuration-templates.html). The only available
The only available variable is `Command` which is the command to execute. variable is `Command` which is the command to execute.
--- ---
layout: "docs" description: |
page_title: "Windows Restart Provisioner" The Windows restart provisioner restarts a Windows machine and waits for it to
description: |- come back up.
The Windows restart provisioner restarts a Windows machine and waits for it to come back up. layout: docs
--- page_title: Windows Restart Provisioner
...
# Windows Restart Provisioner # Windows Restart Provisioner
Type: `windows-restart` Type: `windows-restart`
The Windows restart provisioner initiates a reboot on a Windows machine The Windows restart provisioner initiates a reboot on a Windows machine and
and waits for the machine to come back online. waits for the machine to come back online.
The Windows provisioning process often requires multiple reboots, and this The Windows provisioning process often requires multiple reboots, and this
provisioner helps to ease that process. provisioner helps to ease that process.
...@@ -19,7 +20,7 @@ provisioner helps to ease that process. ...@@ -19,7 +20,7 @@ provisioner helps to ease that process.
The example below is fully functional. The example below is fully functional.
```javascript ``` {.javascript}
{ {
"type": "windows-restart" "type": "windows-restart"
} }
...@@ -31,13 +32,13 @@ The reference of available configuration options is listed below. ...@@ -31,13 +32,13 @@ The reference of available configuration options is listed below.
Optional parameters: Optional parameters:
* `restart_command` (string) - The command to execute to initiate the - `restart_command` (string) - The command to execute to initiate the restart.
restart. By default this is `shutdown /r /c "packer restart" /t 5 && net stop winrm`. 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 A key action of this is to stop WinRM so that Packer can detect it
is rebooting. is rebooting.
* `restart_check_command` (string) - A command to execute to check if the - `restart_check_command` (string) - A command to execute to check if the
restart succeeded. This will be done in a loop. restart succeeded. This will be done in a loop.
* `restart_timeout` (string) - The timeout to wait for the restart. - `restart_timeout` (string) - The timeout to wait for the restart. By default
By default this is 5 minutes. Example value: "5m" this is 5 minutes. Example value: "5m"
--- ---
layout: "docs" description: |
page_title: "Windows Shell Provisioner" The windows-shell Packer provisioner runs commands on Windows using the cmd
description: |- shell.
The windows-shell Packer provisioner runs commands on Windows using the cmd shell. layout: docs
--- page_title: Windows Shell Provisioner
...
# Windows Shell Provisioner # Windows Shell Provisioner
Type: `windows-shell` Type: `windows-shell`
The windows-shell Packer provisioner runs commands on a Windows machine The windows-shell Packer provisioner runs commands on a Windows machine using
using `cmd`. It assumes it is running over WinRM. `cmd`. It assumes it is running over WinRM.
## Basic Example ## Basic Example
The example below is fully functional. The example below is fully functional.
```javascript ``` {.javascript}
{ {
"type": "windows-shell", "type": "windows-shell",
"inline": ["dir c:\\"] "inline": ["dir c:\\"]
...@@ -28,48 +29,47 @@ The example below is fully functional. ...@@ -28,48 +29,47 @@ The example below is fully functional.
The reference of available configuration options is listed below. The only The reference of available configuration options is listed below. The only
required element is either "inline" or "script". Every other option is optional. required element is either "inline" or "script". Every other option is optional.
Exactly _one_ of the following is required: Exactly *one* of the following is required:
* `inline` (array of strings) - This is an array of commands to execute. - `inline` (array of strings) - This is an array of commands to execute. The
The commands are concatenated by newlines and turned into a single file, commands are concatenated by newlines and turned into a single file, so they
so they are all executed within the same context. This allows you to are all executed within the same context. This allows you to change
change directories in one command and use something in the directory in directories in one command and use something in the directory in the next
the next and so on. Inline scripts are the easiest way to pull off simple and so on. Inline scripts are the easiest way to pull off simple tasks
tasks within the machine. within the machine.
* `script` (string) - The path to a script to upload and execute in the machine. - `script` (string) - The path to a script to upload and execute in
This path can be absolute or relative. If it is relative, it is relative the machine. This path can be absolute or relative. If it is relative, it is
to the working directory when Packer is executed. relative to the working directory when Packer is executed.
* `scripts` (array of strings) - An array of scripts to execute. The scripts - `scripts` (array of strings) - An array of scripts to execute. The scripts
will be uploaded and executed in the order specified. Each script is executed will be uploaded and executed in the order specified. Each script is
in isolation, so state such as variables from one script won't carry on to executed in isolation, so state such as variables from one script won't
the next. carry on to the next.
Optional parameters: Optional parameters:
* `binary` (boolean) - If true, specifies that the script(s) are binary - `binary` (boolean) - If true, specifies that the script(s) are binary files,
files, and Packer should therefore not convert Windows line endings to and Packer should therefore not convert Windows line endings to Unix line
Unix line endings (if there are any). By default this is false. endings (if there are any). By default this is false.
* `environment_vars` (array of strings) - An array of key/value pairs - `environment_vars` (array of strings) - An array of key/value pairs to
to inject prior to the execute_command. The format should be inject prior to the execute\_command. The format should be `key=value`.
`key=value`. Packer injects some environmental variables by default Packer injects some environmental variables by default into the environment,
into the environment, as well, which are covered in the section below. as well, which are covered in the section below.
* `execute_command` (string) - The command to use to execute the script. - `execute_command` (string) - The command to use to execute the script. By
By default this is `{{ .Vars }}"{{ .Path }}"`. The value of this is default this is `{{ .Vars }}"{{ .Path }}"`. The value of this is treated as
treated as [configuration template](/docs/templates/configuration-templates.html). [configuration template](/docs/templates/configuration-templates.html).
There are two available variables: `Path`, which is There are two available variables: `Path`, which is the path to the script
the path to the script to run, and `Vars`, which is the list of to run, and `Vars`, which is the list of `environment_vars`, if configured.
`environment_vars`, if configured.
- `remote_path` (string) - The path where the script will be uploaded to in
* `remote_path` (string) - The path where the script will be uploaded to the machine. This defaults to "/tmp/script.sh". This value must be a
in the machine. This defaults to "/tmp/script.sh". This value must be writable location and any parent directories must already exist.
a writable location and any parent directories must already exist.
- `start_retry_timeout` (string) - The amount of time to attempt to *start*
* `start_retry_timeout` (string) - The amount of time to attempt to the remote process. By default this is "5m" or 5 minutes. This setting
_start_ the remote process. By default this is "5m" or 5 minutes. This exists in order to deal with times when SSH may restart, such as a
setting exists in order to deal with times when SSH may restart, such as system reboot. Set this to a higher value if reboots take a longer amount
a system reboot. Set this to a higher value if reboots take a longer of time.
amount of time.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment