Commit Graph

82 Commits

Author SHA1 Message Date
Chris Roberts e735453422 Add reboot option to shell provisioner
Adds a `reboot` option which allows the guest to be rebooted after
the completion of a shell provisioning task. The guest must support
the `:reboot` capability. Like the `reset` option, the `reboot`
option may be provided without defining `inline` or `file` options
when a reboot may be required between other provisioners.

Fixes #8639
2018-12-21 15:50:59 -08:00
Chris Roberts 29880ccd1f Add option to shell provisioner to reset communicator 2018-11-12 15:36:21 -08:00
Chris Roberts 3664f1a627 Allow hiding environment variable values in shell provisioner 2018-01-12 17:33:47 -08:00
Vít Ondruch 7187e6f909 Use Integer instead of Fixnum for Ruby 2.4+ compatibility. 2017-10-23 10:57:36 -07:00
Mikhail Bulash 508d94d466 provisioners/shell: Use ui.detail for displaying output
Output format of ui.info method (bold text) makes reading long script outputs really heavy on the eyes. ui.detail is a better match for this type of output.
2017-09-18 17:55:07 +03:00
Brian Cain 01528689fd (#8716) Dup string if frozen for line endings
Prior to this commit, if a user passed in a script that was frozen,
the shell provisioner would fail to modify the script to replace line
endings for windows because the string was immutable. This commit fixes
that by dup'ing the string so that it can have its line endings replaced
2017-08-15 08:38:30 -07:00
Chris Roberts 71bfe7c884 Fix shell provisioner to execute batch files correctly
Call cmd.exe explicitly when running batch files to easily
manage special characters that may be within the path.

Fixes #8535
2017-04-28 15:05:08 -07:00
Chris Roberts 0e89fdf182 Merge pull request #8498 from chrisroberts/win/spaces
Quote exec_path to properly handle spaces in path
2017-04-20 16:08:24 -07:00
Chris Roberts c963532d6e Use configured upload path for winssh communicator 2017-04-20 16:05:41 -07:00
Chris Roberts 82e268a3e2 Quote exec_path to properly handle spaces in path
Fixes #7234
2017-04-19 12:23:55 -07:00
Chris Roberts c56acfab94 Add WinSSH communicator 2017-04-15 07:12:58 -07:00
Chris Roberts da45ca707c Add md5 and sha1 checksum support to Downloader.
Allows checksum validation on downloaded files via Util::Downloader
using MD5 and/or SHA1 checksums. This also integrates checksum validation
support with the shell provisioner for downloaded remote files.
2016-11-09 16:05:39 -08:00
Seth Vargo 9de5126143 Convert env values to strings before escaping 2015-12-22 14:23:56 -05:00
Seth Vargo 930e166b47 Add :env option to shell provisioner 2015-11-23 19:29:35 -05:00
Mitchell Hashimoto e6098f6c4f rename to powershell_elevated_interactive 2015-11-18 12:51:18 -08:00
Mitchell Hashimoto dde21bc95a fix file permissions 2015-11-18 12:48:41 -08:00
Dan Dunckel 9d87be51da Small refactor on conditional check and add tests 2015-10-15 12:25:50 -07:00
Marc Siegfriedt 8e87990599 add the option to make elevated interactive scripts 2015-10-15 12:25:50 -07:00
Sam Phippen 53714abfa3 Handle encoding errors in shell provisioner newline normalization.
The problem demonstrated in #6065 is that a string has incorrectly been
encoded with US-ASCII even though it contains invalid US-ASCII byte
sequences (any byte with the most significant bit on is invalid in the
US-ASCII encoding).

The thing about doing newline normalization is that it is not actually
sensitive to the presence of US-ASCII byte sequenzes. Additionally, it
is very unlikely that a user will ever be using an encoding where \r\n
is not encoded the same as it would be in ASCII.

This patch first tries the existing method of normalizing the newlines
in the provided script file, if that fails for any reason it force
encodes the string to ASCII-8BIT (which allows the most significant bit
to be on in any individual byte) and then performs the substitution in
that byte space.
2015-09-12 14:36:54 +01:00
Seth Vargo 50c0c487fb Style cleanup for new name option 2015-05-30 20:57:49 -07:00
James Shubin b16b85aa7d Add :name attribute to shell provisioner.
This allows the display of friendly output to the user when we think an
important action should be labeled a certain way. This makes vagrant
output a lot more useful when many inline shell provisioners are
present.
2015-04-18 00:35:21 -04:00
Mitchell Hashimoto da91741b7c provisioners/shell: fix typo 2014-10-23 22:49:26 -07:00
Mitchell Hashimoto a7d3458abc provisioners/shell: retry getting SSH info a few times [GH-3924] 2014-10-23 22:48:48 -07:00
Mitchell Hashimoto 3f01a99148 provisioners/shell: rename shell_args to powershell-args 2014-10-23 09:53:14 -07:00
Eris Belew 7a73f5bd7c Update shell provisioner for powershell to add "shell_args", saner defaults and more useful detail in logging output; Add Eclipse .project file to .gitignore IDE section 2014-09-23 12:46:25 -07:00
Mitchell Hashimoto e82d425719 Merge pull request #4087 from zr40/fix/master/prevent-double-output
Don't output stdout and stderr twice when shell provisioner fails
2014-08-06 10:32:13 -07:00
Ben Dean dbb92ae412 change the shell provision config to make all the args strings
specifically arrays could contain `Fixnum` args and those wouldn't get turned into strings.
2014-07-22 15:41:01 -04:00
Matthijs van der Vleuten 1091b4cb54 Don't output stdout and stderr twice when shell provisioner fails
[GH-4086]
2014-06-23 11:35:40 +02:00
Kalman Hazins bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Fabio Rehm 1eec62cb9e provisioners/shell: Fix shell provisioning when config.binary is set to false [GH-3712]
The `config` in use was the Shell provisioner config that does not expose
access to the VM configs.

References https://github.com/fgrehm/vagrant-lxc/issues/284
2014-05-08 18:55:07 -03:00
Shawn Neal cc905d7923 Fix remote/downloaded shell scripts
The temporary shell script that we downloaded the script too was being deleted twice, thus causing an error on the secondary delete.
2014-04-30 19:39:37 -07:00
Shawn Neal 392269a8eb Default the WinRM shell provisioner to privileged (elevated) 2014-04-30 19:35:02 -07:00
Mitchell Hashimoto 1c7faae1ee provisioners/*: prefix the output 2014-04-21 13:56:19 -07:00
Mitchell Hashimoto bec2cbbf4d provisioners/shell: check for winrm should be on machine config 2014-04-21 13:53:56 -07:00
Mitchell Hashimoto 4145aa6bcd privisioners/shell: wait for reboot if we can 2014-04-21 13:53:54 -07:00
Mitchell Hashimoto 4fc6fbeef6 privisioners/shell: fix syntax error 2014-04-21 13:53:53 -07:00
Mitchell Hashimoto 286fd2f2f8 provisioners/shell: friendly output if winrm shell provisioning 2014-04-21 13:53:52 -07:00
Mitchell Hashimoto bddc7928ad provisioner/shell: proper extension on temporary file 2014-04-21 13:53:50 -07:00
Mitchell Hashimoto 89671974cf provisioners/shell: handle comm output in a uniform way 2014-04-21 13:53:49 -07:00
Mitchell Hashimoto cde5d0bafb privisioners/shell: execute windows script 2014-04-21 13:53:48 -07:00
Mitchell Hashimoto aca8c4f8f3 provisioners/shelL: don't replace windows lineendings for WinRM 2014-04-21 13:53:47 -07:00
Mitchell Hashimoto 15fe061004 provisioners/shell: cause provision_winrm if winrm 2014-04-21 13:53:46 -07:00
Mitchell Hashimoto e5d1d681d9 Update CHANGELOG 2014-04-09 14:17:51 -07:00
Bernhard Morgenstern 247a2470c0 Fixed error with empty shell provisioner
`read` returns nil on empty files, so the call to `valid_encoding` fails.
2014-04-09 22:56:15 +02:00
Mitchell Hashimoto fa537740c6 provisioners/shell: use detail level output for running 2014-03-08 14:43:35 -08:00
Mitchell Hashimoto a667893cbf provisioners/shell: error if invalid encoding [GH-3000] 2014-02-23 21:50:53 -08:00
Mitchell Hashimoto 8c9fde41e9 provisioners/shell: clean up fixnum handling 2014-02-14 12:43:27 -08:00
Ryan Uber 509e29043a Added handling of fixnum values for shell provisioner options both as the value
of `args` itself and as an element inside of an `args` array. Added validation
around passing in arrays for arguments. Just knowing that it is an array is not
enough, because arrays can contain any other type.
2014-02-14 11:47:36 -08:00
Mitchell Hashimoto 38f931ba93 provisioners/shell: array args properly work 2013-12-06 11:28:32 -08:00
Mitchell Hashimoto cfb258a55b provisioners/shell: s/unless/if !/ 2013-11-29 00:02:20 -08:00