diff --git a/provisioner/salt-masterless/provisioner.go b/provisioner/salt-masterless/provisioner.go index 80001e8d0..646a07c26 100644 --- a/provisioner/salt-masterless/provisioner.go +++ b/provisioner/salt-masterless/provisioner.go @@ -68,13 +68,12 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { } } - if p.config.LocalStateTree == "" { - errs = packer.MultiErrorAppend(errs, - errors.New("Please specify a local_state_tree")) - } else if _, err := os.Stat(p.config.LocalStateTree); err != nil { - errs = packer.MultiErrorAppend(errs, - errors.New("local_state_tree must exist and be accessible")) - } + if p.config.LocalStateTree != "" { + if _, err := os.Stat(p.config.LocalStateTree); err != nil { + errs = packer.MultiErrorAppend(errs, + errors.New("local_state_tree must exist and be accessible")) + } + } if errs != nil && len(errs.Errors) > 0 { return errs diff --git a/website/source/docs/provisioners/salt-masterless.html.markdown b/website/source/docs/provisioners/salt-masterless.html.markdown index 0ed1ea51e..84e6f09ec 100644 --- a/website/source/docs/provisioners/salt-masterless.html.markdown +++ b/website/source/docs/provisioners/salt-masterless.html.markdown @@ -6,7 +6,8 @@ layout: "docs" Type: `salt-masterless` -The salt-masterless provisioner provisions machines built by Packer using [Salt](http://saltstack.com/) states. +The `salt-masterless` provisioner provisions machines built by Packer using +[Salt](http://saltstack.com/) states, without connecting to a Salt master. ## Basic Example @@ -15,7 +16,6 @@ The example below is fully functional.
 {
     "type": "salt-masterless",
-    "bootstrap_args": "git v0.16.0"
     "local_state_tree": "/Users/me/salt"
 }
 
@@ -24,15 +24,21 @@ The example below is fully functional. The reference of available configuration options is listed below. The only required argument is the path to your local salt state tree. -Required: - -* `local_state_tree` (string) - The path to your local [state tree](http://docs.saltstack.com/ref/states/highstate.html#the-salt-state-tree). This will be uploaded to the `/srv/salt` on the remote, and removed before shutdown. - Optional: -* `skip_bootstrap` (boolean) - By default the salt provisioner runs [salt bootstrap](https://github.com/saltstack/salt-bootstrap) to install salt. Set this to true to skip this step. +* `local_state_tree` (string) - The path to your local + [state tree](http://docs.saltstack.com/ref/states/highstate.html#the-salt-state-tree). + This will be uploaded to the `/srv/salt` on the remote. + +* `skip_bootstrap` (boolean) - By default the salt provisioner runs + [salt bootstrap](https://github.com/saltstack/salt-bootstrap) to install + salt. Set this to true to skip this step. -* `boostrap_args` (string) - - Arguments to send to the bootstrap script. Usage is somewhat documented on [github](https://github.com/saltstack/salt-bootstrap), but the [script itself](https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh) has more detailed usage instructions. By default, no arguments are sent to the script. +* `boostrap_args` (string) - Arguments to send to the bootstrap script. Usage + is somewhat documented on [github](https://github.com/saltstack/salt-bootstrap), + but the [script itself](https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh) + has more detailed usage instructions. By default, no arguments are sent to + the script. -* `temp_config_dir` (string) - Where your local state tree will be copied before moving to the `/srv/salt` directory. Default is `/tmp/salt`. +* `temp_config_dir` (string) - Where your local state tree will be copied + before moving to the `/srv/salt` directory. Default is `/tmp/salt`. diff --git a/website/source/docs/provisioners/salt.html.markdown b/website/source/docs/provisioners/salt.html.markdown deleted file mode 100644 index 16689a426..000000000 --- a/website/source/docs/provisioners/salt.html.markdown +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: "docs" ---- - -# Salt Masterless Provisioner - -Type: `salt-masterless` - -The `salt-masterless` provisioner provisions machines built by Packer using -[Salt](http://saltstack.com/) states, without connecting to a Salt master. - -## Basic Example - -The example below is fully functional. - -
-{
-    "type": "salt-masterless",
-    "local_state_tree": "/Users/me/salt"
-}
-
- -## Configuration Reference - -The reference of available configuration options is listed below. The only required argument is the path to your local salt state tree. - -Required: - -* `local_state_tree` (string) - The path to your local - [state tree](http://docs.saltstack.com/ref/states/highstate.html#the-salt-state-tree). - This will be uploaded to the `/srv/salt` on the remote, and removed before - shutdown. - -Optional: - -* `skip_bootstrap` (boolean) - By default the salt provisioner runs - [salt bootstrap](https://github.com/saltstack/salt-bootstrap) to install - salt. Set this to true to skip this step. - -* `boostrap_args` (string) - Arguments to send to the bootstrap script. Usage - is somewhat documented on [github](https://github.com/saltstack/salt-bootstrap), - but the [script itself](https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh) - has more detailed usage instructions. By default, no arguments are sent to - the script. - -* `temp_config_dir` (string) - Where your local state tree will be copied - before moving to the `/srv/salt` directory. Default is `/tmp/salt`.