packer-cn/website/pages/partials/provisioners/common-config.mdx

43 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-03-18 18:46:47 -04:00
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.
2020-03-18 18:46:47 -04:00
- `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 JSON:
2020-03-18 18:46:47 -04:00
```json
{
"type": "shell",
"script": "script.sh",
"override": {
"example_one": {
"script": "basic_one-script.sh"
2020-03-18 18:46:47 -04:00
}
}
}
```
In HCL2:
```hcl
build {
sources = ["docker.example_one", "docker.example_two"]
provisioner "shell" {
script = "script.sh"
override = {
example_one = {
script = "basic-one-script.sh"
}
}
}
}
```
2020-03-18 18:46:47 -04:00
- `timeout` (duration) - If the provisioner takes more than for example
`1h10m1s` or `10m` to finish, the provisioner will timeout and fail.