Skip to content

Commit

Permalink
import provisioner partials from Packer core (#77)
Browse files Browse the repository at this point in the history
* import provisioner partials from Packer core

* Delete community_provisioners.mdx
  • Loading branch information
azr authored Aug 31, 2021
1 parent 3141308 commit 05da6fa
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Parameters common to all provisioners:

- `pause_before` (duration) - Sleep for duration before execution.

- `max_retries` (int) - Max times the provisioner will retry in case of failure. Defaults to zero (0). Zero means an error will not be retried.

- `only` (array of string) - Only run the provisioner for listed builder(s)
by name.

- `override` (object) - Override the builder with different settings for a
specific builder, eg :

In HCL2:

```hcl
source "null" "example1" {
communicator = "none"
}
source "null" "example2" {
communicator = "none"
}
build {
sources = ["source.null.example1", "source.null.example2"]
provisioner "shell-local" {
inline = ["echo not overridden"]
override = {
example1 = {
inline = ["echo yes overridden"]
}
}
}
}
```

In JSON:

```json
{
"builders": [
{
"type": "null",
"name": "example1",
"communicator": "none"
},
{
"type": "null",
"name": "example2",
"communicator": "none"
}
],
"provisioners": [
{
"type": "shell-local",
"inline": ["echo not overridden"],
"override": {
"example1": {
"inline": ["echo yes overridden"]
}
}
}
]
}
```

- `timeout` (duration) - If the provisioner takes more than for example
`1h10m1s` or `10m` to finish, the provisioner will timeout and fail.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
The reference of available configuration options is listed below. The only
required element is either "inline" or "script". Every other option is
optional.

Exactly _one_ of the following is required:

- `inline` (array of strings) - This is an array of commands to execute. The
commands are concatenated by newlines and turned into a single file, so
they are all executed within the same context. This allows you to change
directories in one command and use something in the directory in the next
and so on. Inline scripts are the easiest way to pull off simple tasks
within the machine.

- `script` (string) - The path to a script to upload and execute in the
machine. This path can be absolute or relative. If it is relative, it is
relative to the working directory when Packer is executed.

- `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 in isolation, so state such as variables from one script won't
carry on to the next.

Optional parameters:

- `binary` (boolean) - If true, specifies that the script(s) are binary
files, and Packer should therefore not convert Windows line endings to Unix
line endings (if there are any). By default this is false.

- `valid_exit_codes` (list of ints) - Valid exit codes for the script. By
default this is just 0.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
~> **This community maintained provisioner is currently unmaintained**; if you are interested in contributing or taking ownership of it, please reach out to us at [packer@hashicorp.com](mailto://packer@hashicorp.com). More details can be found in the [README](https://github.com/hashicorp/packer/blob/master/README.md#unmaintained-plugins).

0 comments on commit 05da6fa

Please sign in to comment.