From a542ff967b598d7c17f95f7f4b0655e148736116 Mon Sep 17 00:00:00 2001 From: Rach Belaid Date: Sat, 10 Aug 2013 15:24:04 +0100 Subject: [PATCH 1/2] Delete duplicate doc for Salt masterless provisionner there is a other doc file for this called salt.html.markdown which contain a better history --- .../salt-masterless.html.markdown | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 website/source/docs/provisioners/salt-masterless.html.markdown diff --git a/website/source/docs/provisioners/salt-masterless.html.markdown b/website/source/docs/provisioners/salt-masterless.html.markdown deleted file mode 100644 index 0ed1ea51e..000000000 --- a/website/source/docs/provisioners/salt-masterless.html.markdown +++ /dev/null @@ -1,38 +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. - -## Basic Example - -The example below is fully functional. - -
-{
-    "type": "salt-masterless",
-    "bootstrap_args": "git v0.16.0"
-    "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`. From a4c555a5b72b9f4f02ac5a52b745f478a428a14e Mon Sep 17 00:00:00 2001 From: Rach Belaid Date: Sat, 10 Aug 2013 16:16:21 +0100 Subject: [PATCH 2/2] #269 Make local_state_tree option not mandatory Update and rename salt.html.markdown to salt-masterless.html.markdown salt.html.markdown had a better history and formatting And remove local_state_tree from required option from code and docs --- provisioner/salt-masterless/provisioner.go | 13 ++++++------- ....html.markdown => salt-masterless.html.markdown} | 7 ++----- 2 files changed, 8 insertions(+), 12 deletions(-) rename website/source/docs/provisioners/{salt.html.markdown => salt-masterless.html.markdown} (93%) 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.html.markdown b/website/source/docs/provisioners/salt-masterless.html.markdown similarity index 93% rename from website/source/docs/provisioners/salt.html.markdown rename to website/source/docs/provisioners/salt-masterless.html.markdown index 16689a426..84e6f09ec 100644 --- a/website/source/docs/provisioners/salt.html.markdown +++ b/website/source/docs/provisioners/salt-masterless.html.markdown @@ -24,14 +24,11 @@ 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: +Optional: * `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: + 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