Commit Graph

75 Commits

Author SHA1 Message Date
David Z Hao 1d4750a2d9
DisableSudo, not PreventSudo 2019-06-20 13:39:51 -04:00
David Z Hao ea238b66c0
Make salt-masterless provisioner respect disable_sudo directive for all commands 2019-06-19 18:50:16 -04:00
Adrien Delorme f555e7a9f2 allow a provisioner to timeout
* I had to contextualise Communicator.Start and RemoteCmd.StartWithUi
NOTE: Communicator.Start starts a RemoteCmd but RemoteCmd.StartWithUi will run the cmd and wait for a return, so I renamed StartWithUi to RunWithUi so that the intent is clearer.
Ideally in the future RunWithUi will be named back to StartWithUi and the exit status or wait funcs of the command will allow to wait for a return. If you do so please read carrefully https://golang.org/pkg/os/exec/#Cmd.Stdout to avoid a deadlock
* cmd.ExitStatus to cmd.ExitStatus() is now blocking to avoid race conditions
* also had to simplify StartWithUi
2019-04-08 20:09:21 +02:00
Adrien Delorme c7ce4d598e change Provisioner to be passed a context for cancellation 2019-04-03 15:55:54 +02:00
Megan Marsh b33d6ce82e fix salt provisioner on linux 2018-03-13 16:13:23 -07:00
Dave Sanderson 284b069003 Fixed stating of files on windows
added directory existence check to salt provisioner before directory clean up
2017-12-13 10:20:27 -07:00
Dave Sanderson 57770de36f revert file stat 2017-12-12 16:01:00 -07:00
Dave Sanderson aee67d3933 Add ability to move files on remote system
Fix salt-masterless to use generic MovePath
2017-12-12 15:22:10 -07:00
Dave Sanderson 857e5d04d3 Fix command error for salt install 2017-12-12 15:11:29 -07:00
Dave Sanderson 666796e8eb Add ability to stat a remote path 2017-12-12 14:39:13 -07:00
Dave Sanderson 630b7466d6 updated test to remove old DefaultTmpDir reference
Fixed sudo logic
Fixed error message format issue for OSType check
2017-12-12 11:49:10 -07:00
Dave Sanderson 0efda50354 Initial Windows support 2017-12-12 11:36:38 -07:00
Matthew Hooker e073d63f30
remove racy reuse of single buffer for remotecmd stderr/out. 2017-11-09 15:22:47 -08:00
Brett Russ 7192c46e46 sudo prefix the command which cleans up `/srv/{salt,pillar}` as these are created with sudo in the packer driven salt bootstrapper 2017-08-11 21:26:16 -04:00
Steven Lamerton e953898890 Add support for salt_bin_dir
Allows specifying the path to salt-call, useful if it isn't on the
path.
2017-06-07 08:16:23 +01:00
Ian Ellis 912fc9c2af Added grains_file config item to copy file to /etc/salt/grains 2017-06-04 08:31:30 +01:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Patrick Decat 5dd7fb11f4 Saltstack bootstrapping: fallback on wget if curl failed for any reason (such as not being installed) 2016-12-02 20:02:22 +01:00
Jasper Siepkes 200aa74e78 Added support for passing arguments to salt-call. 2016-11-11 15:15:16 +01:00
Rickard von Essen 3c8dabba9e Fixed formatting 2016-10-11 23:43:50 +02:00
Isa bb2dd6e2b2 add custom_state config to salt provisioner 2016-08-03 12:56:51 -07:00
Matt Black 33071150c1 Salt provisioner: option to set logging level on Salt highstate run 2016-01-26 13:09:15 +00:00
Matt Black 9ccf298be9 Salt provisioner: option to ignore salt highstate failures fixes #2486 2016-01-26 13:09:15 +00:00
Matt Black 5cd15b52c5 Salt provisioner: dynamic command line args passed onto salt-call fixes #2652 2016-01-26 13:09:15 +00:00
Matt Black 7cb802f8a0 Salt provisioner: improved inputs validation 2016-01-26 13:09:15 +00:00
Mark Peek c48548b3bb go fmt 2015-10-18 11:13:09 -07:00
Chris Bednarski 84abbc2fe2 Merge pull request #2519 from BayanGroup/salt-remote-dirs
Add options to specify salt remote dirs
2015-07-30 19:06:59 -07:00
Chris Bednarski c04feb77b1 Merge pull request #2520 from BayanGroup/salt-ensure-dir-exists
Ensure that `/etc/salt` exists
2015-07-30 19:03:34 -07:00
AmirAli Moinfar eba0e9eaf8 Ensure that `/etc/salt` exists
Make sure that directory `/etc/salt` exists before copying salt
minion file.
2015-07-28 10:40:09 +04:30
AmirAli Moinfar 769c82b171 Support for setting salt remote directory
* It is possible to set remote salt tree through `remote_state_tree` argument.
* It is possible to set remote pillar root through `remote_pillar_roots` argument.
* Directories `remote_state_tree` and `remote_pillar_roots` are emptied before use.
2015-07-28 10:37:52 +04:30
AmirAli Moinfar f90f2f685d Fix semantic errors in messages 2015-07-28 10:34:13 +04:30
Mitchell Hashimoto 288b9a70f6 Merge pull request #1657 from njhartwell/master
Adding disable sudo support to salt masterless
2015-06-22 12:37:30 -07:00
Mitchell Hashimoto 7c8e86c9c5 provisioner/*: fix interpolation context 2015-06-22 12:26:54 -07:00
Mitchell Hashimoto 2b4df93f2f provisioner/*: interpolation 2015-05-27 14:50:20 -07:00
Nathan Hartwell d0d3229f96 Merge branch 'master' of https://github.com/mitchellh/packer
Conflicts:
	provisioner/salt-masterless/provisioner.go
2015-05-13 08:13:38 -05:00
Emil Hessman 3165b0c936 provisioner/salt-masterless: fix incorrect printf verb types
Fixes the following vet reports:

provisioner/salt-masterless/provisioner.go:119: arg cmd for printf verb %s of wrong type: *github.com/mitchellh/packer/packer.RemoteCmd
provisioner/salt-masterless/provisioner.go:121: arg err for printf verb %d of wrong type: error
provisioner/salt-masterless/provisioner.go:142: arg err for printf verb %d of wrong type: error
provisioner/salt-masterless/provisioner.go:157: arg err for printf verb %d of wrong type: error
provisioner/salt-masterless/provisioner.go:172: arg err for printf verb %d of wrong type: error
provisioner/salt-masterless/provisioner.go:216: arg err for printf verb %d of wrong type: error
2015-02-25 05:43:18 +01:00
Erik Simmler 034ed36d0e Ask salt to return a proper exit code so we can fail the builder appropriately. 2014-12-30 10:34:43 -05:00
Victor Trac eb72584415 fix passing bootstrap_args to bootstrap script 2014-12-22 14:08:32 -06:00
Nathan Hartwell e5c6f1a753 Merge branch 'master' of https://github.com/mitchellh/packer
Conflicts:
	provisioner/salt-masterless/provisioner.go
2014-11-05 10:58:25 -06:00
Mitchell Hashimoto 81d8cd0db4 Merge pull request #1394 from mafrosis/salt-masterless
Salt masterless tidy up
2014-10-28 08:35:10 -07:00
Steve Daniels 86fb46ab0a Update SaltStack provision to https
This changes the SaltStack bootstrap URL to use the HTTPS link from the commercial site.  Alternatives are the HTTPS link to the raw file on GitHub, but this, whilst more transparent, might break down the line.
2014-10-22 17:55:45 +01:00
Nathan Hartwell 331003c809 Merge branch 'master' of https://github.com/mitchellh/packer 2014-10-06 15:19:11 -05:00
mafro ed07fb63e4 salt provisioner: tidy up and refactor into functions 2014-10-01 12:31:58 +10:00
mafro e7a46d97c0 salt provisioner: require local_state_tree 2014-10-01 12:31:58 +10:00
Ross Smith II d92179847d provisioner/file: set file/directory permissions
fixes #1064
2014-05-09 21:03:35 -07:00
Nathan Hartwell 88ec874c32 Adding disable_sudo support to salt-masterless provisioner
This is already present in some other provisioners and is helpful when
using a builder that gives you root access.
2014-05-09 09:08:41 -05:00
Mitchell Hashimoto d1c497676a Merge pull request #514 from rgarcia/salt-masterless-uploaddir
provisioner/salt-masterless: use communicator.UploadDir
2013-10-20 17:42:38 -07:00
Rafael Garcia 32b9a305a1 provisioner/salt-masterless: use communicator.UploadDir 2013-10-09 18:51:30 -07:00
Rafael Garcia 76393ba285 provisioner/salt-masterless: move states to /srv/salt, not /srv/salt/states
Latest version copies local state tree to {tmp}/states and then executes `mv {tmp}/states /srv/salt/`. This creates a `/srv/salt/states` instead of the correct `/srv/salt` directory.
2013-10-09 13:49:30 -07:00
Mitchell Hashimoto 28bf6122bd provisioner/*: implement Cancel 2013-08-30 23:23:36 -07:00