You can also use python in your execute_command; the example below works on my mac; python is in my path and the script "hello.py" is in my working directory
{
"builders": [
{
"type": "null",
"communicator": "none"
}
],
"provisioners": [
{
"type": "shell-local",
"script": "hello.py",
"execute_command": ["python", "{{.Script}}"]
}
]
}
Here's the command and output from the above example:
$ packer build shell_local_python.json
null output will be in this color.
==> null: Running local shell script: hello.py
null: Hello, world!
Build 'null' finished.
==> Builds finished. The artifacts of successful builds are:
--> null: Did not export anything. This is the null builder