Commit Graph

3701 Commits

Author SHA1 Message Date
Chris Roberts 7efd501fe8
Merge pull request #10399 from chrisroberts/e-comm-reset
Add communicator reset
2018-11-13 09:13:40 -08:00
Chris Roberts 43f7a16baa
Merge pull request #10313 from lloesche/lloesche/fix_wsl_detection
Fix WSL detection for customized roots
2018-11-12 16:21:44 -08:00
Chris Roberts 90dee00809
Merge pull request #10390 from chrisroberts/e-powerup-handle-spaces
Update powerup to handle spaces properly in arguments
2018-11-12 15:41:20 -08:00
Chris Roberts c2aa1e207f Add a Communicator#reset! method 2018-11-12 15:36:20 -08:00
Chris Roberts 4ff5291b89 Update powerup to handle spaces properly in arguments 2018-11-09 15:26:55 -08:00
Brian Cain fc0707202a
FIXES #9870: Allow for windows path spaces with ssh utility
Prior to this commit, if a windows path contained a space, the ssh
utility could not properly find the private key path and the ssh command
would fail. This commit adds some additional logic to the ssh utility to
check if a path contains '%', and if so, use the IdentityFile argument.
Otherwise it will default to passing in the private key file with '-i',
which can support paths with spaces.
2018-11-09 10:19:35 -08:00
Chris Roberts 2808193a1a
Merge pull request #10368 from chrisroberts/f-box-load-meta
Fallback to Vagrantfile configuration when local metadata lookup fails
2018-11-07 10:12:29 -08:00
Brian Cain 57ca89011c
Merge pull request #10374 from briancain/move-login-warning
Move login command warning
2018-11-05 13:25:37 -08:00
Chris Roberts 1885692f74
Merge pull request #10364 from chrisroberts/e-gem-dep-order
Update ordering of gem sources to ensure proper resolution
2018-11-05 12:50:26 -08:00
Chris Roberts d2d117471a
Merge pull request #10359 from chrisroberts/e-check-limits
Limit automatic box outdated checks to once per hour
2018-11-05 12:46:56 -08:00
Brian Cain b951c0e781
Move login command warning
This commit moves where the warning is for the login command so that it
only displays when the command is invoked, and not when the plugin is
loaded.
2018-11-05 11:24:09 -08:00
Chris Roberts d293e5dc08
Merge pull request #7693 from legal90/network_address
util/network_ip: Simplify #network_address helper
2018-11-02 14:08:49 -07:00
Chris Roberts 648be1369f Fallback to Vagrantfile configuration when local metadata lookup fails
The project local metadata file may contain invalid information to properly
lookup the configured box. This may occur if the file has been moved,
modified, or the backing box has been removed. In those cases, fall back
to the configuration defined in the Vagrantfile to load the box.
2018-11-02 13:59:53 -07:00
Chris Roberts 3daf3e532d Update ordering of gem sources to ensure proper resolution
In recent Rubies the first dependency to satisfy the constraint will
be used regardless if higher versions are available in subsequent
sources. Move custom source to start of list when resolving plugins
to provide desired behavior.
2018-11-02 09:14:27 -07:00
Chris Roberts 976320ec06 Limit automatic box outdated checks to once per hour 2018-11-01 09:45:11 -07:00
Brian Cain 6051f3598e
Fixes #10224: Allow validation of config while ignoring provider
This commit adds a new flag to the `vagrant validate` command which
allows users to completely ignore the provider block of a config file.
This is useful for when you are running `vagrant validate` in CI and
don't want to install a valid provider to check the syntax of your
Vagratnfile. When the flag is invoked, a warning will be displayed
saying that the provider block will be ignored and not validated.
2018-10-30 13:37:22 -07:00
Mikhail Zholobov 74de13cae5
util/network_ip: Simplify #network_address helper
Allow to use IPv6 net masks in string notation.
2018-10-28 21:17:43 +01:00
Chris Roberts ca81f9d6cb Prevent exception from raising on hyper-v check 2018-10-24 17:06:47 -07:00
Lukas Lösche 73cb4b5b42
Fix WSL detection for customized roots 2018-10-18 15:13:18 +02:00
Brian Cain b1b829f69d
Fix missing `end` in errors class 2018-10-12 09:16:36 -07:00
Brian Cain f1bae9f1eb
Remove level conditional for RestClient logging 2018-10-12 09:07:12 -07:00
Brian Cain adefbbaf6e
Scrub Vagrant Cloud tokens from RestClient logger 2018-10-12 09:07:12 -07:00
Brian Cain e8115a4389
Update based on second round of feedback 2018-10-12 09:07:12 -07:00
Brian Cain d8ec19faa8
Fixup: Update vagrant cloud command PR with feedback 2018-10-12 09:07:12 -07:00
Brian Cain 9b385df4ec
Fix comment formatting 2018-10-12 09:07:12 -07:00
Brian Cain 3c45acc35f
Continue if entity already exists with publish command 2018-10-12 09:07:12 -07:00
Brian Cain 83bd592e30
Introduce curl helper and uploader classes
This commit introduces a new uploader class for uploading files and
splits up some commonly used functionality between it and the downloader
class into a curl helper library.
2018-10-12 09:07:10 -07:00
Brian Cain e70b871660
Introduce `cloud` command
This commit adds a new command to Vagrant called `cloud`. It handles any
and all interactions with the external service Vagrant Cloud.
2018-10-12 09:06:00 -07:00
Chris Roberts 1c480880f1 Add test coverage of local rgloader creation 2018-10-10 10:30:30 -07:00
Chris Roberts 006cea45e3 Provide rgloader for project local plugins 2018-10-09 16:27:47 -07:00
Chris Roberts d7b5922378
Merge pull request #10275 from chrisroberts/e-hyperv-admin
Update Hyper-V admin check
2018-10-09 14:48:13 -07:00
Chris Roberts 93c2f0f497
Merge pull request #10263 from chrisroberts/e-winrm-extensions
Add winrm and upload commands
2018-10-09 14:42:54 -07:00
Chris Roberts 67bb5d2e6c Update Hyper-V admin check 2018-10-08 14:39:40 -07:00
Brian Cain f4d618eb58
Fixes #9840: Introduce `ruby` option for trigger
This commit introduces a new option to the core trigger feature: `ruby`.
It can be defined to run ruby code when the trigger is configured to
fire. If you give the ruby block an env and machine argument, the
defined ruby code can use those variables internally.
2018-10-05 12:53:41 -07:00
Chris Roberts 48d358adcb Add winrm and upload commands 2018-10-04 13:26:41 -07:00
Brian Cain 7798add296
Ensure log is only printed if box has Vagrantfile 2018-10-01 08:39:46 -07:00
Brian Cain 5520cf65d6
Add warning if Vagrantfile inside box is ignored 2018-09-28 16:44:50 -07:00
Brian Cain 424f49b919
Simplify config option to ignore box vagrantfile 2018-09-26 10:31:41 -07:00
Alex Wu a45e62cacd
fix the import issue when 'box_ignore_box_vagrantfile' is set, the box object should never be null. 2018-09-26 10:10:47 -07:00
Alex Wu 710b8da953
add config option 'box_ignore_box_vagrantfile' to ignore the Vagrantfile packaged in the box. 2018-09-26 10:10:47 -07:00
Brian Cain 5f56f0c8b1
Merge pull request #10223 from chrisroberts/e-rhel-nmsysd
Update restart logic in redhat change_host_name cap
2018-09-25 13:53:41 -07:00
Brian Cain 58ebd52f99
Add abort option to core triggers
This commit adds a new option `abort`, which when configured, will exit
the Vagrant process completely. If set to `true`, it will exit cleanly
with exit code 0. Otherwise, the exit code can be configured.
2018-09-25 09:40:36 -07:00
Chris Roberts 8fd05fe3c1 Use `command -v` for checks in all inspection helpers. Fix stubs in tests. 2018-09-21 09:19:40 -07:00
Chris Roberts fb5fc0e657 Update guest inspection utility module
Use sudo option for communicator test command instead of inline sudo
to properly use configured sudo value. Use command for checking
availability of hostnamectl. Use is-active for determining if a
service is being actively managed by systemd.
2018-09-20 16:42:39 -07:00
slackfan 59ecf95b0d
Remove unnessary import
Signed-off-by: Alexander Fischer <github@ordnungsdienst.org>
2018-09-18 13:56:18 -07:00
slackfan e547b26309
Don't compare paths by String
The implemented String comparison is misleading on Windows as it does not consider that paths on Windows are case insensitive

Signed-off-by: Alexander Fischer <github@ordnungsdienst.org>
2018-09-18 13:56:17 -07:00
Chris Roberts a3c056ef6f
Merge pull request #10199 from chrisroberts/f-multi-vagrantfile-load
Force command to be re-run after installing local plugins
2018-09-11 10:46:32 -07:00
Chris Roberts 8500a609f5 Remove sensitive values from logger output 2018-09-10 10:40:51 -07:00
Chris Roberts 798fb81926 Force command to be re-run after installing local plugins
Reloading the Vagrantfile causes issue with multiple evaluations
where users expect single evaluation. Instead of allowing local
plugin installation to happen prior to command execution, force
halt after installation and the command to be re-run. This will
prevent multiple loads of the Vagrantfile within a single run.
2018-09-10 09:59:58 -07:00
Maxim Kostrikin d06cd2f94b
Hardened proc disallow systemd detection
If you have a vagrant box with proc mounted with
proc    /proc    proc    defaults,hidepid=2     0     0
ps output will be limited to owned process
sudo should extend output
2018-09-10 18:13:58 +07:00
Robert Schulze 28771674d6 add `Vagrant.version?` helper method
to check Vagrant for a version match without raising an error.
2018-09-07 11:37:30 +02:00
Chris Roberts 3ace82cc5b Update Vagrant.has_plugin? helper to function prior to plugin loading
Due to the Vagrantfile being loaded prior to plugin loading to determine
project local plugin information the Vagrant.has_plugin? helper will always
return false when the Vagrantfile is first loaded. To prevent this behavior
we can check for plugins in the plugin data files prior to the plugins
being loaded, and after they have been loaded we can fallback to the
original specification based check.
2018-08-31 14:03:42 -07:00
Chris Roberts e24728cb5a
Merge pull request #10155 from chrisroberts/f-plugin-load-config
Reset internal environment after plugin load
2018-08-30 11:30:14 -07:00
Chris Roberts 9b67655e45 Reset internal environment after plugin load
Force the vagrantfile and configuration loader to be rebuilt after
plugins have been loaded to properly allow newly introduced plugin
configurations to be properly supported within the Vagrantfile.
2018-08-30 10:44:09 -07:00
Chris Roberts 92109752a3 Fix local plugin prompt and add coverage 2018-08-30 10:35:16 -07:00
Mikhail Emelchenkov ed8ecd15e1
Fix: `trigger` embedded plugin fails to exec scripts at paths contains spaces 2018-08-17 15:14:54 -07:00
Brian Cain 57c48ee348
Merge pull request #10116 from briancain/fix-run-arg-trigger
Ensure trigger run args are an array prior to join
2018-08-17 15:10:52 -07:00
Brian Cain 29aba535ce
(#10104) Ensure trigger run args are an array prior to join
Prior to this commit, if the args key was a string rather than an array
of strings, the `join` command would fail when appending the arguments
to the run command for a given script. This commit updates that by
ensuring the `args` option is an array prior to joining the arguments.
2018-08-14 10:29:51 -07:00
Brian Cain e073153728
(#10099) Properly join commands from passed in array
Prior to this commit, the `Util::Powershell.execute_inline`
method didn't properly join the passed in command and instead attempted
to execute the array of strings. This commit updates that
behavior to join the command array prior to inserting it into the full
powershell command.
2018-08-14 09:30:11 -07:00
Chris Roberts 03d8965ef7 Add param documentation and fix key used for box version 2018-08-02 15:19:39 -07:00
Chris Roberts 6c1a9dc58e Store box metadata of active guest
When a guest is created, the box metadata information is stored in the
machine data directory. This allows modifications to happen to the
Vagrantfile definition of the box in use (box name change, box version
change, etc) while still allowing the Machine instance of an active
guest successfully load the box currently backing it.
2018-08-02 11:01:36 -07:00
Chris Roberts 66566b8c3d
Merge pull request #10078 from chrisroberts/e-appimage-libs
Detect AppImage and update executable environment if required
2018-07-31 13:56:35 -07:00
Chris Roberts 6009492e73 Detect AppImage and update executable environment if required
If starting a process while running from within AppImage adjust
the LD_LIBRARY_PATH of the subprocess when the executable exists
outside of the AppImage. This prevents issues of invalid dynamic
library lookups when the AppImage contains common named libraries.
2018-07-31 10:39:26 -07:00
Chris Roberts ba908052ec Also handle false value for compatibility 2018-07-30 11:58:49 -07:00
Chris Roberts e3e3a332b3 Include update in ssh util for verify_host_key value 2018-07-30 11:25:29 -07:00
Chris Roberts c0b871794c
Merge pull request #9926 from Telekom-PD/centos_75_nmcli_hang
Fix hang at nmcli call on CentOS 7.5 when ssh.pty is enabled
2018-07-27 12:11:30 -07:00
Chris Roberts a993cbce4e
Merge pull request #10037 from chrisroberts/e-vagrant-plugins-local
Define project specific plugins
2018-07-27 09:57:41 -07:00
Chris Roberts ae14f95124 Properly downcase answer for check. Default response to no. 2018-07-19 10:31:32 -07:00
Chris Roberts c660643abb Prevent matching on other Location headers
Prevent matching on custom headers that include the Location name
when checking for host redirection.
2018-07-19 09:18:30 -07:00
Chris Roberts a490a8c587
Merge pull request #9966 from conspicuousClockwork/#9965
Added option to add to User-Agent
2018-07-18 16:43:02 -07:00
Chris Roberts 27a441f0bd
Merge pull request #10001 from chrisroberts/e-wsl-valid-sync
Disable synced folders on non-DrvFs
2018-07-18 16:41:16 -07:00
Chris Roberts 2ba5c74e1c
Merge pull request #9998 from chrisroberts/f-plat-wsl-pathname
Always force string type conversion of path
2018-07-18 16:37:07 -07:00
Chris Roberts ab39125570 Set options directly instead of lazy merging 2018-07-18 15:47:35 -07:00
Chris Roberts c5a6790192 Only run bundler initialization if plugin initialization is enabled 2018-07-18 10:48:22 -07:00
Chris Roberts c605b7d875 Update option name for local plugin installation 2018-07-17 15:35:25 -07:00
Chris Roberts 3223737734 Use env_local consistently internally 2018-07-17 14:49:41 -07:00
Chris Roberts b71054502e Update local usage to env_local for clarity 2018-07-17 14:49:41 -07:00
Chris Roberts 84c0aafe71 Support non-interactive local plugin install 2018-07-17 14:49:41 -07:00
Chris Roberts 40f4e6f67e Vagrant Environment isolated plugins
Adds support for plugins isolated to a specific `Vagrant::Environment`
which can be managed by the vagrant plugin command using the the
--local flag.
2018-07-17 14:49:41 -07:00
Chris Roberts 01a7b625e5
Merge pull request #10017 from troeggla/master
Download causes exception when location header is not an absolute URL
2018-07-17 10:00:23 -07:00
Chris Roberts 6f81d16691 Remove final #to_s on path 2018-07-12 16:49:22 -07:00
Thomas Röggla 2613d620fd checking whether the field location_uri.host is nil 2018-07-12 15:49:26 +02:00
Brian Cain 52c3dcc70e
(#9997) Catch and allow for non-standard exit codes
Prior to this commit, the run trigger option wouldn't catch for failures
outside of the #Subprocess.execute raising exceptions. This commit fixes
that by inspecting the exit code result of the subprocess and using the
new `exit_codes` option to determine how to move forward with the
trigger.
2018-07-09 15:56:26 -07:00
Chris Roberts 859d48d5f5 Restrict synced folder access to DrvFs file systems only within WSL 2018-07-06 16:58:12 -07:00
Chris Roberts 6aa5c1a008 Always force string type conversion of path
Fixes #9984
2018-07-06 14:29:32 -07:00
Koen Verheyen 7939784d1b Display current version in version check 2018-06-29 16:41:50 +02:00
Caleb Martinez 447e58dac3
Added option to add to User-Agent 2018-06-28 13:21:34 -04:00
Chris Roberts 69ece0db4e Always return string value when converting path 2018-06-18 10:02:59 -07:00
Chris Roberts c5c63d291d Only expand path if not in windows format 2018-06-18 09:39:30 -07:00
Chris Roberts 97eb459f56 Always expand to full path before converting to Windows path 2018-06-18 09:07:12 -07:00
Chris Roberts 3f23466703 Replace file separators when decompressing box files 2018-06-18 08:57:29 -07:00
Chris Roberts 55aaa1d258 Update path usages to support Hyper-V provider access from WSL 2018-06-15 09:03:18 -07:00
Chris Roberts 5357727350 Attempt full path to powershell as last resort in WSL 2018-06-15 09:03:18 -07:00
Simon Baatz fa34f4d2af Fix hang at nmcli call on CentOS 7.5 when ssh.pty is enabled
`vagrant up` may hang at the "Configuring and enabling network
interfaces..." step when private networks and PTY allocation for SSH
are used.

The newer version of `nmcli` that is part of CentOS now will open a
pager (i.e. `less`) for certain commands if it finds a tty. This
causes the invocations of `nmcli` in `guest_inspection.rb` to hang.

`nmcli` disables the use of a pager in 'terse' (`-t`) output mode,
while still returning enough information for the uses in
`guest_inspection.rb`.
2018-06-13 11:10:18 +02:00
Chris Roberts ef4d431d36 Remove console resizing on powershell commands 2018-06-12 16:47:47 -07:00
Chris Roberts 87b8321702 Remove win32 dependencies 2018-06-12 13:54:37 -07:00
Chris Roberts 5325000fa6 Add helper option for setting custom module path on PowerShell executes 2018-06-12 10:44:12 -07:00
Chris Roberts 5f4e661155 Add automatic console resize and environment support for powershell commands 2018-05-30 15:04:59 -07:00
Chris Roberts e6457d5061 Overhaul the Hyper-V provider 2018-05-24 14:43:44 -07:00
Brian Cain 5ca382727d
Raise error if argument is provided with `--all-global` flag
This commit raises an error if additional arguments are provided to the
suspend command when the `--all-global` flag is used.
2018-05-11 15:43:14 -07:00