|
|
|
@ -25,13 +25,51 @@ scripts on a remote machine.
|
|
|
|
|
|
|
|
|
|
|
|
The example below is fully functional.
|
|
|
|
The example below is fully functional.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Tabs>
|
|
|
|
|
|
|
|
<Tab heading="JSON">
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"type": "shell-local",
|
|
|
|
"builders": [
|
|
|
|
"command": "echo foo"
|
|
|
|
{
|
|
|
|
|
|
|
|
"type": "file",
|
|
|
|
|
|
|
|
"name": "example",
|
|
|
|
|
|
|
|
"target": "./test_artifact.txt",
|
|
|
|
|
|
|
|
"content": "example content"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"provisioners": [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"type": "shell-local",
|
|
|
|
|
|
|
|
"inline": ["echo foo"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
source "file" "example" {
|
|
|
|
|
|
|
|
content = "example content"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build {
|
|
|
|
|
|
|
|
source "source.file.example" {
|
|
|
|
|
|
|
|
target = "./test_artifact.txt"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
provisioner "shell-local" {
|
|
|
|
|
|
|
|
inline = ["echo foo"]
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Configuration Reference
|
|
|
|
## Configuration Reference
|
|
|
|
|
|
|
|
|
|
|
|
The reference of available configuration options is listed below. The only
|
|
|
|
The reference of available configuration options is listed below. The only
|
|
|
|
@ -164,30 +202,66 @@ options instead.
|
|
|
|
Please note that the WSL is a beta feature, and this tool is not guaranteed to
|
|
|
|
Please note that the WSL is a beta feature, and this tool is not guaranteed to
|
|
|
|
work as you expect it to.
|
|
|
|
work as you expect it to.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Tabs>
|
|
|
|
|
|
|
|
<Tab heading="JSON">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"builders": [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"type": "null",
|
|
|
|
|
|
|
|
"communicator": "none"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"provisioners": [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"builders": [
|
|
|
|
"type": "shell-local",
|
|
|
|
{
|
|
|
|
"environment_vars": ["PROVISIONERTEST=ProvisionerTest1"],
|
|
|
|
"type": "null",
|
|
|
|
"execute_command": ["bash", "-c", "{{.Vars}} {{.Script}}"],
|
|
|
|
"communicator": "none"
|
|
|
|
"use_linux_pathing": true,
|
|
|
|
}
|
|
|
|
"scripts": ["C:/Users/me/scripts/example_bash.sh"]
|
|
|
|
],
|
|
|
|
},
|
|
|
|
"provisioners": [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"type": "shell-local",
|
|
|
|
"type": "shell-local",
|
|
|
|
"environment_vars": ["PROVISIONERTEST=ProvisionerTest2"],
|
|
|
|
"environment_vars": ["PROVISIONERTEST=ProvisionerTest1"],
|
|
|
|
"execute_command": ["bash", "-c", "{{.Vars}} {{.Script}}"],
|
|
|
|
"execute_command": ["bash", "-c", "{{.Vars}} {{.Script}}"],
|
|
|
|
"use_linux_pathing": true,
|
|
|
|
"use_linux_pathing": true,
|
|
|
|
"script": "C:/Users/me/scripts/example_bash.sh"
|
|
|
|
"scripts": ["C:/Users/me/scripts/example_bash.sh"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
]
|
|
|
|
{
|
|
|
|
}
|
|
|
|
"type": "shell-local",
|
|
|
|
```
|
|
|
|
"environment_vars": ["PROVISIONERTEST=ProvisionerTest2"],
|
|
|
|
|
|
|
|
"execute_command": ["bash", "-c", "{{.Vars}} {{.Script}}"],
|
|
|
|
</Tab>
|
|
|
|
"use_linux_pathing": true,
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
"script": "C:/Users/me/scripts/example_bash.sh"
|
|
|
|
|
|
|
|
}
|
|
|
|
```hcl
|
|
|
|
]
|
|
|
|
source "null" "example" {
|
|
|
|
|
|
|
|
communicator = "none"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build {
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
|
|
|
|
"source.null.example"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
provisioner "shell-local"{
|
|
|
|
|
|
|
|
environment_vars = ["PROVISIONERTEST=ProvisionerTest1"]
|
|
|
|
|
|
|
|
execute_command = ["bash", "-c", "{{.Vars}} {{.Script}}"]
|
|
|
|
|
|
|
|
use_linux_pathing = true
|
|
|
|
|
|
|
|
scripts = ["C:/Users/me/scripts/example_bash.sh"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
provisioner "shell-local"{
|
|
|
|
|
|
|
|
environment_vars = ["PROVISIONERTEST=ProvisionerTest2"]
|
|
|
|
|
|
|
|
execute_command = ["bash", "-c", "{{.Vars}} {{.Script}}"]
|
|
|
|
|
|
|
|
use_linux_pathing = true
|
|
|
|
|
|
|
|
script = "C:/Users/me/scripts/example_bash.sh"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
## Default Environmental Variables
|
|
|
|
## Default Environmental Variables
|
|
|
|
|
|
|
|
|
|
|
|
@ -234,15 +308,36 @@ _must_ be extra careful to `exit 0` when necessary.
|
|
|
|
|
|
|
|
|
|
|
|
## Usage Examples:
|
|
|
|
## Usage Examples:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Windows Host
|
|
|
|
### Windows Host
|
|
|
|
|
|
|
|
|
|
|
|
Example of running a .cmd file on windows:
|
|
|
|
Example of running a .cmd file on windows:
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
<Tabs>
|
|
|
|
"type": "shell-local",
|
|
|
|
<Tab heading="JSON">
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest1"],
|
|
|
|
|
|
|
|
"scripts": ["./scripts/test_cmd.cmd"]
|
|
|
|
```json
|
|
|
|
}
|
|
|
|
{
|
|
|
|
|
|
|
|
"type": "shell-local",
|
|
|
|
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest1"],
|
|
|
|
|
|
|
|
"scripts": ["./scripts/test_cmd.cmd"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
provisioner "shell-local" {
|
|
|
|
|
|
|
|
environment_vars = ["SHELLLOCALTEST=ShellTest1"]
|
|
|
|
|
|
|
|
scripts = ["./scripts/test_cmd.cmd"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Contents of "test_cmd.cmd":
|
|
|
|
Contents of "test_cmd.cmd":
|
|
|
|
|
|
|
|
|
|
|
|
@ -251,23 +346,63 @@ Contents of "test_cmd.cmd":
|
|
|
|
Example of running an inline command on windows: Required customization:
|
|
|
|
Example of running an inline command on windows: Required customization:
|
|
|
|
tempfile_extension
|
|
|
|
tempfile_extension
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"type": "shell-local",
|
|
|
|
<Tabs>
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest2"],
|
|
|
|
<Tab heading="JSON">
|
|
|
|
"tempfile_extension": ".cmd",
|
|
|
|
|
|
|
|
"inline": ["echo %SHELLLOCALTEST%"]
|
|
|
|
```json
|
|
|
|
}
|
|
|
|
{
|
|
|
|
|
|
|
|
"type": "shell-local",
|
|
|
|
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest2"],
|
|
|
|
|
|
|
|
"tempfile_extension": ".cmd",
|
|
|
|
|
|
|
|
"inline": ["echo %SHELLLOCALTEST%"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
provisioner "shell-local" {
|
|
|
|
|
|
|
|
environment_vars = ["SHELLLOCALTEST=ShellTest2"],
|
|
|
|
|
|
|
|
tempfile_extension = ".cmd",
|
|
|
|
|
|
|
|
inline = [echo %SHELLLOCALTEST%"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
Example of running a bash command on windows using WSL: Required
|
|
|
|
Example of running a bash command on windows using WSL: Required
|
|
|
|
customizations: use_linux_pathing and execute_command
|
|
|
|
customizations: use_linux_pathing and execute_command
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
<Tabs>
|
|
|
|
"type": "shell-local",
|
|
|
|
<Tab heading="JSON">
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest3"],
|
|
|
|
|
|
|
|
"execute_command": ["bash", "-c", "{{.Vars}} {{.Script}}"],
|
|
|
|
```json
|
|
|
|
"use_linux_pathing": true,
|
|
|
|
{
|
|
|
|
"script": "./scripts/example_bash.sh"
|
|
|
|
"type": "shell-local",
|
|
|
|
}
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest3"],
|
|
|
|
|
|
|
|
"execute_command": ["bash", "-c", "{{.Vars}} {{.Script}}"],
|
|
|
|
|
|
|
|
"use_linux_pathing": true,
|
|
|
|
|
|
|
|
"script": "./scripts/example_bash.sh"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
provisioner "shell-local" {
|
|
|
|
|
|
|
|
environment_vars = ["SHELLLOCALTEST=ShellTest3"],
|
|
|
|
|
|
|
|
execute_command = ["bash", "-c", "{{.Vars}} {{.Script}}"]
|
|
|
|
|
|
|
|
use_linux_pathing = true
|
|
|
|
|
|
|
|
script = "./scripts/example_bash.sh"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
Contents of "example_bash.sh":
|
|
|
|
Contents of "example_bash.sh":
|
|
|
|
|
|
|
|
|
|
|
|
@ -277,53 +412,158 @@ Contents of "example_bash.sh":
|
|
|
|
Example of running a powershell script on windows: Required customizations:
|
|
|
|
Example of running a powershell script on windows: Required customizations:
|
|
|
|
env_var_format and execute_command
|
|
|
|
env_var_format and execute_command
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
<Tabs>
|
|
|
|
"type": "shell-local",
|
|
|
|
<Tab heading="JSON">
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest4"],
|
|
|
|
|
|
|
|
"execute_command": ["powershell.exe", "{{.Vars}} {{.Script}}"],
|
|
|
|
```json
|
|
|
|
"env_var_format": "$env:%s=\"%s\"; ",
|
|
|
|
{
|
|
|
|
"script": "./scripts/example_ps.ps1"
|
|
|
|
"type": "shell-local",
|
|
|
|
}
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest4"],
|
|
|
|
|
|
|
|
"execute_command": ["powershell.exe", "{{.Vars}} {{.Script}}"],
|
|
|
|
|
|
|
|
"env_var_format": "$env:%s=\"%s\"; ",
|
|
|
|
|
|
|
|
"script": "./scripts/example_ps.ps1"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
provisioner "shell-local" {
|
|
|
|
|
|
|
|
environment_vars = ["SHELLLOCALTEST=ShellTest4"]
|
|
|
|
|
|
|
|
execute_command = ["powershell.exe", "{{.Vars}} {{.Script}}"]
|
|
|
|
|
|
|
|
env_var_format = "$env:%s=\"%s\"; "
|
|
|
|
|
|
|
|
script = "./scripts/example_ps.ps1"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
Example of running a powershell script on windows as "inline": Required
|
|
|
|
Example of running a powershell script on windows as "inline": Required
|
|
|
|
customizations: env_var_format, tempfile_extension, and execute_command
|
|
|
|
customizations: env_var_format, tempfile_extension, and execute_command
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
<Tabs>
|
|
|
|
"type": "shell-local",
|
|
|
|
<Tab heading="JSON">
|
|
|
|
"tempfile_extension": ".ps1",
|
|
|
|
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest5"],
|
|
|
|
```json
|
|
|
|
"execute_command": ["powershell.exe", "{{.Vars}} {{.Script}}"],
|
|
|
|
{
|
|
|
|
"env_var_format": "$env:%s=\"%s\"; ",
|
|
|
|
"type": "shell-local",
|
|
|
|
"inline": ["write-output $env:SHELLLOCALTEST"]
|
|
|
|
"tempfile_extension": ".ps1",
|
|
|
|
}
|
|
|
|
"environment_vars": ["SHELLLOCALTEST=ShellTest5"],
|
|
|
|
|
|
|
|
"execute_command": ["powershell.exe", "{{.Vars}} {{.Script}}"],
|
|
|
|
|
|
|
|
"env_var_format": "$env:%s=\"%s\"; ",
|
|
|
|
|
|
|
|
"inline": ["write-output $env:SHELLLOCALTEST"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
provisioner "shell-local" {
|
|
|
|
|
|
|
|
tempfile_extension = ".ps1"
|
|
|
|
|
|
|
|
environment_vars = ["SHELLLOCALTEST=ShellTest5"]
|
|
|
|
|
|
|
|
execute_command = ["powershell.exe", "{{.Vars}} {{.Script}}"]
|
|
|
|
|
|
|
|
env_var_format = "$env:%s=\"%s\"; "
|
|
|
|
|
|
|
|
inline = ["write-output $env:SHELLLOCALTEST"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
### Unix Host
|
|
|
|
### Unix Host
|
|
|
|
|
|
|
|
|
|
|
|
Example of running a bash script on unix:
|
|
|
|
Example of running a bash script on unix:
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
<Tabs>
|
|
|
|
"type": "shell-local",
|
|
|
|
<Tab heading="JSON">
|
|
|
|
"environment_vars": ["PROVISIONERTEST=ProvisionerTest1"],
|
|
|
|
|
|
|
|
"scripts": ["./scripts/example_bash.sh"]
|
|
|
|
```json
|
|
|
|
}
|
|
|
|
{
|
|
|
|
|
|
|
|
"type": "shell-local",
|
|
|
|
|
|
|
|
"environment_vars": ["PROVISIONERTEST=ProvisionerTest1"],
|
|
|
|
|
|
|
|
"scripts": ["./scripts/example_bash.sh"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
provisioner "shell-local" {
|
|
|
|
|
|
|
|
environment_vars = ["PROVISIONERTEST=ProvisionerTest1"]
|
|
|
|
|
|
|
|
scripts = ["./scripts/example_bash.sh"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
Example of running a bash "inline" on unix:
|
|
|
|
Example of running a bash "inline" on unix:
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
<Tabs>
|
|
|
|
"type": "shell-local",
|
|
|
|
<Tab heading="JSON">
|
|
|
|
"environment_vars": ["PROVISIONERTEST=ProvisionerTest2"],
|
|
|
|
|
|
|
|
"inline": ["echo hello",
|
|
|
|
```json
|
|
|
|
"echo $PROVISIONERTEST"]
|
|
|
|
{
|
|
|
|
}
|
|
|
|
"type": "shell-local",
|
|
|
|
|
|
|
|
"environment_vars": ["PROVISIONERTEST=ProvisionerTest2"],
|
|
|
|
|
|
|
|
"inline": ["echo hello", "echo $PROVISIONERTEST"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
provisioner "shell-local" {
|
|
|
|
|
|
|
|
environment_vars = ["PROVISIONERTEST=ProvisionerTest2"]
|
|
|
|
|
|
|
|
inline = ["echo hello", "echo $PROVISIONERTEST"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
Example of running a python script on unix:
|
|
|
|
Example of running a python script on unix:
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
<Tabs>
|
|
|
|
"type": "shell-local",
|
|
|
|
<Tab heading="JSON">
|
|
|
|
"script": "hello.py",
|
|
|
|
|
|
|
|
"environment_vars": ["HELLO_USER=packeruser"],
|
|
|
|
```json
|
|
|
|
"execute_command": ["/bin/sh", "-c", "{{.Vars}} /usr/local/bin/python {{.Script}}"]
|
|
|
|
{
|
|
|
|
}
|
|
|
|
"type": "shell-local",
|
|
|
|
|
|
|
|
"script": "hello.py",
|
|
|
|
|
|
|
|
"environment_vars": ["HELLO_USER=packeruser"],
|
|
|
|
|
|
|
|
"execute_command": [
|
|
|
|
|
|
|
|
"/bin/sh",
|
|
|
|
|
|
|
|
"-c",
|
|
|
|
|
|
|
|
"{{.Vars}} /usr/local/bin/python {{.Script}}"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
provisioner "shell-local" {
|
|
|
|
|
|
|
|
script = "hello.py"
|
|
|
|
|
|
|
|
environment_vars = ["HELLO_USER=packeruser"]
|
|
|
|
|
|
|
|
execute_command = [
|
|
|
|
|
|
|
|
"/bin/sh",
|
|
|
|
|
|
|
|
"-c",
|
|
|
|
|
|
|
|
"{{.Vars}} /usr/local/bin/python {{.Script}}"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
Where "hello.py" contains:
|
|
|
|
Where "hello.py" contains:
|
|
|
|
|
|
|
|
|
|
|
|
|