diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go index f07c91936..212ec2abf 100644 --- a/provisioner/shell/provisioner.go +++ b/provisioner/shell/provisioner.go @@ -94,7 +94,7 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { } if p.config.InlineShebang == "" { - p.config.InlineShebang = "/bin/sh" + p.config.InlineShebang = "/bin/sh -e" } if p.config.RawStartRetryTimeout == "" { diff --git a/website/source/docs/provisioners/shell.html.markdown b/website/source/docs/provisioners/shell.html.markdown index 7fcbe885b..e57910cb0 100644 --- a/website/source/docs/provisioners/shell.html.markdown +++ b/website/source/docs/provisioners/shell.html.markdown @@ -66,8 +66,10 @@ Optional parameters: * `inline_shebang` (string) - The [shebang](http://en.wikipedia.org/wiki/Shebang_%28Unix%29) value to use when - running commands specified by `inline`. By default, this is `/bin/sh`. + running commands specified by `inline`. By default, this is `/bin/sh -e`. If you're not using `inline`, then this configuration has no effect. + **Important:** If you customize this, be sure to include something like + the `-e` flag, otherwise individual steps failing won't fail the provisioner. * `remote_path` (string) - The path where the script will be uploaded to in the machine. This defaults to "/tmp/script.sh". This value must be