Skip to content

Commit 05da6fa

Browse files
authored
import provisioner partials from Packer core (#77)
* import provisioner partials from Packer core * Delete community_provisioners.mdx
1 parent 3141308 commit 05da6fa

3 files changed

Lines changed: 99 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Parameters common to all provisioners:
2+
3+
- `pause_before` (duration) - Sleep for duration before execution.
4+
5+
- `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.
6+
7+
- `only` (array of string) - Only run the provisioner for listed builder(s)
8+
by name.
9+
10+
- `override` (object) - Override the builder with different settings for a
11+
specific builder, eg :
12+
13+
In HCL2:
14+
15+
```hcl
16+
source "null" "example1" {
17+
communicator = "none"
18+
}
19+
20+
source "null" "example2" {
21+
communicator = "none"
22+
}
23+
24+
build {
25+
sources = ["source.null.example1", "source.null.example2"]
26+
provisioner "shell-local" {
27+
inline = ["echo not overridden"]
28+
override = {
29+
example1 = {
30+
inline = ["echo yes overridden"]
31+
}
32+
}
33+
}
34+
}
35+
```
36+
37+
In JSON:
38+
39+
```json
40+
{
41+
"builders": [
42+
{
43+
"type": "null",
44+
"name": "example1",
45+
"communicator": "none"
46+
},
47+
{
48+
"type": "null",
49+
"name": "example2",
50+
"communicator": "none"
51+
}
52+
],
53+
"provisioners": [
54+
{
55+
"type": "shell-local",
56+
"inline": ["echo not overridden"],
57+
"override": {
58+
"example1": {
59+
"inline": ["echo yes overridden"]
60+
}
61+
}
62+
}
63+
]
64+
}
65+
```
66+
67+
- `timeout` (duration) - If the provisioner takes more than for example
68+
`1h10m1s` or `10m` to finish, the provisioner will timeout and fail.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
The reference of available configuration options is listed below. The only
2+
required element is either "inline" or "script". Every other option is
3+
optional.
4+
5+
Exactly _one_ of the following is required:
6+
7+
- `inline` (array of strings) - This is an array of commands to execute. The
8+
commands are concatenated by newlines and turned into a single file, so
9+
they are all executed within the same context. This allows you to change
10+
directories in one command and use something in the directory in the next
11+
and so on. Inline scripts are the easiest way to pull off simple tasks
12+
within the machine.
13+
14+
- `script` (string) - The path to a script to upload and execute in the
15+
machine. This path can be absolute or relative. If it is relative, it is
16+
relative to the working directory when Packer is executed.
17+
18+
- `scripts` (array of strings) - An array of scripts to execute. The scripts
19+
will be uploaded and executed in the order specified. Each script is
20+
executed in isolation, so state such as variables from one script won't
21+
carry on to the next.
22+
23+
Optional parameters:
24+
25+
- `binary` (boolean) - If true, specifies that the script(s) are binary
26+
files, and Packer should therefore not convert Windows line endings to Unix
27+
line endings (if there are any). By default this is false.
28+
29+
- `valid_exit_codes` (list of ints) - Valid exit codes for the script. By
30+
default this is just 0.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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 commit comments

Comments
 (0)