From 23b856332e3f18a6f9ed850d962fd914f28fbf43 Mon Sep 17 00:00:00 2001 From: Rach Belaid Date: Sat, 10 Aug 2013 16:16:21 +0100 Subject: [PATCH] #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