Compare commits

...

1782 Commits

Author SHA1 Message Date
Brian Cain 5cc06bde64
Merge pull request #11341 from hjung4/spell
Fix spelling errors
2020-01-27 15:29:24 -08:00
comet fa43afb57b
update 2020-01-27 17:04:23 -06:00
Chris Roberts b231abe114 Update version and changelog for new development 2020-01-27 12:31:15 -08:00
Chris Roberts ac268e2638 Release v2.2.7 2020-01-27 12:29:18 -08:00
Jeff Bonhag db316a396f
Lock closed issues after 30 days (#11332)
This commit adds Hashibot support to lock closed issues after 30 days.
It also will automatically remove the `waiting-reply` tag if a user
replies to an issue with that tag.
2020-01-27 09:58:50 -05:00
Jeff Bonhag a1abc177bd
Merge pull request #11328 from Lin-Buo-Ren/patch-1
Fix missing quoting for `VagrantFile`
2020-01-21 09:27:16 -05:00
林博仁(Buo-ren Lin) 8ac6403bcc
Fix missing quoting for `VagrantFile`
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2020-01-21 16:56:14 +08:00
Chris Roberts 02c157e427 Fix environment variable value 2020-01-16 14:46:50 -08:00
Chris Roberts d8d24f4d6e
Merge pull request #11320 from chrisroberts/e-ci-updates
Add CI scripts and configuration
2020-01-16 14:24:50 -08:00
Chris Roberts ee302f3a9b Add CI scripts and configuration
Provides scripts for building, storing, and releasing Vagrant
via builders. Includes updates for testing and removal of
deprecated CI configuration.
2020-01-15 17:16:54 -08:00
Brian Cain 054f4def5c
Merge pull request #11319 from briancain/fix/typo-on-website-docs
Fix typo in CLI upload docs
2020-01-13 12:56:14 -08:00
Brian Cain 0077d7955d
Fix typo in CLI upload docs 2020-01-13 11:23:06 -08:00
Brian Cain f886184011
Merge pull request #11314 from imechemi/patch-1
Minor doc update
2020-01-13 09:32:50 -08:00
Tenzin Chemi e864605879
Update public_network.html.md 2020-01-11 23:21:30 +05:30
Brian Cain 7f09202571
Merge pull request #11300 from briancain/bug/check-respond-to-for-name-option
Check name config option with respond_to?
2020-01-09 14:59:41 -08:00
Brian Cain 2ae6b37c9a
Merge pull request #11304 from nepella/fix-typo
Ansible docs: Fix misplaced brace in example.
2020-01-08 14:21:30 -08:00
Renee Margaret McConahy 1c6ac924c5
Ansible docs: Fix misplaced brace in example. 2020-01-08 16:42:42 -05:00
Brian Cain 6855dd8c74
Check name config option with respond_to?
Prior to this commit, the check used to look for the config option
`name` in a provisioner config would accidentally create a "DummyConfig"
based on how vagrant handles missing config options. This commit fixes
that by instead using the `respond_to?` method to check for the
existance of the config option name.
2020-01-07 11:10:02 -08:00
Brian Cain dd5d73e8a9
Update CHANGELOG 2020-01-07 09:19:30 -08:00
Brian Cain 3d1f1d2422
Merge pull request #11295 from briancain/fixup/provision-with-name-shell
Fixes #11287: Set top level provisioner name if set in provisioner config
2020-01-07 09:18:19 -08:00
Brian Cain ee8b38d47a
Set provisioner names to symbol
Because Vagrant is handling provisioner names to be symbols more
uniformly now, update the mocked tests to reflect this change. Otherwise
these provisioners will be ignored and not run.
2020-01-06 13:25:31 -08:00
Brian Cain b4c302a74c
Set shell provisioner name in provision_test 2020-01-06 12:48:33 -08:00
Brian Cain 711270b90a
Fixes #11287: Set top level provisioner name if set in provisioner
config

Prior to this commit, if a user had configured a provisioner that had a
config with a `name` option, it would not properly set the top level
provisioner classes name config option which would lead to some
understanibly confusing results when trying to `--provision-with`. This
commit fixes that by checking to see if the top level name isn't set,
look to see if that provisioners config defines a name, and use that
instead.
2020-01-06 11:10:28 -08:00
Jeff Bonhag 58687e6c44
Update CHANGELOG 2019-12-20 13:14:46 -05:00
Jeff Bonhag 7fb7dd8608
Enable WinSSH shell for `vagrant ssh -c` (#11258)
This commit changes the behavior of the builtin SSHRun action to use a Windows
shell if the WinSSH communicator is active.  This allows for running one-off SSH
commands with Windows Command Prompt or PowerShell.  By default, this will not
allocate a TTY for any SSH commands.

Example usage:

```
vagrant ssh -c 'dir "c:\program files"'
```

Updates docs to reflect a change made in
a55a53e6a4.
2019-12-20 13:10:11 -05:00
Jeff Bonhag f0b8c0737f
Fixes #11269: enable_checkpoints default is true (#11272)
Update docs to reflect change made in
8aa74a03a0.
2019-12-20 12:59:51 -05:00
Jeff Bonhag 88d2077cb8
Update CHANGELOG 2019-12-19 14:49:30 -05:00
Jeff Bonhag ade076cabb
Fixes #11236: Windows port detection (#11244)
This reverts commit 81553263ab.

This fixes a regression with Windows port detection which led to port
collisions not being fixed on `vagrant up`.

PR #8517 changed `IsPortOpen#is_port_open?` to rescue
Errno::EADDRNOTAVAIL, but when we merged it into master, there was code
in `HandleForwardedPortCollisions#port_check` that depended on that
error bubbling up.
2019-12-19 14:46:13 -05:00
Chris Roberts 85065c3746 Update CHANGELOG 2019-12-18 16:50:24 -08:00
Chris Roberts 923ecc0943
Merge pull request #11267 from chrisroberts/e-catalina-synced-folders
Update synced folder setup in darwin cap for vmware
2019-12-18 16:48:05 -08:00
Chris Roberts 25659a6f6b Support properly setting up synced folders on Catalina
Since the root file system is marked as read-only, attempting to
link the shared directory to `/vagrant` will fail. If the guest
path is on the root file system and APFS is used, create the
link as a firmlink instead.
2019-12-18 13:11:30 -08:00
Chris Roberts 80c05460ab Call hooks before and after each action if they are available 2019-12-18 13:11:30 -08:00
Brian Cain 8c137e2bba
Update CHANGELOG 2019-12-18 08:24:22 -08:00
Brian Cain 4e58dfed2b
Merge pull request #11265 from briancain/LOCAL-ANSIBLE-BUG-PLUS-RSPEC
Fixup: ansible_local: Add `cap` bug fixes and related RSpec coverage
2019-12-18 08:20:59 -08:00
Brian Cain 61ee42976b
Merge pull request #11262 from briancain/return-if-no-disk-config
Return if no disk config
2019-12-17 13:55:08 -08:00
Brian Cain 7d667c9dea
Update ansible install tests 2019-12-17 13:34:52 -08:00
Jose Luis Duran 582f46231b
FreeBSD: Update Ansible's package name
The Ansible package in FreeBSD is now `py36-ansible`.

If `pkg` itself needs updating, passing only one 'yes' is not enough to
confirm the installation of the package.  Use the `-y` option,
specifically made for this purpose.  Also add `-q` to force a quiet
output, inline with other guests.

References:

- [`pkg-install(8)`](https://www.freebsd.org/cgi/man.cgi?query=pkg-install&sektion=8)
- freebsd/freebsd-ports@cbf5576945
2019-12-17 12:53:24 -08:00
Brian Cain 0c0352201d
Update ansible_install_test.rb
Remove extra whitespace
2019-12-17 12:51:39 -08:00
Gilles Cornu bcdda99dfa
ansible_local: Fix pip setup on Arch Linux guest
Add 'python' package requirement. Tested against `archlinux/archlinux`
box, at version "2019.11.24".
2019-12-17 12:51:39 -08:00
Gilles Cornu 069122f42c
[minor] Align Ruby formatting across ansible_local files
GH-11148: Remove unwanted formatting changes proposed in 920361150f.
2019-12-17 12:51:39 -08:00
Gilles Cornu a2b87eace4
Fix broken 'ansible_install' methods signature
- By the way: Trim the generate 'pip install' command in Ansible::Cap::Guest::Pip::pip_install
- GH-11048: Fix same regression for FreeBSD and SuSE guests.
- GH-6633:  Add RSpec examples to cover ansible_local 'cap' code.

Note: RedHat/Fedora guests are not covered yet by unit tests.
2019-12-17 12:51:39 -08:00
Gilles Cornu 113a0a7aaa
[minor] Use the correct "pip_install_cmd" name
There is no such thing like 'pip_install_command' option in the
Ansible Local provision, so let's avoid any misunderstanding ;-)
2019-12-17 12:51:39 -08:00
Stefan Koenen 04aeff4cc6
FIX #11048, add parameter `pip_install_cmd` to `ansible_install.rb` for arch guest.
ADD: Handling of `pip_install_cmd` in `ansible_install.rb` for arch guest.
2019-12-17 12:51:39 -08:00
Brian Cain 11c667a81d
Update CHANGELOG 2019-12-17 11:31:32 -08:00
Brian Cain aecd354c57
Merge pull request #11191 from samdbmg/fix-10914-ansible_local-hang
Don't prompt for input when installing Ansible
2019-12-17 11:30:48 -08:00
Brian Cain 9f2261a6fc
Add test for builtin disk action 2019-12-17 10:56:48 -08:00
Brian Cain de61b307aa
Only run disk action if disk config present 2019-12-17 10:45:33 -08:00
Jeff Bonhag 320b166c31
Update CHANGELOG 2019-12-17 12:43:53 -05:00
Jeff Bonhag d7a5f74897
Fixes #11128: Error if machine folder inaccessible (#11239)
This commit catches the Errno::EPERM raised by the operating system if
the machine folder is inaccessible and displays it as a more friendly
error message.

This can be an issue on macOS Catalina if virtual machine files are kept
in a special directory (Documents/Downloads/Desktop) that Vagrant's
embedded Ruby is not allowed to access.
2019-12-17 12:41:12 -05:00
Jeff Bonhag 4059758e00
Update CHANGELOG 2019-12-17 12:36:38 -05:00
Jeff Bonhag 2fa44f5b8f
Fixes #11218: Update apk cache when installing rsync (#11220)
This ensures that rsync can be installed on an Alpine Linux machine where the
apk cache may not be current.

Display a warning if the vagrant-alpine plugin is installed, since Alpine guest
support has been merged into Vagrant core.
2019-12-17 12:34:53 -05:00
Brian Cain 55994824a4
Update CHANGELOG 2019-12-17 08:45:17 -08:00
Jeff Bonhag df9df5c250
Wrap all environment variables headers with <code> (#11261)
This commit adds the <code> backticks to a few headers that didn't have
them.
2019-12-17 11:43:30 -05:00
Brian Cain 0b71991902
Merge pull request #11231 from briancain/add-force-option-for-box-outdated
Fixes #11228: Allow to force check for box updates
2019-12-17 08:42:51 -08:00
Brian Cain 8dae01e9c7
Update CHANGELOG 2019-12-16 08:52:10 -08:00
Brian Cain 20ccf46fb1
Merge pull request #11250 from briancain/update-virtualbox-with-6.1
Fixes #11249: Add VirtualBox provider support for version 6.1.x
2019-12-16 08:51:28 -08:00
Brian Cain 4cdf2cdd8f
Merge pull request #11251 from jjasghar/jjasghar/alpabitize
Alphabiztize the Website and template
2019-12-11 16:33:25 -08:00
JJ Asghar 9adf855f31 Alphabiztize the Website and template
Having these provisioners not alphabitized on the website and
Vagrantfile, seemed odd. This reorders them to be consistent.

Signed-off-by: JJ Asghar <jjasghar@gmail.com>
Signed-off-by: JJ Asghar <awesome@ibm.com>
2019-12-11 17:55:51 -06:00
Brian Cain fb4e6985e1
Fixes #11249: Add VirtualBox provider support for version 6.1.x
This commit adds support for VirtualBox version 6.1.x. It simply
inherits from the base 6.0.x provider class.
2019-12-11 13:25:11 -08:00
Brian Cain f306131a97
Update CHANGELOG 2019-12-05 14:33:20 -08:00
Brian Cain 1e0385443b
Merge pull request #11223 from perlun/patch-1
completion.sh: add more up options
2019-12-05 14:32:36 -08:00
Brian Cain bcf4d5a210
Fixes #11228: Allow to force check for box updates
Prior to this commit, if a user had recently checked for updates, there
was no way to force Vagrant to re-check without manually deleting a
state file in the local `.vagrant` data dir. This commit fixes that by
giving users the ability to force check for updates for a given box with
a flag to the `vagrant box outdated` command.
2019-12-03 11:42:55 -08:00
Per Lundberg 527dda241f
completion.sh: add more up options
I noted the `--provision` option which I currently needed (to retry an Ansible playbook that had failed) was missing, so I added this along with all other options I could find. They are ordered in the same order as they are listed in the `--help` output.
2019-11-28 16:05:58 +02:00
Jeff Bonhag b03f8f5aac
Update CHANGELOG 2019-11-25 15:43:23 -05:00
Jeff Bonhag c6ee1049aa
Darwin: put each NFS export on its own line (#11216)
This commit introduces a Darwin-specific template for NFS exports.  This is almost identical to the standard BSD template except it puts each NFS export on its own line.

This resolves NFS issues discovered in macOS Catalina.
2019-11-25 15:41:05 -05:00
Brian Cain 9fc155bf75
Merge pull request #11165 from briancain/feature/generic-disk-config-mgmnt
Introduce disk management base config layer to core Vagrant
2019-11-22 14:57:00 -08:00
Brian Cain f979d40436
Add warning if machines provider does not support disk configuration 2019-11-22 14:40:23 -08:00
Brian Cain f8449063b6
Have default names for primary and non-primary disks 2019-11-22 14:40:23 -08:00
Brian Cain b56dede627
Do not set primary option if it's not UNSET or false 2019-11-22 14:40:23 -08:00
Brian Cain 8ad810b5b6
Check and call into provider capability `:configure_disks` 2019-11-22 14:40:23 -08:00
Brian Cain f55aca091c
Wrap disk feature in experimental flag 2019-11-22 14:40:23 -08:00
Brian Cain 86f9243762
Move validation message to locales 2019-11-22 14:40:23 -08:00
Brian Cain 3e177d380f
Update disk docs in website for experimental feature banner 2019-11-22 14:40:23 -08:00
Brian Cain 734aad1ede
Enforce unique names for disk config objects 2019-11-22 14:40:23 -08:00
Brian Cain b5b59a4eee
Base name for disk is vagrant_primary if primary 2019-11-22 14:40:23 -08:00
Brian Cain ea7a230cb6
Move disk config validation messages to locales file 2019-11-22 14:40:23 -08:00
Brian Cain 57fd731fbf
Add warning if machines provider was not found in disk provider config
opts
2019-11-22 14:40:23 -08:00
Brian Cain 3a2b4ddef2
Validate that disk file exists in disk config validate 2019-11-22 14:40:23 -08:00
Brian Cain cd98a8bf64
Include unit test for numeric class 2019-11-22 14:40:23 -08:00
Brian Cain 2e324a4971
Add conversion method for shortcut size in disk config 2019-11-22 14:40:23 -08:00
Brian Cain 271cf8a603
Begin to add Numeric class helper for converting size strings 2019-11-22 14:40:23 -08:00
Brian Cain 8031ebe9d1
Add some todos for the disk website docs 2019-11-22 14:40:23 -08:00
Brian Cain 17f8fbe65e
Fix how double underscore options are shown in docs 2019-11-22 14:40:23 -08:00
Brian Cain 63b35ad909
Begin to add short guide for plugin authors and the disk config object 2019-11-22 14:40:23 -08:00
Brian Cain b0f4d43663
Add docs around various ways to define provider specific options for disk configs 2019-11-22 14:40:23 -08:00
Brian Cain 7feee7a87f
Add locale for primary disk validation error 2019-11-22 14:40:23 -08:00
Brian Cain f51805e910
Add list of examples to write up for disk feature 2019-11-22 14:40:23 -08:00
Brian Cain 9190f4b2e6
Fix nav sidebar view for disk page 2019-11-22 14:40:23 -08:00
Brian Cain 97db5d5da3
Add todo for disk management overview 2019-11-22 14:40:23 -08:00
Brian Cain 1a02c52852
Add beginning of disk management docs for vagrant website 2019-11-22 14:40:23 -08:00
Brian Cain 54c3e28a45
Add comment for potential hook into provider configuring disk 2019-11-22 14:40:23 -08:00
Brian Cain a457dee8b0
Set default disk to non-primary 2019-11-22 14:40:23 -08:00
Brian Cain a51e9b1fa1
Support both kinds of provider config options for disk config 2019-11-22 14:40:23 -08:00
Brian Cain 83fea21ff1
Simplify builtin disk action 2019-11-22 14:40:23 -08:00
Brian Cain e598007237
Add provider specific disk options under provider_config hash 2019-11-22 14:40:23 -08:00
Brian Cain 6c54bf6ad9
Fix logger namespace typo 2019-11-22 14:40:23 -08:00
Brian Cain d54e870752
Add file option to disk config 2019-11-22 14:40:23 -08:00
Brian Cain f01c90e676
Rename rspec test name 2019-11-22 14:40:23 -08:00
Brian Cain 71ad0f7aba
Remove duplicate setting of disks variable 2019-11-22 14:40:23 -08:00
Brian Cain 35f113e759
Put back accidental case switching for comments on provisioner 2019-11-22 14:40:23 -08:00
Brian Cain 9c1d05113f
Update merge comment for disk config 2019-11-22 14:40:23 -08:00
Brian Cain 87366cf4f3
Add basic disk config unit tests 2019-11-22 14:40:23 -08:00
Brian Cain 93828508ec
Update config/vm with tests for disk config 2019-11-22 14:40:23 -08:00
Brian Cain d6df83103e
Add todo for attaching and configuring disk for a given provider 2019-11-22 14:40:23 -08:00
Brian Cain 499e39dd10
Ensure primary is true or false 2019-11-22 14:40:23 -08:00
Brian Cain cef1bd47b3
Add initial disk builtin action 2019-11-22 14:40:23 -08:00
Brian Cain a55e3d2b91
Make config.vm.disks accessible instead of internal 2019-11-22 14:40:23 -08:00
Brian Cain 8adffc830a
Add builtin disk action 2019-11-22 14:40:23 -08:00
Brian Cain c18f36e516
Fix code comment typo 2019-11-22 14:40:23 -08:00
Brian Cain ad73969010
Fixup disk config parsing to allow hash and block 2019-11-22 14:40:23 -08:00
Brian Cain 7cfccb5cfd
Update variable docs for disk name 2019-11-22 14:40:23 -08:00
Brian Cain ee751ca6e1
Add disk name for disk config 2019-11-22 14:40:23 -08:00
Brian Cain 995c4bbc60
Add validation for disk configs 2019-11-22 14:40:23 -08:00
Brian Cain a18ce4f732
Add primary config option for disk 2019-11-22 14:40:23 -08:00
Brian Cain 393ce9eb1b
Rename drives to disks to match class, and properly merge configs 2019-11-22 14:40:23 -08:00
Brian Cain 28d339eac5
Ensure block is properly passed through to add_config 2019-11-22 14:40:23 -08:00
Brian Cain ee388d8293
Ensure config is renamed to options 2019-11-22 14:40:23 -08:00
Brian Cain 34673fe5f9
Add disk class function for provider layers 2019-11-22 14:40:23 -08:00
Brian Cain 98a2d0f723
Update internal drives state to be array instead of hash 2019-11-22 14:40:23 -08:00
Brian Cain abcc334900
Add note about disk options value 2019-11-22 14:40:23 -08:00
Brian Cain 1a21782bd5
Add note about disk name 2019-11-22 14:40:23 -08:00
Brian Cain e361900d3a
Update doc string for name attribute 2019-11-22 14:40:23 -08:00
Brian Cain aa5a3ef7f7
Add initial disk management config class 2019-11-22 14:40:23 -08:00
Chris Roberts 1d9533113c Disable master storage 2019-11-22 14:38:46 -08:00
Brian Cain e535a8a624
Update CHANGELOG 2019-11-22 14:22:44 -08:00
Brian Cain e100d9cd48
Merge pull request #11205 from briancain/DOCKER-BUILDKIT-FIXUP
Enhance docker build method for the Docker provider to include buildkit output
2019-11-22 14:21:59 -08:00
Brian Cain 2901dae948
Add option for docker executor to handle stderr from results
Instead of always joining stdout and stderr, only join the two if the
caller explicitly asks for it. Otherwise, only return stdout.
2019-11-22 12:04:09 -08:00
Brian Cain cb661886a2
Merge pull request #11213 from briancain/improve-windows-uninstall-notes
Add more details for removing user data when uninstalling Vagrant
2019-11-22 12:02:59 -08:00
Brian Cain c35861e937
Update CHANGELOG 2019-11-22 10:19:22 -08:00
Brian Cain 2656d3d9d5
Update CHANGELOG 2019-11-22 10:18:49 -08:00
Brian Cain 6831129720
Merge pull request #11211 from briancain/fixup/ensure-checksum-and-type-are-not-empty
Fixes #11207: Do not validate checksums if options are empty string
2019-11-22 10:17:10 -08:00
Brian Cain f5886e6044
Merge pull request #11212 from briancain/NFS-RHEL-FIXUP
Ensure `nfs-server` is restarted when installing nfs client for redhat guests
2019-11-22 10:15:50 -08:00
Brian Cain 601118059c
Fix typo for vagrant 2019-11-22 10:03:25 -08:00
Brian Cain 3ee7b3801f
Add more details for removing user data when uninstalling Vagrant 2019-11-21 15:24:09 -08:00
Brian Cain 2a2e2d5414
Update nfs client test for redhat 2019-11-21 13:44:35 -08:00
Brian Cain fb7a9d5582
Remove trailing whitespace 2019-11-21 13:44:28 -08:00
Tomas Krizek 3519f82b24
guest/redhat: fix nfs client installation
CentOS 8+ and Fedora 30+ no longer have the alias "nfs" for "nfs-server"
systemd service.

This shouldn't break backward compatibility, since "nfs-server" service
is available on all supported redhat systems that have systemctl binary.

Fixes #10838
2019-11-21 13:11:29 -08:00
Brian Cain efd3a62ffe
Fixes #11207: Do not validate checksums if options are empty string
Prior to this commit, if Vagrant received checksum options from Vagrant
Cloud that were simply empty strings, it would try to validate its
checksum with those options. This commit fixes that by ignoring empty
string values.
2019-11-21 09:56:58 -08:00
Brian Cain 1699821571
More specific language around docker build matching errors 2019-11-19 11:14:46 -08:00
Brian Cain 4d70856b8a
Enhance docker build matching for determining built container ID
Prior to this commit, docker would look for a container ID based on
"Successfully built" string. This output does not exist if a user has
enabled the experimental feature buildkit. This commit updates the build
behavior to match against both kinds of outputs, and instead of using
`scan`, it uses MatchData and groups the container id with match group
name `:id` instead of making hard assumptions with the matches being
contained inside arrays from scan.
2019-11-19 10:59:28 -08:00
Juha Ruotsalainen 4fc8b07974
Removed the word 'done'.
There are cases, when 'done' is prefix with a duration, like `... 0.1s done`.
2019-11-19 10:02:03 -08:00
Rumpu-Jussi f3629ebd09
Buildkit-based output processed a bit differently. 2019-11-19 10:02:03 -08:00
Juha Ruotsalainen 8041d0ae78
Build quietly and capture the image hash
At least on macOS combo Catalina + Docker engine 19.03.4 + Docker desktop 2.1.0.4 + vagrant 2.2.6 the original `matches = result.scan(/Successfully built (.+)$/i)` -line fails to generate a match. With this change I can `vagrant up --provider=docker` successfully.
2019-11-19 10:02:03 -08:00
Brian Cain 237af1b6aa
Update CHANGELOG 2019-11-19 09:14:32 -08:00
Brian Cain ff5fc2a8f2
Merge pull request #11201 from terceiro/nfs-exports-sanity
nfs: avoid adding extra newlines to /etc/exports
2019-11-19 09:13:27 -08:00
Antonio Terceiro 4fd2373753 nfs: avoid adding extra newlines to /etc/exports
StringBlockEditor already adds the necessary newlines. That extra
newline was making /etc/exports longer and longer, full of empty lines,
because StringBlockEditor doesn't know about it and does not remove it.
2019-11-17 00:33:08 -03:00
Brian Cain 51ceda7e25
Merge pull request #11198 from briancain/docs/add-quote-heredoc-example
Fixes #11196: Add more examples for ruby heredoc shell scripts
2019-11-15 14:29:53 -08:00
Jeff Bonhag a37226d63d Update CHANGELOG 2019-11-15 17:14:55 -05:00
Brian Cain a8a9f54fab
Update docs to use quotes around terms 2019-11-15 13:18:03 -08:00
Jeff Bonhag 307123c1f2
Fixes #10753: Add reboot support for Linux guests (#11194)
This commit adds support for setting `reboot: true` while using the
shell provisioner with Linux guests.
2019-11-15 14:46:36 -05:00
Brian Cain 28812fb880
Highlight here document terms instead of indent 2019-11-15 10:27:59 -08:00
Brian Cain 2adda6861e
Fixes #11196: Add more examples for ruby heredoc shell scripts
This commit adds an additional example for how to preserve quotes in a
script that uses heredocs.
2019-11-15 09:26:39 -08:00
Brian Cain ed9769586b
Merge pull request #11195 from briancain/fixup/ensure-gem-version-gets-non-nil
Fixup: Ensure Gem::Version.new does not receive nil value
2019-11-14 15:26:55 -08:00
Brian Cain 06799402ed
Fixup: Ensure Gem::Version.new does not receive nil value
This commit fixes an issue where Gem::Version.new could recieve a nil
value if no addtional box updates are available. For some versions of
ruby, this is actually an error case. This commit fixes that by
converting it to an integer to prevent an exception.

Issue reference: https://github.com/rubygems/rubygems/issues/2359
2019-11-14 14:51:29 -08:00
Jeff Bonhag c1a6910539 Update CHANGELOG 2019-11-13 17:37:24 -05:00
Jeff Bonhag 0e68f02dc9
Fixes #11163: Get latest version for provider (#11192)
This commit changes the behavior of `vagrant box outdated --global` so
it gets the latest version for the current machine's provider, rather
than the latest version for any provider.
2019-11-13 17:33:15 -05:00
Chris Roberts 85e34039b9
Merge pull request #11181 from stefansundin/rubyzip-v1.3.0
Bump rubyzip to v1.3.0 to fix CVE-2019-16892
2019-11-12 13:31:11 -08:00
Stefan Sundin 48c893ee18 Bump rubyzip version to fix CVE-2019-16892. 2019-11-12 10:48:29 -08:00
Brian Cain 2ea9323d0b
Merge pull request #11180 from briancain/fixup/docs-insert-key-config
Fixes #8058: Improve wording for config.ssh.insert_key docs
2019-11-12 09:09:08 -08:00
Brian Cain 9e7fae0c51
Update CHANGELOG 2019-11-12 09:08:27 -08:00
Brian Cain 403fece5ac
Merge pull request #11184 from briancain/fixup/cleanup-cloud-publish-cmd
Fixes #11137: Fixup how cloud publish handles its arguments
2019-11-12 09:07:42 -08:00
Brian Cain 8b21051466
Update CHANGELOG 2019-11-12 09:07:15 -08:00
Brian Cain 39ea1af5ab
Merge pull request #11183 from briancain/fixup/include-errors-in-checksum-util
Fixes #11179: Ensure Vagrant::Errors are loaded in file_checksum util
2019-11-12 09:06:49 -08:00
Brian Cain a8b99f422b
Merge pull request #10991 from dcermak/bump_rspec_its
Bump rspec-its dependency
2019-11-12 09:03:24 -08:00
Chris Roberts 063dea5699
Merge pull request #11190 from chrisroberts/e-i18n-constraints
Update i18n dependency constraints
2019-11-12 09:01:35 -08:00
Jeff Bonhag 0015a8c4c6 Update CHANGELOG 2019-11-12 11:44:15 -05:00
Jeff Bonhag a39a7ae794
Fixes #10741: Check if update is available locally (#11188)
This commit checks the local box collection to see if the latest box
update has already been downloaded.  If it has, Vagrant will display the
destroy/recreate message instead of the "run vagrant update" message.
2019-11-12 11:41:10 -05:00
Chris Roberts 687c601755 Update i18n dependency constraints
Loosen dependency constraints on the i18n library to allow
versions under 2.0.
2019-11-12 08:08:32 -08:00
Chris Roberts 2eaa6e9be1
Merge pull request #11185 from rjspiker/rj.font-smooth
website - add -moz-osx-font-smoothing for smooth firefox osx fonts
2019-11-11 17:00:43 -08:00
Brian Cain 474a2e3279
Update CHANGELOG 2019-11-11 15:35:38 -08:00
Brian Cain ce20b70073
Merge pull request #11126 from chrisroberts/f-newline-output
Update UI to properly retain newlines when adding prefix
2019-11-11 15:34:50 -08:00
Brian Cain 823c499dfb
Merge pull request #10969 from olleolleolle/patch-1
gemspec: drop rubyforge_project, it is EOL
2019-11-11 15:34:07 -08:00
Brian Cain 361736579c
Update CHANGELOG 2019-11-07 13:22:27 -08:00
Brian Cain 509812b8e6
Merge pull request #11175 from briancain/fixup/show-machine-name-in-hostname-validation
Fixes #11173: Show guest name in hostname error message
2019-11-07 13:21:42 -08:00
Brian Cain 1ec5e4c396
Merge pull request #11169 from briancain/fixup/website-getting-started-typo
Fixes #11168: Fix Ubuntu version in getting started guide
2019-11-07 13:20:52 -08:00
RJ Spiker 26b6f61682 website - add -moz-osx-font-smoothing for smooth firefox osx fonts 2019-11-07 13:10:59 -07:00
Brian Cain 145f04893c
Fixes #11137: Fixup how cloud publish handles its arguments
Prior to this commit, if a user didn't supply a box file on disk or a
box url, Vagrant would crash and display a stacktrace with an invalid
file. This commit fixes that by adding some extra handling around the
arguments supplied to the publish command.
2019-11-07 10:19:52 -08:00
Brian Cain 44c6f655be
Fixes #11179: Ensure Vagrant::Errors are loaded in file_checksum util
Prior to this commit, the file_checksum class used the `Vagrant::Errors`
class as if it were apart of the Vagrant module. However, since the
file_checksum class is an interface and not part of the Vagrant module,
it doesn't have access to that Error class like other Vagrant modules.
This commit fixes that by ensuring the `"vagrant/errors"` class is
loaded, and that the proper namespace is used.
2019-11-07 09:22:17 -08:00
Brian Cain 72496d5f5d
Fixes #8058: Improve wording for config.ssh.insert_key docs 2019-11-06 16:55:04 -08:00
Jeff Bonhag 7560c7fdef Update CHANGELOG 2019-11-06 16:22:17 -05:00
Jeff Bonhag 8a69c1205c
Fixes #10170: Check for modinfo in /sbin (#11178)
Check for modinfo in /sbin if it doesn't appear on the PATH.

If it's not found on the PATH or in /sbin, the command will default back to modinfo so the user sees the error message about adding it to their PATH.
2019-11-06 16:10:24 -05:00
Chris Roberts 89e0522659
Merge pull request #11167 from rjspiker/rj.fonts
website - font and brand updates
2019-11-06 09:56:32 -08:00
Brian Cain e2adefe4c7
Update CHANGELOG 2019-11-05 09:31:17 -08:00
Brian Cain d4f83ca4a3
Merge pull request #11170 from moench-tegeder/suse_hostname_vs_getent
explicitly test the hostname we'll be setting
2019-11-05 09:30:28 -08:00
RJ Spiker 3d48faa1b4 feedback updates and some style cleanup 2019-11-04 13:59:59 -07:00
Brian Cain 0aaa2cc147
Fixes #11173: Show guest name in hostname erorr message
This commit adds the machine guest name in the hostname validation error
message so that it's easier to see which guest in a Vagrantfile has the
validation error.
2019-11-04 08:41:51 -08:00
Brian Cain f30b136c57
Merge pull request #11151 from dcermak/fix_exception_in_docker_test
Catch NetworkNoInterfaces error in docker prepare_networks_test
2019-11-01 10:58:52 -07:00
Sam Mesterton-Gibbons e4ab40393e Don't prompt for input when installing Ansible
Sets `DEBIAN_FRONTEND=noninteractive` and tells `dpkg` to take the old
version of config files when installing Ansible, to prevent hangs
waiting for user input.

Fixes #10914
2019-11-01 17:17:03 +00:00
Dan Čermák fe4743a22b
Mock call to PrepareNetworks.list_interfaces in docker prepare_networks_test
The test "generates a network name and configuration" calls at the end
`process_public_network()`, which can return an empty list if the currently
executing machine has no usable network interfaces (this is typically the case
for workers that build rpm packages in OBS or Koji). This results in an
exception of type Errors::NetworkNoInterfaces to be thrown and causing this test
to fail.

This commit adds a mock of the PrepareNetworks.list_interfaces call that returns
a single entry with just the required defaults.
2019-11-01 17:36:31 +01:00
Brian Cain d27d7d5a2a
Update CHANGELOG 2019-11-01 08:14:23 -07:00
Brian Cain 4b1297b5d3
Merge pull request #11152 from briancain/fixup/command-snapshot-save-all-vms
Fixes #11139: Skip machines that haven't been created for snapshot save
2019-11-01 08:13:31 -07:00
Brian Cain 811231bf92
Fixes #11168: Fix Ubuntu version in getting started guide 2019-11-01 07:46:47 -07:00
Christoph Moench-Tegeder 6f6e58f4ae explicitly test the hostname we'll be setting
getent queries the system resolver for the hostname - but it's not
the resolver we're interested in. In fact, the hostname-to-be-set
may already exist in DNS (becuase DNS really is a nifty thing and
can do a lot of things which are not that possible with /etc/hosts
alone), in which case getent will "not fail" and vagrant will believe
the hostname had already been set.
Instead, query hostnamectl for the "static" hostname - that's the
one we will be setting, so we're ok IFF hostnamectl returns exactly
what we would be setting.
2019-11-01 15:41:04 +01:00
Brian Cain d70e3eb828
Merge pull request #11164 from slavrd/u/docs-intro-prov
update getting started guide - provision
2019-10-31 10:33:50 -07:00
Slav Donchev 42482849ec add example html for the user to create 2019-10-31 09:14:32 +02:00
RJ Spiker 0f7b250e81 website - font and brand updates 2019-10-30 16:26:38 -06:00
Slav Donchev 8130314741 example provision script copies default web site 2019-10-28 13:25:45 +02:00
Brian Cain 4735699bc8
Merge pull request #11155 from briancain/fixup/mockup-nfsd-call-bsd-nfs
Ensure nfsd call is mocked up in BSD NFS test
2019-10-25 09:22:51 -07:00
Brian Cain ce033454ca
Ensure nfsd call is mocked up in BSD NFS test 2019-10-25 09:02:30 -07:00
Brian Cain f998e535ce
Fixes #11139: Skip machines that haven't been created for snapshot save
This commit fixes the original #11027 fix, which assumed that the
hyper-v provider just wasn't properly getting a VM id when it listed
snapshots. In reality, it was just that if you invoke the
`with_target_vm` method with no arguments, it runs on the entire environment.
This meant that the capability snapshot_list attempted to be invoked on
machines that didn't exist yet, which is the original cause for why the
list_snapshot method did not recieve a vm ID. This commit fixes that by
simply skipping the machine if it does not yet exist.
2019-10-24 13:33:25 -07:00
Brian Cain f6503462f6
Merge pull request #11141 from Jonfor/patch-1
Update CHANGELOG.md
2019-10-21 08:50:28 -07:00
Jonathan Forscher 8def8a794f
Update CHANGELOG.md
Fix speling error in release notes.
2019-10-21 11:38:33 -04:00
Chris Roberts 318dca294a Ensure empty message values are properly formatted 2019-10-15 08:54:24 -07:00
Chris Roberts 783f5fc65d Update UI to properly retain newlines when adding prefix
When using a Prefixed UI instance prevent new line characters from
being removed when adding prefix formatting to output messages.

Fixes #11044
2019-10-14 16:56:40 -07:00
Chris Roberts d2914a85ee Update website download version 2.2.6 2019-10-14 12:35:50 -07:00
Chris Roberts 5aeda42902 Update version and changelog for new development 2019-10-14 09:40:05 -07:00
Chris Roberts f58b97b0fe Release v2.2.6 2019-10-14 09:38:13 -07:00
Brian Cain 9fa3301a0c
Merge pull request #11117 from sk1u/add-ansible-limit-note
docs: Add clarification about ansible.limit in static inventory usecase
2019-10-11 10:12:36 -07:00
Michael C 670cadae9f docs: Add clarification about ansible.limit in static inventory usecase 2019-10-11 08:57:20 +02:00
Brian Cain 0f9a5bacb3
Update CHANGELOG 2019-10-10 13:18:17 -07:00
Brian Cain 33a53d0c4e
Merge pull request #11116 from briancain/DOCKER-LIST-INTERFACES
Only return interfaces where addr is not nil
2019-10-10 13:17:41 -07:00
Brian Cain 7c93151f67
Add test for listing interfaces with docker networks 2019-10-10 11:38:57 -07:00
Dan Čermák 435a32684f
Only return interfaces where addr is not nil
tunnel interfaces on Linux have addr set to nil which makes the function
list_interfaces fail with a backtrace.
2019-10-10 10:49:03 -07:00
Chris Roberts 67270a2d64
Merge pull request #11084 from chrisroberts/doc-update
Update docs page for Vagrant Cloud catalog
2019-10-10 10:02:23 -07:00
Chris Roberts 81b23f3180 Update CHANGELOG 2019-10-10 09:22:20 -07:00
Chris Roberts b12a23273e
Merge pull request #11108 from chrisroberts/macos-catalina
Fix NFS sharing in macOS 10.15 (based on #11105)
2019-10-10 09:20:33 -07:00
Brian Cain a069b48952
Update CHANGELOG 2019-10-09 16:27:06 -07:00
Brian Cain 2147c6544f
Merge pull request #11111 from briancain/bug/docker_network_subnet_prefix
Fixes #11094: Determine prefix for docker public networks
2019-10-09 16:26:22 -07:00
Brian Cain e6d47329ee
Add note about removing prefix workaround 2019-10-09 16:07:21 -07:00
Brian Cain 8458a21657
Determine prefix with netmask 2019-10-09 15:40:36 -07:00
Brian Cain 62b7e35169
Fixes #11094: Determine prefix for docker public networks
Prior to this commit, the docker action was using the method `prefix` on
an IPv4 and IPv6 address. This works fine for ruby versions 2.5 and
newer, however the ruby shipped with Vagrant is before 2.5, and
therefore the IPv4 and IPv6 classes do not have the prefix method,
resulting in an error. This commit fixes that by using a different
method of determining the prefix.
2019-10-09 09:56:59 -07:00
Chris Roberts da15c1d171 Add test coverage on host plugin updates for nfs and resove_host_path capabilities 2019-10-08 16:42:36 -07:00
Chris Roberts 8f42dbff21 Add a resolve_host_path capability for bsd and darwin hosts
For bsd the resolve_host_path capability is a no-op. For darwin
hosts, if firmlinks are defined on the system, paths will be properly
resolved to real path.
2019-10-08 16:41:48 -07:00
Chris Roberts 2c16c96e57 Update nfs_export cap to use resolve_host_path cap for shared directories
Using the resolve_host_path capability allows hosts to modify the
shared folder directory while keeping the logic contained within
the specific host implementation.
2019-10-08 16:38:52 -07:00
Brian Cain d22cfcb86c
Update CHANGELOG 2019-10-08 13:42:01 -07:00
Brian Cain 00e0dc9279
Merge pull request #11076 from dcermak/suse_nfs_support
Update nfs & service daemon names for suse based hosts
2019-10-08 13:41:22 -07:00
Andy Fowler e288a5b732 `df` -> `/bin/df` to use macOS version
Thanks, @AntonioMeireles!
2019-10-08 13:21:34 -07:00
Andy Fowler ae9c3e28d6 Fix #10961 NFS sharing in macOS 10.15 host
On OS X 10.15, / is read-only and paths inside of /Users (and elsewhere)
are mounted via a "firmlink" (which is a new invention in APFS). These
must be resolved to their full path to be shareable via NFS.

/Users/johnsmith/mycode  =>  /System/Volumes/Data/Users/johnsmith/mycode

We check to see if a path is mounted here with `df`, and prepend it.

Firmlinks are only createable by the OS and this wasn't supposed to be
visible to applications anyway:
https://developer.apple.com/videos/play/wwdc2019/710/?time=481
2019-10-08 13:21:34 -07:00
Chris Roberts 72043a8a79 Update CHANGELOG 2019-10-08 13:20:05 -07:00
Chris Roberts 0d2751686b
Merge pull request #11101 from chrisroberts/e-checksums
Extend checksum support for box validation and remote files
2019-10-08 13:16:33 -07:00
Chris Roberts 3d026e84f2 Update constraint on vagrant_cloud for checksum support 2019-10-08 11:23:48 -07:00
Chris Roberts 04a1bb58f3 Add coverage on new behavior of FileChecksum 2019-10-08 11:23:48 -07:00
Chris Roberts 0bce1e6307 Update tests for checksum and filechecksum 2019-10-08 11:23:48 -07:00
Chris Roberts cc23905142 Add support for providing box checksums to Vagrant Cloud 2019-10-08 11:23:48 -07:00
Chris Roberts 13654dcc37 Update box checksum logic to use that supplied from FileChecksum 2019-10-08 11:23:48 -07:00
Chris Roberts 9ee5ce4817 Remove checksum from downloader and replace with FileChecksum
Remove checksum implementation within the Util::Downloader and
relocate it into the FileChecksum helper class. Update Downloader
to use FileChecksum.
2019-10-08 11:23:48 -07:00
Chris Roberts 7fb81bcea1 Add support for other checksum types 2019-10-08 11:23:48 -07:00
Brian Cain eec20f9007
Update CHANGELOG 2019-10-08 09:27:20 -07:00
Brian Cain ea550289a9
Merge pull request #11100 from chkpnt/suse-hostname
Use hostnamectl instead of hostname to set the hostname under SUSE
2019-10-08 09:26:46 -07:00
Brian Cain 292496b9e0
Update CHANGELOG 2019-10-07 14:31:56 -07:00
Brian Cain 7616c99c79
Merge pull request #11106 from briancain/bug/docker_compose_build_args
Ensure build_args are passed into docker compose config file
2019-10-07 14:30:30 -07:00
Brian Cain f9a75514d2
Update CHANGELOG 2019-10-07 14:29:05 -07:00
Brian Cain d6f556c83d
Merge pull request #11099 from briancain/file-provisioner-source-path
Ensure relative path for file provisioner is relative to machines cwd
2019-10-07 14:28:13 -07:00
Chris Roberts af405b03c9
Merge pull request #11103 from chrisroberts/e-ruby-eol
Update Ruby version constraints
2019-10-07 13:53:51 -07:00
Brian Cain f1ea4eaac0
Ensure build_args are passed into docker compose config file
Prior to this commit, the docker compose build method would not properly
set build_args if given in a Vagrantfile. This commit fixes that by
using the passed in key `extra_args` from the docker build action.
2019-10-07 12:48:59 -07:00
Brian Cain ec963966cd
Update CHANGELOG 2019-10-07 09:05:31 -07:00
Brian Cain 96e275451c
Merge pull request #10938 from andersk/virtualbox-usable
virtualbox: Fix usability test to reject bad installs without crashing
2019-10-07 09:04:24 -07:00
Chris Roberts 5916b111a1 Update minimum Ruby version and remove EOL'd Rubies from test config 2019-10-05 10:24:20 -07:00
Chris Roberts fafde5efdc Remove travis configuration (replaced with circle) 2019-10-05 10:19:16 -07:00
Anders Kaseorg 4afd370d6a virtualbox: Fix usability test to reject bad installs without crashing
If VirtualBox is installed but the kernel module is missing or the
service is stopped, the usability test should fail without crashing so
we can fall back to other providers.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-04 15:56:10 -07:00
Brian Cain c35758046d
Update CHANGELOG 2019-10-04 13:10:21 -07:00
Brian Cain 656b61175d
Merge pull request #11093 from rgl/fix-windows-shell-reboot-connect-timeout
retry the wait for a windows reboot on connect timeout errors
2019-10-04 13:09:18 -07:00
Gregor Dschung 8442b6b59f Use hostnamectl instead of hostname to set the hostname under SUSE 2019-10-03 14:46:14 +02:00
Brian Cain 0a6c4e2d0f
Ensure relative path for file provisioner is relative to machines cwd
Prior to this commit, if you ran Vagrant in a different current working
directory other than where a current guest machines location is, the
file provisioner would not take into account the machines local dir, and
would instead use the path where Vagrant was invoked to expand the
`source` path option for a file provisioner. This commit fixes that by
passing the root path `machine.env.cwd` when expanding the source dir.
2019-10-02 15:33:23 -07:00
Brian Cain 07a5190676
Merge pull request #10548 from mykaul/patch-1
ansible_ssh_host in the example is deprecated
2019-10-02 14:54:17 -07:00
Brian Cain 620500c1b0
Update CHANGELOG 2019-10-02 12:52:20 -07:00
Brian Cain 968a126405
Merge pull request #11098 from briancain/finalize-ansible-config-values
Fixes #10950: Ensure pip_install_cmd is finalized
2019-10-02 12:51:33 -07:00
Brian Cain 03ad01f158
Update CHANGELOG 2019-10-02 12:50:43 -07:00
Brian Cain 23352d406c
Merge pull request #11097 from briancain/hyperv-command-snapshot-save-fix
Fixes #11027: Ensure VM id is passed to list snapshots
2019-10-02 12:49:38 -07:00
Brian Cain c49a58f0d3
Update CHANGELOG 2019-10-02 12:48:20 -07:00
Brian Cain f92e1a1973
Merge pull request #11089 from briancain/rsync-helper-regex-path-fix
Fixes #10966: Ensure all subdirectory files are watched
2019-10-02 12:47:04 -07:00
Brian Cain 64cb304153
Merge pull request #11090 from briancain/add-note-about-run-bash-scripts
Docs: Add note about running bash with the `run` option for triggers
2019-10-02 12:46:46 -07:00
Brian Cain 96c20ad3cc
Fixes #10950: Ensure pip_install_cmd is finalized
Prior to this commit, the `pip_install_cmd` option for ansible guest
config was not properly finalized. This commit ensures that if that
value is still UNSET_VALUE, it gets set to empty string in the finalize!
method.
2019-10-02 10:33:31 -07:00
Brian Cain 66ec57a637
Fixes #11027: Ensure VM id is passed to list snapshots
Prior to this commit, if you tried to save a snapshot without giving it
a name, the hyper-v driver would not properly obtain a vm id to save a
snapshot on, resulting in an error. This commit updates the command
snapshot save to hold onto the machines ID in argv rather than `pop` it
off, so that the hyperv driver can obtain the guests id when saving a
snapshot.
2019-10-01 13:33:39 -07:00
Brian Cain 1b98f0681c
Update CHANGELOG 2019-10-01 11:13:23 -07:00
Brian Cain 8f856949f2
Merge pull request #10978 from mrshanahan/fix-issue-10973
Fixes issue hashicorp#10973: checks that VMMS WMI reference is null & throws appropriately
2019-10-01 11:12:41 -07:00
Rui Lopes ba71c30e04 retry the wait for a windows reboot on connect timeout errors 2019-09-28 12:20:10 +01:00
Brian Cain 5c26e651e6
Move around example mention in docs 2019-09-26 13:15:16 -07:00
Brian Cain f69bdc4bb6
Docs: Add note about running bash with the `run` option for triggers 2019-09-26 12:54:53 -07:00
Brian Cain 1c620852b6
Fixes #10966: Ensure all subdirectory files are watched
Prior to this commit, due to a fix that ignored `.vagrant` with rsync
helper, it broke the ability to watch for changes in subdirectories when
running the rsync-auto command. This commit puts back some of the helper
methods that were there previously for a given watcher path to ensure
that all files and subdirectories are properly watched and synced.
2019-09-26 08:29:37 -07:00
Brian Cain b3462d805b
Update CHANGELOG 2019-09-24 13:59:17 -07:00
Brian Cain 71bf5de44c
Merge pull request #11075 from jlduran/freebsd-remove-apt-ism
FreeBSD: Remove APT-ism
2019-09-24 13:56:11 -07:00
Brian Cain 0d0db48552
Update CHANGELOG 2019-09-24 09:42:20 -07:00
Brian Cain c9998f4a27
Merge pull request #11012 from aielo/fix-dev-vagrantfile
[#10484] Fixed Vagrantfile for Vagrant development
2019-09-24 09:41:44 -07:00
Chris Roberts 916ea9dd75 Documentation updates to Vagrant Cloud catalog docs page
These updates are based on the comments made by @ladar within #11034
2019-09-24 08:39:42 -07:00
Brian Cain 1d6a248a0f
Merge pull request #11060 from karstengresch/patch-1
Typo.
2019-09-24 08:19:25 -07:00
Ladar Levison 0712c18d68 Fixed grammar mistake. Added periods. 2019-09-23 16:08:49 -07:00
Chris Roberts 058577ec46
Merge pull request #11032 from nfagerlund/aug19_nokogiri_update
Update middleman-hashicorp container and Gemfile.lock
2019-09-23 16:01:00 -07:00
Ricardo Aielo 365111f3bb Box switched to hashicorp/bionic64 and supported providers adjusted 2019-09-22 13:07:46 -03:00
Dan Čermák a3588c28a8
Update nfs & service daemon names for suse based hosts
- nfs.service got recently removed in openSUSE Tumbleweed and calling service
  restart nfs errors out on Tumbleweed. nfs.service has been an alias to
  nfs-client.target for a very long time and can thus be safely substituted.
- all actively supported versions of openSUSE & SLE are using systemd now
  => no reason not to use systemctl
2019-09-18 23:28:18 +02:00
Jose Luis Duran 6c4b537c82 FreeBSD: Remove APT-ism
No functional change intended.
2019-09-17 03:58:37 -03:00
Brian Cain 9eac6ae62d
Update CHANGELOG 2019-09-12 08:47:42 -07:00
Brian Cain 8b4ff9c40f
Merge pull request #11056 from briancain/fixup-windows-config-loading-error
Ensure proper paths are shown in config loading exceptions
2019-09-12 08:47:12 -07:00
Brian Cain 2581efa778
Update CHANGELOG 2019-09-12 08:41:20 -07:00
Brian Cain bab66df318
Merge pull request #11068 from briancain/DOCKER-USABLE
Fix Docker providers usable? check
2019-09-12 08:40:44 -07:00
Brian Cain c7b1f8821d
Try to mock up docker version subprocess result in test 2019-09-11 09:36:11 -07:00
Brian Cain d4002aa74d
Add vagrantfile mock to iso_env machine 2019-09-11 09:17:14 -07:00
Brian Cain e820b5df8e
Add vagrantfile double for environment class 2019-09-11 09:01:35 -07:00
Brian Cain f14cf09af6
Add allow for docker driver execute method 2019-09-11 08:37:07 -07:00
Brian Cain 21db2db9ac
Add machine config to machine double for rspec tests
This commit mocks up the docker machines test config so that it doesn't
actually invoke the docker driver in circle-ci
2019-09-11 08:09:26 -07:00
Brian Cain ebe1f3f1c9
Remove virtualbox context from docker tests 2019-09-11 07:46:40 -07:00
Anders Kaseorg 5b4dcf9443
providers/docker: Fix usability check
In commit 7980178d19 (#10879) I added a
`usable?` class method to `VagrantPlugins::DockerProvider::Provider`.
However, commit 34e53a5a4b (#10890)
incorrectly changed it to an instance method.  This rendered it
ineffective because it’s called on the class, not an instance.  Change
it back to a class method.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-09-10 15:10:43 -07:00
Brian Cain ace67ccdeb
Remove platform require since it is no longer required in file 2019-09-10 13:28:37 -07:00
Brian Cain a22acba467
Simplify line and path checks for exception handling in config loading 2019-09-10 13:27:23 -07:00
Karsten Gresch fc600f1e9e
Typo. 2019-09-08 22:26:41 +02:00
Brian Cain 09a37e0767
Fixes #11022: Ensure correct line is used for windows exceptions
Prior to this commit, if there was a config error inside a provider
block, Vagrant wouldn't grab the right backtrace token on windows since
the api is different for ruby on Windows compared to all other
platforms. This commit ensures that the proper line number is chosen so
the error message is correct.
2019-09-06 14:00:46 -07:00
Brian Cain ccf99d8c0c
Fixes #11022: Show proper path & letter drive on exceptions for windows
Prior to this commit, vagrant was not grabbing all of the tokens on
Windows for showing the full drive because the ruby api for it behaves
differenly on windows compared to other platforms. This commit changes
that by ensuring the letter drive is attached to the path when showing
an exception.
2019-09-06 13:37:38 -07:00
Brian Cain b28e6d95a6
Update CHANGELOG 2019-09-06 11:09:19 -07:00
Brian Cain 8abc0cc90c
Merge pull request #11013 from dcermak/suse_ipv6_support
Add ipv6 network config templates for SUSE based distributions
2019-09-06 11:08:37 -07:00
Brian Cain 2c88a6595c
Update CHANGELOG 2019-09-06 08:53:24 -07:00
Brian Cain f74239bed9
Merge pull request #11043 from briancain/provisioner-enhancements
Introduce new Provisioner options: before and after
2019-09-06 08:52:40 -07:00
Brian Cain 17e5240547
Update CHANGELOG 2019-09-06 08:50:34 -07:00
Brian Cain f9b60ba603
Merge pull request #11052 from briancain/add-skip-used-boxes-with-force-prune
Fixes #10908: Preserve in-use boxes when force flag is used with prune
2019-09-06 08:49:40 -07:00
Brian Cain bc3d80d637
Update CHANGELOG 2019-09-06 08:48:22 -07:00
Brian Cain 2f6d8b5934
Merge pull request #11053 from briancain/docker-passwd-auth-provider-host-vm
Fixes #11051: Only use host vm if specified
2019-09-06 08:47:34 -07:00
Brian Cain 5210e9d82b
Update flag from used to active 2019-09-05 15:46:43 -07:00
Brian Cain 99b5867559
Update reject to compact 2019-09-05 15:39:24 -07:00
Brian Cain 09af983caa
Fixes #11051: Only use host vm if specified
Prior to this commit, the docker login action assumed that if there was
a password to authenticate with, Vagrant was using a host vm to run
docker. This is likely due to some legacy decisions with how Vagrant
used to manage running docker. This commit fixes that by only grabbing a
host_vm lock if the host_vm is actually in use, otherwise login
normally.
2019-09-05 14:54:40 -07:00
Brian Cain e19f54457d
Fixes #10908: Preserve in-use boxes when force flag is used with prune
Prior to this commit, `vagrant box prune --force` would not prompt a
user to prune Vagrant boxes, even if that box was in use. There was no
way to prune boxes, ignore the prompt, but keep in-use boxes. This
commit adds a new flag that can be combined with `--force`, that will
keep in-use boxes but prune older boxes without prompting the user.
2019-09-04 15:54:11 -07:00
Brian Cain 7b0dc8d528
Update provisioner enhancements from pull request feedback 2019-08-29 13:50:22 -07:00
Brian Cain 84bf9aefe9
Merge pull request #11036 from briancain/vagrantcloud/note-about-public-boxes
Add note about public boxes and release status for Vagrant Cloud
2019-08-29 09:25:45 -07:00
Brian Cain 4c35adafbe
Merge pull request #11029 from briancain/update-hashicorp-box
Update docs with newly supported hashicorp/bionic64 box
2019-08-29 09:25:32 -07:00
Brian Cain 07bcfc6077
Add error if both before and after options are set 2019-08-28 16:15:33 -07:00
Brian Cain 258ce7733c
Remove todo note from docs 2019-08-28 16:09:02 -07:00
Brian Cain fc8bf6aed4
Ensure a dependency provisioner isnt configured to rely on another dependency provisioner 2019-08-28 15:52:38 -07:00
Brian Cain f608c324e5
Update dependency provisioner docs 2019-08-28 15:09:48 -07:00
Brian Cain c192651e90
Make dependency provisioners experimental 2019-08-28 15:09:38 -07:00
Brian Cain 963319d938
Flip around action to be after dependency provisioner name 2019-08-28 14:39:42 -07:00
Brian Cain 160ee09da2
Cleanup sorting method for provisioner sorting 2019-08-28 14:32:51 -07:00
Brian Cain 8c39d9bfed
Add dependency provisioner name to error message 2019-08-28 14:30:32 -07:00
Brian Cain c1f0bd638d
Insert _at_ index, rather than before
Inserting at the right index places new item *before* the index, so no
need to decrement and then insert, since `insert` takes care of shifting
down elements of the array.
2019-08-28 14:11:25 -07:00
Brian Cain 5400af7a4a
Add note about dependency provisioner dependencies 2019-08-27 15:37:39 -07:00
Brian Cain 2677a721fb
Update provisioner basic usage with dependency provisioners 2019-08-27 15:11:14 -07:00
Brian Cain e56d2581ee
Add before/after all tests 2019-08-27 14:36:36 -07:00
Brian Cain 271d427c57
Fix bug in :each provisioner sorting
Ensure each provisioners are properly inserted into the final
provisioner array
2019-08-27 14:28:06 -07:00
Brian Cain f27cf9c84e
Update CHANGELOG 2019-08-27 14:04:47 -07:00
Brian Cain 75f1fde1e5
Merge pull request #11000 from ladar/master
Fix the hostname config logic for Alpine.
2019-08-27 14:03:31 -07:00
Ladar Levison 5fb9edd67b Functional/working unit tests for the alt linux guest plugin change hostname capability. 2019-08-27 23:00:36 +05:30
Ladar Levison 243ae0f368 Added service command to alt guest test. 2019-08-27 21:07:58 +05:30
Ladar Levison 7e4c4cd71a Merge remote-tracking branch 'upstream/master' 2019-08-27 20:32:31 +05:30
Ladar Levison 0671843ec0 Initial alt guest unit test attempt. 2019-08-27 20:31:12 +05:30
Brian Cain c189e4d255
Redo how each provisioners are sorted 2019-08-26 16:05:02 -07:00
Brian Cain 28ef368881
Begin to add tests for mixin provisioner 2019-08-26 12:03:36 -07:00
Brian Cain ebaacd524c
Add note about public boxes and release status for Vagrant Cloud 2019-08-23 08:34:10 -07:00
Brian Cain ef82c0a5bc
Move return earlier 2019-08-22 12:01:19 -07:00
Nick Fagerlund ba3aa81841 Update middleman-hashicorp container and Gemfile.lock
Time marches on, and so do security vulnerabilities in Nokogiri. So it's time
for a new container.

As with last time, here's a reminder for the next person who needs to update
this:

- You shouldn't just update the dependency in Gemfile.lock, because your build
  times will go to heck as you compile Nokogiri from source on every run. So you
  need an updated container with all the dependencies.
- To update the container, you need to push a new tag to the middleman-hashicorp
  repo. Teamcity does the rest, and will ship a new container to Docker Hub
  (unless its credentials are out of date, in which case go ask team-eng-serv.)
- Once that's pushed:
    - Update Makefile
    - Update the Gemfile
    - Delete Gemfile.lock
    - `make website` until it comes up, then ctrl-C
    - Commit the changes
2019-08-21 16:08:55 -07:00
Brian Cain be5964a1db
Add basic provisioner sorting 2019-08-21 14:44:16 -07:00
Brian Cain 6777493c46
Include before/after options in final provision hash 2019-08-20 11:31:00 -07:00
Brian Cain 6db03f2aed
Check if rejected entries are nil, not blank 2019-08-20 11:30:42 -07:00
Brian Cain d15bac7fb7
Validate that before/after provisioner exists in machines config 2019-08-19 14:48:06 -07:00
Brian Cain 8ecd32de53
Remove comment 2019-08-19 11:36:54 -07:00
Brian Cain 4933610398
Update rubydoc for before/after return types 2019-08-19 11:33:30 -07:00
Brian Cain 66aac23470
Properly set and validate before/after keys for base provisioner class 2019-08-19 11:23:06 -07:00
Brian Cain 725a13a292
Add note about Bento project with new box 2019-08-16 09:25:15 -07:00
Brian Cain 98f598632e
Update docs with newly supported hashicorp/bionic64 box 2019-08-14 10:48:33 -07:00
Dan Čermák eb9b478951
Add ipv6 network config templates for SUSE based distributions 2019-08-09 17:23:46 +02:00
Ricardo Aielo ae3ae5078f Memory set to 2GB to run tests with no Errno::ENOMEM 2019-08-08 19:11:52 -07:00
Ricardo Aielo 990bc107fa grep error suppressed in case .bash_profile does not exist 2019-08-08 15:55:46 -07:00
Ricardo Aielo 546cd90cea Removed explicit bundler install since there is no dependency in gemspec 2019-08-08 15:53:03 -07:00
Ricardo Aielo 068e348826 Next-to-last ruby to avoid unsupported version from gemspec 2019-08-08 15:42:45 -07:00
Ricardo Aielo 7167c9a2fe RVM installed with apt-get (ubuntu_rvm) 2019-08-08 15:31:14 -07:00
Ricardo Aielo 5dfbd20aa3 Box updated to ubuntu/bionic64 (18.04) 2019-08-08 15:25:34 -07:00
Brian Cain 28c0f6085c
Attempt to validate top scope provisioner options 2019-08-06 16:18:58 -07:00
Brian Cain e05437ddf2
Add validation method and todo 2019-08-06 15:28:04 -07:00
Brian Cain b82b33d204
Add new before/after options for the base Provisioner class
This commit adds two new options: before, after. These string options
refer to other named Provisioners.
2019-08-06 15:28:04 -07:00
Brian Cain 49ae77b2b8
Update doc string for :run option 2019-08-06 15:28:04 -07:00
Brian Cain 1dda6cc14c
Merge pull request #10998 from llsousa/master
Review ansible_local.html.md
2019-08-06 08:30:24 -07:00
Brian Cain d1f415a447
Merge pull request #11001 from phillxnet/patch-1
minor word change re box availability explanation
2019-08-05 08:26:13 -07:00
Philip Guyton 2973750018
minor word change re box availability explanation
Proposed minor re wording on website boxes catalog page.
2019-08-05 13:01:53 +01:00
Dan Čermák f056231deb
Bump rspec-its dependency 2019-08-05 11:25:20 +02:00
Ladar Levison 690963669c Added fall through logic with error messages if OS is unrecognized.
This will print an error message but still exit with 0 if an
ephemeral hostname change was made, which seems more defenisve,
and user friendly to me.
2019-08-03 20:59:41 +05:30
Ladar Levison 53323ba54e Fix the hostname config logic for Alpine.
And allow those who like `vagrant` to go
Alpine skiing!
2019-08-03 15:19:51 +05:30
Luís Sousa d93342cbbb
Merge pull request #1 from llsousa/llsousa-patch-1
Review ansible_local.html.md
2019-08-02 16:20:25 +01:00
Luís Sousa af5c752fb2
Review ansible_local.html.md 2019-08-02 16:18:20 +01:00
Brian Cain 89cf1e70c5
Update CHANGELOG 2019-07-30 09:18:44 -07:00
Brian Cain 3bde70fec1
Merge pull request #10975 from timschumi/patch/alpine-guest-plugin
Integrate the vagrant-alpine guest plugin
2019-07-30 09:17:42 -07:00
Tim Schumacher 39fb585295 alpine: Remove unneeded aliases in change_host_name 2019-07-26 08:32:36 +02:00
Tim Schumacher a7f09f010c alpine: Convert nfs_client capability to seperate commands
The workaround for the broken repository should be safe to be removed,
since the last affected Alpine version (<=3.3) EOL'd in November of 2017.

The remaining important commands can be split out into seperate calls
of sudo(), which removes the need for manual exit-code checking
(since it aborts by itself when a command fails) and makes the code
easier to handle in general.
2019-07-26 08:31:12 +02:00
Matt Shanahan 6caa7bfa86 Fixes issue hashicorp#10973: checks that VMMS WMI reference is null & throws appropriately 2019-07-19 07:48:03 +02:00
Tim Schumacher 77616b22b3 alpine: Use absolute paths for network configuration templates 2019-07-18 04:07:15 +02:00
Tim Schumacher 29362d8af4 alpine: Wire up tests 2019-07-18 03:36:50 +02:00
Tim Schumacher 3b03944331 alpine: Replace capability strings with symbols
Those were introduced upstream in b29864f450.
2019-07-18 03:35:48 +02:00
Tim Schumacher 2216d23048 alpine: Remove version and out-of-tree checks 2019-07-18 03:35:48 +02:00
Tim Schumacher fbffb41fc4 guests: Add unmodified alpine support plugin from maier
This has been available as `vagrant-alpine` in the plugin
repository so far.
2019-07-18 03:35:40 +02:00
Olle Jonsson 55b364f87b
gemspec: drop rubyforge_project, it is EOL 2019-07-14 14:09:54 +02:00
Brian Cain cca36d91ed
Merge pull request #10954 from morkot/fix-docs-formatting-ansible_local
website/docs: fix code formatting
2019-07-10 16:13:34 -07:00
morkot 2fd803cdc2 website/docs: fix code formatting
This change will fix formatting of the code blocks on page https://www.vagrantup.com/docs/provisioning/ansible_local.html
2019-07-08 18:22:50 +01:00
Chris Roberts 4ce8d84f7e
Merge pull request #10932 from Jonfor/patch-1
Fix the date of 2.2.5 release in changelog
2019-06-26 12:25:41 -07:00
Jonathan Forscher 75bc6a93ef
Fix the date of 2.2.5 release 2019-06-26 15:18:01 -04:00
Chris Roberts b200bfb398 Update version and changelog for new development 2019-06-26 06:43:30 -07:00
Chris Roberts b68ea5bd23 Update website download version to 2.2.5 2019-06-26 06:42:04 -07:00
Chris Roberts ae0d574e8a Release v2.2.5 2019-06-25 14:28:53 -07:00
Chris Roberts 8e59d9e159 Update the steps in the release document 2019-06-25 14:26:37 -07:00
Brian Cain 55019bc846
Merge pull request #10929 from briancain/add-suse-sudoers-website-docs
Fixes #10928: Include SUSE for sudoers entry with NFS
2019-06-25 11:00:43 -07:00
Brian Cain b16794c8ca
Fixes #10928: Include SUSE for sudoers entry with NFS
This commit includes the SUSE entry for passwordless sudo when mounting
shared folders with NFS.
2019-06-24 13:38:20 -07:00
Chris Roberts d490b0589f
Merge pull request #10926 from chrisroberts/f-no-local-loading
Fix plugin discovery loading when no data directory is available
2019-06-21 12:41:10 -07:00
Chris Roberts 7fbe8bcabc Fix plugin discovery loading when no data directory is available
If the local data directory is unavailable, there will be no local
file to use within the plugin manager. Check for local file before
returning result, otherwise just return an empty hash.
2019-06-21 11:15:39 -07:00
Chris Roberts 7c6b2963c3
Merge pull request #10911 from chrisroberts/f-plugin-loading
Support loading machine configuration without provider validation
2019-06-20 11:23:10 -07:00
Chris Roberts fef8316b3c
Merge pull request #10915 from laozc/fix-gp
Fix provider name not work when specified
2019-06-20 11:22:01 -07:00
Brian Cain 7a5de4030b
Update CHANGELOG 2019-06-20 08:13:11 -07:00
Brian Cain 181e356a23
Merge pull request #10917 from briancain/chef-install-check-update
Fixes #10912: Update chef install check for guests
2019-06-20 08:11:50 -07:00
Chris Roberts fed8bab0ff Fixing path construction for gem storage 2019-06-19 17:07:01 -07:00
Chris Roberts e61e82511d Update path used for file copy 2019-06-19 16:20:48 -07:00
Chris Roberts 263203e47c
Merge pull request #10921 from chrisroberts/new-circle
Update circle configuration
2019-06-19 15:56:36 -07:00
Chris Roberts 936934fd78 Install bsdtar before running tests 2019-06-19 15:31:43 -07:00
Chris Roberts 5e0f64d654 Only run tests that require bsdtar if it is available 2019-06-19 15:29:55 -07:00
Chris Roberts 2f2d1f9cb2 Fix docker test to not call docker executable 2019-06-19 11:59:09 -07:00
Chris Roberts f3e960141e Update circle configuration 2019-06-19 09:49:14 -07:00
Brian Cain 6e4eb66cb1
Fix windows binary check for chef provisioner 2019-06-17 14:06:03 -07:00
Brian Cain d55f8d3496
Fixes #10912: Update chef install check for guests
Prior to this commit, the chef_installed capability was looking for a
string that has recently changed in newer versions of chef. This commit
fixes that by instead just looking for the right version that was
configured for the chef client, rather than the specific string that
could change again in the future.
2019-06-17 11:02:57 -07:00
Brian Cain 7e0e7ff7e9
Update CHANGELOG 2019-06-17 08:22:54 -07:00
Brian Cain c3a96ace35
Merge pull request #10909 from briancain/fixup-bsd-nfs-exports
Fixes #10609: Properly set BSD options for /etc/exports
2019-06-17 08:21:29 -07:00
Brian Cain 75d42fed9d
Merge pull request #10902 from briancain/fixup-rsync-listener
Fixes #10895: Use relative paths to machines folder path for Listener
2019-06-17 08:20:37 -07:00
Brian Cain 89469511fc
Update CHANGELOG 2019-06-17 08:20:03 -07:00
Brian Cain 45b200e315
Update CHANGELOG 2019-06-17 08:18:55 -07:00
Brian Cain 5f0abd3d40
Merge pull request #10901 from briancain/ensure-empty-arrs-rsync-not-fail
Fixes #10869: Remove excludes if array is empty
2019-06-17 08:18:05 -07:00
Zhongcheng Lao caae214bf7 Fix provider name not work when specified
Provider name should be symbol in guess_provider.
2019-06-17 08:22:50 +08:00
Chris Roberts 9bae0a7094 Support loading machine configuration without provider validation
Allow Vagrantfile#machine_config to load properly when the requested
provider may not be currently available. Update the Environment to
utilize this when searching for plugin information to properly allow
box provided Vagrantfiles to define required plugins.
2019-06-14 11:50:06 -07:00
Brian Cain fc4e03d559
Fixes #10609: Properly set BSD options for /etc/exports
Prior to this commit, the BSD options for the /etc/exports file was not
properly set up in the correct order for a given entry. It was however
fixed for FreeBSD, but never for the original exports template. This
commit fixes that by unifying the BSD and FreeBSD templates.
2019-06-13 11:44:12 -07:00
Brian Cain 206ff9d4ca
Merge pull request #10907 from petems/minor_spelling_fixes
Minor spelling fixes
2019-06-13 08:14:14 -07:00
petems 68c3a906b1 Minor spelling fixes
`docker run    -v $(pwd):/scripts    --workdir=/scripts    nickg/misspell:latest    misspell -w -source=text website/`
2019-06-13 15:37:55 +01:00
Brian Cain 1b0148bc78
Fixes #10895: Use relative paths to machines folder path for Listener
Prior to this commit, the rsync helper expanded all exclude paths that
should be ignored to be full qualified and regexp escaped. However the
Listen gem expects these ignore paths to be relative to the path passed
into the listener, not a full path. This commit fixes that by using the
path given by the user for the `rsync__exclude` option
2019-06-11 14:58:42 -07:00
Brian Cain bf55e43460
Fixes #10869: Remove excludes if array is empty
Prior to this commit, if a user specified that their `rsync__excludes`
option was an empty array, Vagrant would treat that as if it included
options inside the array rather than ignoring it. This commit fixes that
by only adding the excludes option when it exists and is not empty.
2019-06-10 13:44:39 -07:00
Chris Roberts b2aa1b7b69 Update CHANGELOG 2019-06-05 14:02:47 -07:00
Chris Roberts bbd75ef25a
Merge pull request #10896 from chrisroberts/f-plugin-constraints
Properly generate dependency instance when multiple constraints provided
2019-06-05 14:01:48 -07:00
Chris Roberts 892a408b39 Update CHANGELOG 2019-06-05 14:01:19 -07:00
Chris Roberts b90d01377e
Merge pull request #10894 from chrisroberts/e-deps-system
Handle strict dependency enforcement when installed within system
2019-06-05 14:00:07 -07:00
Chris Roberts a0c03860b7 Update CHANGELOG 2019-06-05 13:59:38 -07:00
Chris Roberts 2507b68045
Merge pull request #10891 from chrisroberts/f-trigger-multithread
Update trigger abort behavior when running parallel actions
2019-06-05 13:58:44 -07:00
Chris Roberts 04083e7d07 Update CHANGELOG 2019-06-05 13:57:24 -07:00
Chris Roberts f5f89f72b7
Merge pull request #10889 from chrisroberts/f-local-plugins-boxfile
Support loading plugin information from nested Vagrantfiles
2019-06-05 13:56:29 -07:00
Chris Roberts 5a7afd1c16 Update CHANGELOG 2019-06-05 13:55:30 -07:00
Chris Roberts bbf8f05d75
Merge pull request #10884 from GregJPreece/feature/10506-machine-readable-status
#10506 - Machine Readable Global-Status
2019-06-05 13:54:47 -07:00
Chris Roberts 109214f89d Properly generate dependency instance when multiple constraints provided 2019-06-05 13:46:42 -07:00
Chris Roberts fd34ea657b Add test coverage on expected machine-readable output 2019-06-05 13:04:47 -07:00
Chris Roberts 07b9f39a54 Clean up gem sources modifications
Based on suggestions from @zenspider here:
3daf3e532d (r33408747)
2019-06-05 09:36:37 -07:00
Chris Roberts ce56739b29 Update bundler error text content 2019-06-05 09:14:37 -07:00
Brian Cain 382c7315c8
Update CHANGELOG 2019-06-05 07:59:23 -07:00
Brian Cain fb80e8da9f
Merge pull request #10890 from briancain/add-usability-check-for-docker-plus-tests
Add usability check for docker plus tests
2019-06-05 07:58:23 -07:00
Chris Roberts 062ef52816 Handle strict dependency enforcement when installed within system
When installed outside of the official installer and not running
within a bundler environment, properly activate core dependencies
and properly enforce constraints.
2019-06-05 07:45:07 -07:00
Greg J Preece 2f818c0e23 Removing unneeded .send() calls in machine output. 2019-06-04 21:35:37 -07:00
Greg J Preece ede2c295f4 bsdtar appears to be required for all Vagrant use. 2019-06-04 21:27:14 -07:00
Greg J Preece 8c03b5179a Correcting suggested VAGRANT_HOME location in dev. 2019-06-04 21:16:03 -07:00
Greg J Preece 33a228a8e2 Revert "Suppressing UI output in machine-readable mode"
This reverts commit f626c53af2.
2019-06-04 20:58:52 -07:00
Greg J Preece b57d467fa2 Revert "Updating unit tests w/ UI message suppression"
This reverts commit f25427869c.
2019-06-04 20:58:46 -07:00
Chris Roberts 88c675694a Update trigger abort behavior when running parallel actions
When the provider supports parallel actions and actions are being
run in parallel, do not immediately kill the process on failure.
Instead terminate the action thread and log the exit code. Once
all running actions have completed, the process will then exit
with the stored exit code.
2019-06-04 16:40:59 -07:00
Brian Cain b8b2111700
Remove unnecessary test from virtualbox context 2019-06-04 14:56:31 -07:00
Brian Cain bb6913e6e8
Fixup virtualbox provider tests for Travis 2019-06-04 14:43:13 -07:00
Brian Cain 74c89e5ec1
Add virtualbox provider rspec tests 2019-06-04 14:14:06 -07:00
Brian Cain 34e53a5a4b
Add docker provider class test
This commit introduces aa provider_test class for the Docker provider
2019-06-04 13:24:07 -07:00
Chris Roberts d0115de80e Update CHANGELOG 2019-06-04 11:35:51 -07:00
Chris Roberts 0cba5263ad
Merge pull request #10811 from chrisroberts/f-synced-folder-creds
Remove configuration information from SMB synced folder data
2019-06-04 11:33:33 -07:00
Chris Roberts ac8916341b
Merge pull request #10809 from FranklinYu/doc/expand-var
Mention variable expansion in documentation
2019-06-04 11:25:32 -07:00
Chris Roberts 50c4464d44 Support loading plugin information from nested Vagrantfiles
Since plugin installation happens when the environment is first
initialized, attempt to determine the provider in use and load
any box provided Vagrantfiles to include any plugin configuration
they may include.
2019-06-04 10:07:02 -07:00
Anders Kaseorg 7980178d19 providers/docker: Add usability test
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-05-30 13:13:43 -07:00
Greg J Preece f25427869c Updating unit tests w/ UI message suppression 2019-05-30 09:17:30 -07:00
Greg J Preece f626c53af2 Suppressing UI output in machine-readable mode 2019-05-30 08:39:49 -07:00
Greg J Preece 2088bfb60d Adding note to README re: bsdtar dependency 2019-05-29 20:31:18 -07:00
Greg J Preece 731f249c50 Machine ID output should be 7 characters. 2019-05-29 11:10:33 -07:00
Greg J Preece c6a6fd34a3 Adding machine-readable output to global-status 2019-05-29 10:48:38 -07:00
Greg J Preece a6f0d24f68 Documenting local Vagrant vs package Vagrant. 2019-05-28 18:12:23 -07:00
Brian Cain b3877f4b2c
Merge pull request #10855 from briancain/remove-aws-mention-for-guide
Replace AWS provider in getting started guide with Hyper-V
2019-05-24 09:16:22 -07:00
Brian Cain 3357d7060e
Merge pull request #10858 from briancain/chef-common-docs-navbar
Fixes #10856: Add common chef config options to nav bar
2019-05-24 09:15:53 -07:00
Brian Cain f8eca3f7cf
Update CHANGELOG 2019-05-24 09:14:24 -07:00
Brian Cain f8eaa41b7e
Merge pull request #10854 from briancain/fixup-typed-trigger-actions
Ensure guest names are string when filtering trigger configs
2019-05-24 09:13:43 -07:00
Brian Cain 5ff47b5d69
Update CHANGELOG 2019-05-21 08:29:34 -07:00
Brian Cain 73e3465b47
Merge pull request #10841 from wzur-r3/patch-1
Search for running_vm_list only in `machines` folder
2019-05-21 08:28:36 -07:00
Brian Cain be7876d836
Merge pull request #10860 from issyl0/add_sidebar_link_to_upload_page
Link to the "upload" docs page from the docs sidebar
2019-05-14 13:51:28 -07:00
Isabell (Issy) Long a0e1062819
Link to the "upload" docs page from the docs sidebar
- Fixes #10837.
2019-05-14 20:11:18 +01:00
Brian Cain a8783d6703
Fixes #10856: Add common chef config options to nav bar
This commit updates the provisioner nav bar on the docs website to
include the common chef configuration documentation. This makes these
options more discoverable, as before it was hidden in a URL link inside
of the other chef docs.
2019-05-14 09:58:14 -07:00
Brian Cain b1f14087e5
Replace AWS provider in getting started guide with Hyper-V
The vagrant-aws provider doesn't really make sense anymore to be
mentioned in the getting started guide for providers. Instead, replace
it with the Hyper-V provider.
2019-05-13 14:25:00 -07:00
Brian Cain eb3e309f89
Ensure guest names are string when filtering
Prior to this commit, if a guest name was given as a symbol, the
filter_triggers method would fail to properly match it with the only_on
option, as it is not a valid type to the #String.match method. This
commit fixes that by converting the parameter to a string so that it can
be properly matched on the guest.
2019-05-13 14:07:22 -07:00
Brian Cain 57c4de49f2
Remove "command" string from logger
Since not all triggers are commands, removing the word `command` from
the logger so it is not confused with other types of triggers.
2019-05-13 13:26:47 -07:00
Brian Cain e91a1aadc4
Merge pull request #10849 from pjl/fix-snapshot-delete-documentation
Add vm-name option to snapshot documentation
2019-05-13 09:53:32 -07:00
Brian Cain 28bbd10689
Merge pull request #10812 from mrgnw/patch-1
Prevent nopasswd issues, add vagrant entries at end of sudoers
2019-05-13 09:15:29 -07:00
Perry Lee 017c793f90 Add vm-name option to snapshot documentation 2019-05-10 16:49:20 -07:00
Morgan Williams d1373c9e97 Single paragraph: order matters in sudoers
Single paragraph about how the suoders file format applies these rules in order of entry
2019-05-09 21:49:58 -04:00
Morgan Williams a09ad31db4 Revert " Recommend adding lines to end of sudoers, ensuring %admin and root exist "
This reverts commit 36420ce82b.
2019-05-09 21:46:01 -04:00
Waldemar Żurowski a2a848285c
Search for running_vm_list only in `machines` folder
otherwise it might catch a non-machine id, in my case, for hostmanager plugin
2019-05-09 18:07:23 +01:00
Brian Cain 917aab0552
Update CHANGELOG 2019-05-08 09:33:51 -07:00
Brian Cain 93497b8ca3
Merge pull request #10829 from briancain/box-update-continue
Continue updating environment boxes if metadata not found
2019-05-08 09:32:58 -07:00
Brian Cain f7de9c3bcb
Update CHANGELOG 2019-05-08 09:18:06 -07:00
Brian Cain 237209d6e4
Merge pull request #10828 from briancain/snapshot-list-ux-fixup
Separate snapshot names when listing snapshots
2019-05-08 09:17:06 -07:00
Brian Cain fbbdf45dae
Update CHANGELOG 2019-05-08 09:16:39 -07:00
Brian Cain 86800421db
Merge pull request #10824 from briancain/exit-process-on-abort-triggers
Fixes #10823: Use Process.exit! for abort trigger option
2019-05-08 09:15:51 -07:00
Brian Cain 18f2eee392
Update CHANGELOG 2019-05-08 09:15:18 -07:00
Brian Cain a613044baf
Merge pull request #10820 from briancain/docker-compose-volumes
Fixes #10798: Enhance how docker compose driver path expands
2019-05-08 09:14:33 -07:00
Brian Cain a7f72d29ca
Merge pull request #10814 from briancain/install-link-for-share-docs
Fixes #10813: Add install link docs to Share tutorial
2019-05-08 09:13:53 -07:00
Brian Cain beb9572a9c
Update CHANGELOG 2019-05-08 09:13:33 -07:00
Brian Cain 9a0fa8c061
Merge pull request #10803 from briancain/ensure-gemrc-set
Set gemrc through configuration method rather than relying on environment variable
2019-05-08 09:12:11 -07:00
Brian Cain e2d017b219
Continue updating environment boxes if metadata not found
Prior to this commit, if a user ran a `vagrant box update` on their
entire environment and one of the boxes did not have a metadata file,
the rest of the boxes in the update would be skipped. This commit fixes
that by ignoring those boxes and showng a warning, so that the rest of
the boxes could check for updates.
2019-05-08 09:04:45 -07:00
Brian Cain ca232444e7
Separate snapshot names when listing snapshots
Prior to this commit, Vagrant would list all machine snapshots in a flat
list, without showing which snapshots were associated with which guests.
This commit fixes that by placing some separation to make it clear which
snapshots belong to which guests.
2019-05-06 11:09:34 -07:00
Brian Cain 35ee3e2342
Fixes #10823: Use Process.exit! for abort trigger option
Prior to this commit, the `abort` option for triggers would just call
`exit`, which would end up raising a SystemExit exception, signaling
Vagrant to abort. This broke down however in a multithreaded context
like when running multiple guests at once on supported providers,
resulting in Vagrant failing to exit cleanly and instead raise an
exception. This commit changes that by instead using `Process.exit!` to
abort Vagrant.
2019-05-03 14:48:54 -07:00
Brian Cain ca0fd64ded
Fixes #10798: Enhance how docker compose driver path expands
Prior to this commit, the docker compose driver would _always_ path
expand a host volume no matter what. This is not always the correct
option, for example if that host volume is actually a reference to a key
inside a `volumes` hash instead of a path on disk. This commit changes
that by looking to see if the requested host volume is actually a
defined key inside the compose config, and if not, it will path expand
it like before. Otherwise it will leave the key "as is".
2019-04-29 16:14:37 -07:00
Brian Cain b693da4a2f
Fixes #10813: Add install link docs to Share tutorial
This commit adds a note and link on how to install vagrant-share before
the vagrant share tutorial starts. This ensures that users know they
need the plugin installed since it no longer comes with Vagrant core.
2019-04-26 08:21:26 -07:00
Morgan 36420ce82b
Recommend adding lines to end of sudoers, ensuring %admin and root exist
Adding entries to the end of sudoers is an easy way to prevent issues and ensure NOPASSWD functionality works as expected.
2019-04-25 16:56:56 -04:00
Chris Roberts e7e8a39c55 Stub the ssh path used for exec
Since a full path to the ssh executable is being used and is expected
at a specific location, default to providing that location when looking
up the executable. This prevents errors from occurring when a host
system provides an `ssh` match at a different path.
2019-04-25 10:44:25 -07:00
Chris Roberts 5b94bbb49b Scrub folder configuration data when persisting to disk
Before writing synced folder configuration data to the local
data directory run content through the credential scrubber to
remove any sensitive content before write.
2019-04-25 10:31:48 -07:00
Chris Roberts 92e6a29bfc Update naming in tests as instance methods are being referenced 2019-04-25 10:09:50 -07:00
Chris Roberts b493503e09 Scrub SMB credential information from folder configuration
This prevents credential information from being persisted into the
local data directory which is used during subsequent runs to determine
folder definition changes.
2019-04-25 10:07:48 -07:00
Brian Cain c22a145c59
Update CHANGELOG 2019-04-25 08:44:49 -07:00
Brian Cain 15c7fc23ce
Merge pull request #10810 from alex-goncharov-usa/fix-box-update-version-sort
Fix box version sort in Update.update_specific
2019-04-25 08:41:41 -07:00
Alex Goncharov 9266899b34 Add a test for version selection for a box update 2019-04-24 19:59:37 -04:00
Alex Goncharov b75768fc56 Fix box version sort in Update.update_specific 2019-04-24 18:57:34 -04:00
Franklin Yu 13a959312d
Mention variable expansion in documentation 2019-04-24 17:13:17 -04:00
Brian Cain 757175b94e
Add note about removing patch fix and add test 2019-04-22 10:36:25 -07:00
Brian Cain e2097be55e
Fixes #10800, Fixes #9148: Ensure rubygems is loading gemrc properly on Windows
Prior to this commit, when Vagrant attempted to use the Gem library, it
would attempt to pass in a gemrc through an environment variable that
the rubygems library would try to split and parse. This is normally
fine, as the method in question would return empty if that file did not
exist. However if the user had a file that matches the drive that
Vagrant was installed on, rubygems would fail saying the folder was not
a file (or a gemrc, in this case).

This commit works around that by instead configuring the gemrc location
through ruby with `Gem.configuration`.

Related rubygems issue
[#2733](https://github.com/rubygems/rubygems/issues/2733)
2019-04-19 17:07:49 -07:00
Brian Cain ad342e2bf0
Merge pull request #10792 from briancain/make-env-var-docs-clearer
Reword documentation for VAGRANT_DISABLE_VBOXSYMLINKCREATE option
2019-04-15 09:11:51 -07:00
Brian Cain e0cd29e301
Fixup docs for environment variable 2019-04-12 15:48:31 -07:00
Brian Cain cb69836fb7
Reword documentation for VAGRANT_DISABLE_VBOXSYMLINKCREATE option
Follow-up from #10790
2019-04-12 15:40:10 -07:00
Brian Cain cd3909d7ce
Update CHANGELOG 2019-04-09 15:13:17 -07:00
Brian Cain 139ae4397f
Merge pull request #10625 from vdebroy/fix-issue-9584
Fix issue 9584
2019-04-09 15:12:02 -07:00
Brian Cain 114775475c
Update CHANGELOG 2019-04-09 15:11:36 -07:00
Brian Cain 8e9578cf5d
Merge pull request #10752 from chrisroberts/f-coreos-guest-caps
Update guest capabilities for coreos
2019-04-09 15:10:58 -07:00
Brian Cain 3a81a92db7
Update CHANGELOG 2019-04-09 15:05:11 -07:00
Brian Cain 8109433885
Merge pull request #10784 from briancain/fixup-snapshot-list-virtualbox
Ensure non-existent machines do not attempt to list snapshots
2019-04-09 15:03:50 -07:00
Brian Cain 46e42ed884
Move up doc string for `vagrant snapshot pop`
This commit moves up the doc string for the command `vagrant snapshot
pop` Prior to this commit it was hidden in between command line flags.
2019-04-09 13:14:44 -07:00
Brian Cain 75d4aa42a1
Ensure non-existent machines do not attempt to list snapshots
Prior to this commit, if a snapshot restore was run on an entire
environment with some non-existent guests, Vagrant would attempt to list
their snapshots with a nil id. This commit fixes that by returning an
empty list of snapshots if the machine has not been created yet.
2019-04-09 13:11:19 -07:00
Brian Cain 1fe8712ec2
Merge pull request #10772 from briancain/fixup-provision-shell-docs
Remove *I* from documentation
2019-04-02 10:18:04 -07:00
Brian Cain 872c036686
Remove *I* from documentation
Removing I since it does not really make sense while reading the
documentation.
2019-04-01 16:18:29 -07:00
Brian Cain 5254ed4ae0
Update CHANGELOG 2019-03-29 09:48:49 -07:00
Brian Cain 84e348bfab
Merge pull request #10763 from jlduran/freebsd-simplify-interfaces-list
FreeBSD: Simplify the listing of interfaces
2019-03-29 09:48:11 -07:00
Jose Luis Duran 93f02c67f8
FreeBSD: Simplify the listing of interfaces
According to ifconfig(8), to list only Ethernet interfaces, excluding
all other interface types, including the loopback interface, the command
to use should be:

    ifconfig -l ether

Related to: #8760
2019-03-29 02:47:39 -03:00
Brian Cain 6edcf12979
Merge pull request #10762 from abh23/patch-1
note for pre-requisite of ngrok package
2019-03-28 09:37:31 -07:00
Brian Cain 3d69bfaceb
Update CHANGELOG 2019-03-28 08:44:51 -07:00
Brian Cain 3cb3c91654
Merge pull request #10761 from jlduran/follow-linux-naming-convention
BSD: VirtualBox shared folders naming convention
2019-03-28 08:43:48 -07:00
Amit Bhardwaj 33c1ebf84b
note for pre-requisite of ngrok package
Current version of vagrant-share works only with ngrok installed. Just added a note for the same.
2019-03-28 14:27:39 +05:30
Jose Luis Duran 1cf0e62400
BSD: VirtualBox shared folders naming convention
This is a follow-up of #10717 to use the same naming convention as on
Linux guests, in order to reduce the diffs.

Also adds the missing capability to `unmount_virtualbox_shared_folder`
on FreeBSD guests.
2019-03-28 02:34:34 -03:00
Brian Cain 3da2270366
Update CHANGELOG 2019-03-25 15:44:27 -07:00
Brian Cain ec67151312
Merge pull request #10702 from briancain/docker-network-support
Docker Provider Network Support
2019-03-25 15:43:23 -07:00
Chris Roberts 8339e63423 Fix subnet to ip_range and add gateway information for public networks 2019-03-25 15:26:18 -07:00
Chris Roberts 1e856ecf8a Add information on public_network for docker provider 2019-03-25 15:13:19 -07:00
Brian Cain 1a596e26ab
Merge pull request #10747 from rconde-bt/master
Fixed typos: vargant->vagrant
2019-03-25 14:03:50 -07:00
Brian Cain f4c6aa8aa1
Update docker provider networking docs from pull request feedback 2019-03-25 13:25:49 -07:00
Brian Cain a8733e2800
Merge pull request #10758 from briancain/update-license-year
Update year on LICENSE
2019-03-25 10:39:18 -07:00
Brian Cain dd782294f4
Update year on LICENSE 2019-03-25 10:21:32 -07:00
Chris Roberts 0575fdfd69 Do not rely on IPAddr#prefix as it's not available on older rubies 2019-03-22 16:42:30 -07:00
Brian Cain d9f3f88ff0
Update CHANGELOG 2019-03-22 16:31:20 -07:00
Brian Cain 53c11d9b55
Merge pull request #10748 from briancain/fix-ui-prefix-typo
Fix typo in UI Prefix for trigger UI
2019-03-22 16:30:38 -07:00
Chris Roberts 8ba69e587c Update guest capabilities for coreos 2019-03-22 15:20:37 -07:00
Brian Cain 9d200bdb72
Add note about specific create and connect flag options for Vagrant 2019-03-22 13:50:13 -07:00
Brian Cain 979dd37e46
Remove comment about private networks only working with docker provider 2019-03-22 10:10:44 -07:00
Brian Cain f8744b66f0
Add connect cli argument tests 2019-03-22 09:24:26 -07:00
Brian Cain 4f80a9e6d5
Add test for requesting public ip range for docker network provider 2019-03-22 09:02:40 -07:00
Brian Cain 36f2aaf55e
Add test for public network gateway request 2019-03-22 08:45:14 -07:00
Brian Cain b56f89775d
Add more mocks for public network
Ensure test values are used rather than real values from machine
2019-03-22 08:24:22 -07:00
Brian Cain 6bffdca972
Add beginning of connect network tests for docker provider 2019-03-21 16:06:24 -07:00
Brian Cain 88a18fe2c5
Add public network tests for docker provider 2019-03-21 16:06:11 -07:00
Brian Cain 82700d95b3
Ensure subnet is used if specified from user config options 2019-03-21 15:29:04 -07:00
Brian Cain 2bc6fa854a
Add tests for validating network configurations 2019-03-21 13:51:24 -07:00
Brian Cain 36a41957c9
Fix travis ci tests for public gateway and ip range issues 2019-03-21 13:51:07 -07:00
Brian Cain 98e41eb936
Mock out public/private network calls for existing subnet tests 2019-03-21 13:26:37 -07:00
Brian Cain 32807d70c7
Mock up public/private network calls for #call test 2019-03-21 13:03:39 -07:00
Brian Cain 8c169714c5
Ensure variable names exist in method 2019-03-21 11:39:16 -07:00
Brian Cain 6ce453ab70
Delete old file and add blank describe blocks for remaining tests 2019-03-21 11:16:26 -07:00
Brian Cain 96a19aa00c
Fix how options to cli args are handled
Since options could also be defined as strings, convert it all to string
and compare those instead
2019-03-21 11:15:41 -07:00
Brian Cain 5215354d16
Fix missing docker error classes, and finish out initial #call tests 2019-03-21 10:50:45 -07:00
Brian Cain ee985f9f7f
Fix typo in UI Prefix for trigger UI 2019-03-21 10:11:38 -07:00
Robert Conde b43f5db876 Fixed typos: vargant->vagrant 2019-03-21 12:58:42 -04:00
Brian Cain 75d6c17386
Fix up call method and add todo for prepare networks 2019-03-20 16:41:42 -07:00
Chris Roberts 1220122b46 Update CHANGELOG 2019-03-20 15:58:24 -07:00
Chris Roberts b1d8b952bb
Merge pull request #10745 from chrisroberts/f-net-sftp-comms
Remove require of net/sftp library
2019-03-20 15:57:21 -07:00
Chris Roberts bbb971ee98 Update CHANGELOG 2019-03-20 15:49:34 -07:00
Chris Roberts 2d5091a985
Merge pull request #10713 from renatoaguiar/fix-void-nfs
Fix NFS capability detection on Void Linux
2019-03-20 15:48:46 -07:00
Chris Roberts 7a6e545b6c Update CHANGELOG 2019-03-20 15:48:14 -07:00
Chris Roberts 0462da57c4
Merge pull request #10727 from chrisroberts/f-empty-id-file
Remove whitespace from id file on load
2019-03-20 15:47:14 -07:00
Brian Cain 1027636e41
Split up and rename unit tests for docker network operations 2019-03-20 15:14:39 -07:00
Brian Cain eb75431c4a
Update docker driver and docker driver unit tests 2019-03-20 14:50:28 -07:00
Brian Cain c09bce5386
Fixup docker action destroy_network test 2019-03-20 13:35:46 -07:00
Chris Roberts 3ca8089920 Remove require of net/sftp library
Fixes #10733
2019-03-20 13:02:08 -07:00
Chris Roberts 623a1815ae Allow use of subnet option when defining private network with dhcp type 2019-03-19 14:35:40 -07:00
Chris Roberts 670bef6596 Allow custom subnet to be provided when private network type is dhcp 2019-03-19 14:20:14 -07:00
Chris Roberts afb6c20581 Fix option mask to be expected netmask 2019-03-19 14:03:03 -07:00
Chris Roberts a1c7eec441 Include synchronization as the environment lock is per process only 2019-03-19 13:46:14 -07:00
Chris Roberts a645ce3c25 Docker provider networking support updates
Use `mask` option for defining subnet on network configuration. Allow
options to be passed through using hash scoping and docker_network and
docker_connect prefixes. Enable public networks. Allow configuration
to define pre-existing networks by name.
2019-03-19 11:44:33 -07:00
Chris Roberts 1224622387 Remove container inspection caching and Exception rescue
Container inspection is caching data on first lookup. This will
result in incorrect data being returned on subsequent lookups if
a different `cid` value is provided. Also removed rescue of
the `Exception` class as this generally should never happen; rescue
of StandardError will be enough.
2019-03-19 11:44:22 -07:00
Chris Roberts c251e090b3 Remove Mutex for synchronization. Environment#lock satisfies requirement. 2019-03-19 11:44:02 -07:00
Brian Cain 4e4e03d7fd
Merge pull request #10742 from rockhopper72/fix-typo-in-wsl
Fix formatting issues on WSL docs
2019-03-19 09:05:06 -07:00
rockhopper72 9678e93a27 Fix formatting issues on WSL docs
- Insert underline to fix **bold** formatting
- Remove grave accent to fix `code` highlighting
2019-03-19 09:03:24 -04:00
Brian Cain 6664936c0b
Make ignored vagrant network options a constant 2019-03-12 10:40:58 -07:00
Brian Cain 5ed5868067
Inspect networks before creating new ones
This commit updates the behavior of how the docker provider creates new
docker networks. It looks at each existing network to see if the
requested subnet has already been configured in the docker engine. If
so, Vagrant will use that network rather than creating a new one. This
includes networks not created by Vagrant. Vagrant will not clean up
these networks if created outside of Vagrant.
2019-03-12 10:36:57 -07:00
Chris Roberts 1c650a7fb8 Remove whitespace from id file on load
If the id file includes whitespace, remove it. If the content of
the id file is empty, do not set the machine id.

Fixes: #10722
2019-03-11 17:08:13 -07:00
Brian Cain 1e1c398de5
Update CHANGELOG 2019-03-11 15:08:26 -07:00
Brian Cain e399aeaf70
Merge pull request #10717 from briancain/add-vbox-share-folders-bsd
Add proper VirtualBox share folders support for FreeBSD guests
2019-03-11 15:07:17 -07:00
Brian Cain b4a21617d1
Update CHANGELOG 2019-03-11 15:05:55 -07:00
Brian Cain 11e6ea3a76
Merge pull request #10726 from briancain/improve-cloud-cli-doc-strings
Fixes #10723: Fix bug instance var in Vagrant Cloud CLI optparse
2019-03-11 15:04:55 -07:00
Brian Cain 5b3c6b8ad4
Fixes #10723: Fix bug instance var in Vagrant Cloud CLI optparse
This commit uses the correct instance variable for the optparse library
when reading in the command line flags for various Vagrant Cloud CLI
commands.
2019-03-11 14:21:55 -07:00
Brian Cain 2f0c66f832
Only enable shared folder mounts on freebsd guests
Since the virtualbox guest additions seem to only be available for
freeBSD, move the shared folder functionality over to freebsd guests
rather than all BSD guests.
2019-03-08 11:03:23 -08:00
Brian Cain b2251d5bec
Update logger to display vboxvfs module rather than vboxsf
Ensure the logger displays the right vbox module used for mounting
shared folders
2019-03-07 10:49:38 -08:00
Brian Cain fe002b7e48
Add unit tests for virtualbox shared folders 2019-03-07 10:35:37 -08:00
Brian Cain 0bfca8293a
Update from vboxsf to vboxvfs
BSD guests use vboxvfs module for mounting share folders
2019-03-07 10:35:37 -08:00
Brian Cain 554b096961
Fixes #8884: Introduce proper VirtualBox shared folders for BSD
This commit adds proper VirtualBox shared folder support for BSD guests.
It is essentially a copy of the linux capability.
2019-03-07 10:35:37 -08:00
Brian Cain 2c25cf8d01
Add note about network creation in docker provider 2019-03-05 13:46:05 -08:00
Brian Cain cedf5aff17
Add note about link legacy flag in connect 2019-03-05 11:23:23 -08:00
Brian Cain 93f833d2b3
Add docs page about networking with the docker provider 2019-03-05 11:18:35 -08:00
Brian Cain b78dada2c7
Fix docker driver handling cli flags
Make opts argument set to nil instead of splat to make Travis Ruby 2.3
happy
2019-03-05 10:57:05 -08:00
Renato Aguiar 4de7716ffb Fix NFS capability detection on Void Linux 2019-03-05 10:03:52 -08:00
Brian Cain 2be0bc2d81
Add unit tests for docker network actions 2019-03-05 09:49:15 -08:00
Brian Cain cccbedf4ce
Update how docker network handles processing options to cli arguments
Add an "ignored option" array rather than a big if-statement expression
2019-03-04 14:19:40 -08:00
Brian Cain 953a380371
Fix how Vagrant assigns cli arguments for the create command
This commit inlines the flag assignments so that arguments are properly
assigned to flags rather than arguments to the subcommand.
2019-03-04 13:44:21 -08:00
Brian Cain efb9fd7b65
Move strings into locales file 2019-03-04 13:33:08 -08:00
Brian Cain a1b48ed1bb
Raise proper class if invalid options given for docker network 2019-03-04 13:17:14 -08:00
Chris Roberts fbe44f1f48 Update CHANGELOG 2019-03-04 13:07:07 -08:00
Chris Roberts 5dc504b12c
Merge pull request #10706 from chrisroberts/e-package-metadata
Write metadata file to box contents during package
2019-03-04 13:06:24 -08:00
Chris Roberts 5660d078a8 Update CHANGELOG 2019-03-04 13:05:50 -08:00
Chris Roberts a941ff40c4
Merge pull request #10707 from steve-simpson/bsdtar_fix_issue_10705
Added --no-same-owner & --no-same-permissions flags to bsdtar in box_…
2019-03-04 13:04:47 -08:00
Brian Cain 0b28580105
Move out cli argument generation to own function 2019-03-04 10:33:24 -08:00
Brian Cain 81fa7036be
Rename cli argument method 2019-03-04 10:28:49 -08:00
Brian Cain 6c7c74be5a
Fix if statement from `=` to `==` 2019-03-04 10:28:05 -08:00
Brian Cain 4080f9e64d
Log warning if docker network inspect fails to return json 2019-03-04 10:25:10 -08:00
Brian Cain 5adffb608d
Only allow private_network for docker network provider 2019-03-01 16:34:43 -08:00
Brian Cain 29696b0f73
Allow for ipv6 networks in docker 2019-03-01 16:20:16 -08:00
Brian Cain 000457a012
Update how docker network provider creates networks
This commit updates the docker network provider to only create networks
by subnet rather than per-container.
2019-03-01 16:07:53 -08:00
steve-simpson 7b3ca04a6e Added --no-same-owner & --no-same-permissions flags to bsdtar in box_collection.rb 2019-03-01 18:02:37 +00:00
Brian Cain c20de9044d
Log information if unsupported docker network option is provided 2019-03-01 08:34:43 -08:00
Brian Cain 4a0f1a0a33
Update docker network action to auto-generate cli flags
This commit updates the docker network behavior to auto-generate the
docker network command flags from Vagrants network config option.
2019-03-01 08:34:43 -08:00
Brian Cain b5a092397f
Add new function for handling vagrant options to docker network cli
flags
2019-03-01 08:34:43 -08:00
Brian Cain ba2a1224e0
Update driver to include network tests 2019-03-01 08:34:43 -08:00
Brian Cain dc5f8c66f2
Add todo comment for future fixup 2019-03-01 08:34:43 -08:00
Brian Cain 4dc5f7c330
Add basic ability to configure some networks for containers 2019-03-01 08:34:43 -08:00
Brian Cain e860c7709d
Begin to setup and configure docker networks for containers 2019-03-01 08:34:43 -08:00
Brian Cain 8013d8d5ef
Move around Network setup action for docker provider 2019-03-01 08:34:43 -08:00
Brian Cain 63ba0f9964
Add DestroyNetwork action to docker provider 2019-03-01 08:34:43 -08:00
Brian Cain 349cc5ddac
Add placeholder network destroy action for docker 2019-03-01 08:34:43 -08:00
Brian Cain a336aa687c
Add logger and start to iterate over networks in config 2019-03-01 08:34:43 -08:00
Brian Cain bed653eeb4
Autoload and use Network action on up 2019-03-01 08:34:43 -08:00
Brian Cain 67ea15126d
Make opts var optional for docker driver methods 2019-03-01 08:34:43 -08:00
Brian Cain 627251a307
Add basic docker network action 2019-03-01 08:34:43 -08:00
Brian Cain ec2e0380ee
Add basic docker driver methods for `docker network` subcommand 2019-03-01 08:34:43 -08:00
Chris Roberts c0eaac791d Write metadata file to box contents during package
If the provider does not include a metadata.json file prior to
compressing the box, determine current provider and write
metadata.json file before compressing.
2019-02-28 15:31:49 -08:00
Chris Roberts b4d87e6ce9 Update version for dev 2.2.5.dev 2019-02-27 07:38:22 -08:00
Chris Roberts 521d3fa20f Update download version to 2.2.4 2019-02-27 07:37:03 -08:00
Chris Roberts 25e11650c3 Release v2.2.4 2019-02-27 07:35:56 -08:00
Chris Roberts ddd1e5f8c2 Update CHANGELOG 2019-02-26 14:11:46 -08:00
Chris Roberts 927364652f
Merge pull request #10595 from danowar2k/master
- FIX for #10594
2019-02-26 14:09:31 -08:00
Chris Roberts db0f215d42 Update CHANGELOG 2019-02-26 13:32:22 -08:00
Brian Cain a5f5d533bf
Update CHANGELOG 2019-02-26 13:30:37 -08:00
Brian Cain 1592c0c216
Merge pull request #10690 from briancain/cleanup-rsync-tmp-folders
Cleanup rsync tmp folders
2019-02-26 13:25:34 -08:00
Chris Roberts 6beb736190
Merge pull request #10698 from chrisroberts/f-scp
Update communicator upload behavior to handle `/.` path directives
2019-02-26 13:24:40 -08:00
Brian Cain 3b540e502f
Force removal of rsync tmp dir
Force delete entry to prevent any potentail failures when trying to
clean up the tmp dir from rsync
2019-02-26 09:08:56 -08:00
Chris Roberts e2b6a6645c Always ensure remote destination directory exists 2019-02-26 08:54:49 -08:00
Chris Roberts 6b105d704d Update communicator upload behavior to handle `/.` path directives
This update was prompted by updates in openssh to the scp behavior
making source directory paths suffixed with `.` no longer valid
resulting in errors on upload. The upload implementation within
the ssh communicator has been updated to retain the existing
behavior.

Included in this update is modifications to the winrm communicator
so the upload functionality matches that of the ssh communicator
respecting the trailing `.` behavior on source paths. With the
communicators updated to properly handle the paths, the file
provisioner was also updated to simply apply previously defined
path update rules only.

Fixes #10675
2019-02-26 08:02:09 -08:00
Brian Cain 401a571642
Add windows platform test for ensuring tmp file does not exist 2019-02-22 12:44:46 -08:00
Brian Cain 45ca16ffd5
Add rsync helper test for linux machines 2019-02-22 12:38:23 -08:00
Andrew Eikum 7517faa9ee
Remove tmpdir after rsync completes 2019-02-22 12:24:13 -08:00
Brian Cain 1d25480e23
Update CHANGELOG 2019-02-22 10:51:45 -08:00
Brian Cain 52edbedebf
Merge pull request #10686 from briancain/move-middleware-auth-to-cloud-namespace
Fixes #10682: Move over AddAuthentication middleware and hooks
2019-02-22 10:51:02 -08:00
Brian Cain cdcedb0a9e
Fixes #10682: Move over AddAuthentication middleware and hooks
Prior to this commit, the AddAuthentication hooks still existed in a
deprecated class LoginCommand. This commit fixes that by moving it over
to the vagrant cloud cli namespace instead.
2019-02-21 09:42:16 -08:00
Brian Cain 4bf3f6f80a
Update CHANGELOG 2019-02-20 11:05:05 -08:00
Brian Cain 31b9aafcf7
Merge pull request #10622 from mattin4d/master
Change remaining box_client_cert refs to box_download_client_cert
2019-02-20 11:03:49 -08:00
Brian Cain cee88dad81
Merge pull request #10676 from cemderin/add-validate-parameter-to-docs
Add `vagrant validate` parameters to docs
2019-02-19 09:57:19 -08:00
Cem Derin aa60cb1f8f Add `vagrant validate` parameters to docs 2019-02-17 12:54:05 +01:00
Vidroha Debroy aacb453a79 Fixing bug I introduced. Thanks @chrisroberts! 2019-02-15 14:53:56 -06:00
Vidroha Debroy 7c0ffe369a Updated based on recommended changes per review. 2019-02-15 12:14:37 -06:00
Brian Cain a38b0898ce
Merge pull request #10671 from briancain/err-msg-for-bad-version
Fixes #10663: Ignore boxes in collection with malformed version numbers
2019-02-14 16:16:22 -08:00
Brian Cain 6b9cdb4e48
Fixes #10663: Ignore boxes in collection with malformed version numbers
Prior to this commit, if a box some how got on disk that had an
incorrect or invalid version number that did not match Gem::Version,
Vagrant would throw an exception when attempting to generate a list of
the boxes on disk. This commit fixes that by looking at the version from
the path generated, and shows a warning to the user about the box and
skips it from the list so they at least know about the problematic box
and can still get a list of boxes.
2019-02-14 15:30:11 -08:00
Chris Roberts 7bfb41e71d Update CHANGELOG 2019-02-12 16:36:03 -08:00
Chris Roberts 81a7939a76
Merge pull request #10666 from chrisroberts/f-sigint-trap-err
Wrap output in thread when being called from within trap-context
2019-02-12 16:34:49 -08:00
Chris Roberts 68e1425e14
Merge pull request #10665 from chrisroberts/f-vmware-util-doc
Update path for manual vagrant-vmware-utility installation
2019-02-12 16:27:12 -08:00
Chris Roberts 7e47602e3d Wrap output in thread when being called from within trap-context
This prevents a ThreadError exception being raised on sigint which
resulted in a stacktrace being dumped.
2019-02-12 16:06:16 -08:00
Brian Cain 61a598e612
Update CHANGELOG 2019-02-12 10:01:27 -08:00
Brian Cain 045f31cc45
Merge branch 'master' of github.com:hashicorp/vagrant 2019-02-12 10:00:25 -08:00
Brian Cain 68e21d8ac5
Merge pull request #10664 from chrisroberts/f-plugin-config-format
Fix format finalization of plugins in Vagrantfile
2019-02-12 10:00:14 -08:00
Brian Cain 4961683fc4
Update CHANGELOG 2019-02-12 09:59:25 -08:00
Brian Cain 26d05130c4
Merge pull request #10647 from chrisroberts/f-appimage-ld
Use ld path with appimage libs on suffix
2019-02-12 09:58:53 -08:00
Brian Cain 63ac305780
Update CHANGELOG 2019-02-12 09:57:54 -08:00
Brian Cain 9636f59232
Merge pull request #10638 from chrisroberts/e-reboot-message
Add reboot output to guest capability
2019-02-12 09:57:30 -08:00
Brian Cain 07952096d9
Update CHANGELOG 2019-02-12 09:17:18 -08:00
Brian Cain 0bc0bdd616
Merge pull request #10615 from briancain/introduce-typed-triggers
Introduce :type option for Vagrant triggers
2019-02-12 09:16:01 -08:00
Chris Roberts 20490dbe5b Update path for manual vagrant-vmware-utility installation
This updates the installation path described to be the default
location so that the vagrant-vmware-plugin will automatically
discover the certificates directory without requiring any
customization within the Vagrantfile.
2019-02-12 08:11:13 -08:00
Chris Roberts 2e58e002d6 Fix format finalization of plugins in Vagrantfile 2019-02-11 15:48:43 -08:00
Brian Cain 9bd4db3815
Cleanup trigger documentation 2019-02-07 14:11:08 -08:00
Brian Cain 767346ce81
Adjust command wording to match up 2019-02-07 13:35:47 -08:00
Brian Cain aff66822ef
Reorder type triggers 2019-02-07 13:34:12 -08:00
Brian Cain 6d91dfd025
Update trigger docs with more info on types 2019-02-06 16:29:40 -08:00
Brian Cain c6b42a04cd
Update CHANGELOG 2019-02-05 15:16:50 -08:00
Brian Cain ac6dc0670d
Merge pull request #10645 from briancain/expand-paths-on-compare-docker
Expand paths on synced folder compare with docker provider
2019-02-05 15:15:42 -08:00
Brian Cain 33c3c4a3bf
Merge pull request #10648 from briancain/update-ruby-versions
Update Ruby version to 2.6.1 for Travis CI
2019-02-05 09:25:55 -08:00
Chris Roberts e165a5bc6e Update test checking ld path modifications 2019-02-05 07:16:40 -08:00
Brian Cain 1fad0bb4c7
Update Ruby version to 2.6.1 for Travis CI 2019-02-04 13:43:03 -08:00
Chris Roberts a4eb002750 Use ld path of system libs with appimage libs suffixed 2019-02-04 12:52:55 -08:00
Brian Cain 4c61eaa933
Fixes #10643: Ensure paths are properly expanded when comparing synced folders
Prior to this commit, the docker action would attempt to compare and
validate synced folders based on their string value, rather than their
actual path value. This commit updates that by path expanding the mounts
when comparing a containers synced folders.
2019-02-04 11:15:40 -08:00
Brian Cain 91e351b937
Add unit test for dockers compare_synced_folders 2019-02-04 11:12:55 -08:00
Chris Roberts 80705c4804
Merge pull request #10637 from chrisroberts/f-address-config
Add base_address to core vagrant vm config
2019-02-01 16:15:50 -08:00
Chris Roberts ade5370db3 Add reboot output to guest capability 2019-02-01 15:47:02 -08:00
Chris Roberts dfe9762210 Update CHANGELOG 2019-02-01 14:48:49 -08:00
Chris Roberts d3ea9f1f8c
Merge pull request #10629 from chrisroberts/f-vbox6-import-windows
Fix import paths on Windows for the vbox 6 driver
2019-02-01 14:47:46 -08:00
Chris Roberts 61cf179b42 Add base address attribute to vm config 2019-02-01 14:47:11 -08:00
Brian Cain 64e21a1215
Add test for Action classes with no name 2019-02-01 13:34:15 -08:00
Brian Cain 08214ec90f
Ensure action param is a symbol, and if nil return to do nothing 2019-02-01 13:34:15 -08:00
Brian Cain 6ac23f1a15
Add fire trigger test for cli class 2019-02-01 13:34:15 -08:00
Brian Cain fc4e6e624f
Simplify if-statement in trigger parser 2019-02-01 13:34:15 -08:00
Brian Cain 659aa1c48e
Remove todo in validation 2019-02-01 13:34:15 -08:00
Brian Cain 865c553b8f
Update wording on flag example 2019-02-01 13:34:15 -08:00
Brian Cain c4a03e594f
Update trigger config docs 2019-02-01 13:34:15 -08:00
Brian Cain 071d8b09cd
Add machine for hook and action triggers 2019-02-01 13:34:15 -08:00
Brian Cain 37d71898a3
More docs updates for new triggers 2019-02-01 13:34:15 -08:00
Brian Cain efd549e933
Fix typo 2019-02-01 13:34:15 -08:00
Brian Cain f0058993c6
Add docs for experimental flag 2019-02-01 13:34:15 -08:00
Brian Cain 6e8e3b32eb
Update with some docs 2019-02-01 13:34:15 -08:00
Brian Cain 01c5ca8a43
Fixup wording on run_remote message 2019-02-01 13:34:15 -08:00
Brian Cain 16b5ad74ca
Handle command triggers with run_remote options
This commit adds some handling around when a machine does not exist at
all but a trigger was defined with a run_remote option
2019-02-01 13:34:15 -08:00
Brian Cain 09846b30fe
Fixup action tests
This commit fixes up the action tests by adding a `name` field for all
the Action classes used within the various tests.
2019-02-01 13:34:15 -08:00
Brian Cain 5e4850a0d2
Use name instead of class 2019-02-01 13:34:15 -08:00
Brian Cain ec9bda78c3
Remove comment 2019-02-01 13:34:15 -08:00
Brian Cain ae0960f2da
Add comment to wardens finalize_action method 2019-02-01 13:34:15 -08:00
Brian Cain ebacb96626
Update docs for action trigger actions 2019-02-01 13:34:15 -08:00
Brian Cain fefb702359
Introduce `type` and `command` triggers
This commit introduces some basic functionality for typed triggers:

- command
- action

Command triggers are triggers that will run before or after a given
sub-command.

Action triggers are for running triggers before or after internal
actions for Vagrant. This could be before or after a provision step,
before or after synced folders, or networking, etc.
2019-02-01 13:34:15 -08:00
Chris Roberts d7e036981f Add coverage for windows path behavior in vbox6 driver 2019-01-29 11:09:30 -08:00
Chris Roberts cf99438f1f Update base path on windows to use common file separator
On Windows the File::SEPARATOR ends up being `/` which causes
issues with the new way the path is being extracted from the
vbox information. When on Windows (even with WSL), automatically
convert the path to use common forward slash separator. This
fixes path modifications used for storing guest disks.
2019-01-29 11:09:25 -08:00
Vidroha Debroy 9b618eb0cf Updated documentation. Fixes hashicorp/vagrant#9584. 2019-01-28 13:59:00 -06:00
Vidroha Debroy 281203edf1 Handling the cases for UNSET_VALUE, i.e., config is not finalized. 2019-01-28 13:35:50 -06:00
Matt Adams a3836f5fec Change remaining box_client_cert refs
This fixes issues with box add/update when self hosting with client
certs. The --cert option was not being added to the curl subprocess
in these cases.
2019-01-28 08:45:24 -06:00
Vidroha Debroy d2c11e81ae Config has pip_install_cmd for Provisioner to pick it up. Tests updated. 2019-01-25 16:51:58 -06:00
Vidroha Debroy 8418d26037 Ubuntu code updated because it calls Debian code. 2019-01-25 15:22:04 -06:00
Vidroha Debroy 614523a5fc Exposing pip_install_cmd to callers as optional. 2019-01-25 15:09:31 -06:00
Vidroha Debroy 84df098135 Handling empty strings passed as pip_install_command. 2019-01-25 14:55:39 -06:00
Vidroha Debroy 2b0617fb64 Adding pip_install_cmd as a default parameter to get_pip. Unit Tests. 2019-01-25 13:59:15 -06:00
Chris Roberts 87214ed840
Merge pull request #10614 from hashicorp/f-updateReseller
Update reseller.html.md
2019-01-24 12:54:32 -08:00
Alvaro Miranda Aguilera 0459cefe6e
Update reseller.html.md
selfservice first, PO only for 150 or more
2019-01-24 22:40:50 +02:00
Brian Cain da81948212
Merge pull request #10607 from bdickensheets/patch-1
Update to virtualbox documentation link
2019-01-22 08:57:09 -08:00
bdickensheets 8ccabd90f7
Update to virtualbox documentation link 2019-01-20 19:53:22 +02:00
Chris Roberts d749ffc371 Update utility release version 1.0.7 2019-01-18 14:50:40 -08:00
Daniel Poggenpohl 2d9ba0e906 - FIX for #10594 (more logical flow) 2019-01-17 14:59:52 +01:00
Daniel Poggenpohl d565f628fd - FIX for #10594 2019-01-17 14:21:53 +01:00
Brian Cain 7927c39da9
Update CHANGELOG 2019-01-11 16:22:59 -08:00
Brian Cain b2ae361329
Merge pull request #10586 from briancain/debian-systemd-networkd-dhcp-static-ips
Fixes #10585: Properly set DHCP for systemd-networkd ips
2019-01-11 16:22:09 -08:00
Brian Cain 65a7261853
Fixes #10585: Properly set DHCP for systemd-networkd ips
Prior to this commit, if a debian system requested an DHCP address using
systemd-network, Vagrant would ignore it and instead use the configured
IP from the virtualbox network action. This commit fixes that by instead
looking if DHCP was requested, and if so, use that option for an IP.
2019-01-11 10:19:37 -08:00
Chris Roberts cdd3e7578b Update version for dev 2019-01-09 13:32:09 -08:00
Chris Roberts 15adcf06cd Update download version to 2.2.3 2019-01-09 13:30:54 -08:00
Chris Roberts 37dc3dc648 Release v2.2.3 2019-01-09 13:25:17 -08:00
Brian Cain 9836806f76
Update CHANGELOG 2019-01-09 11:17:46 -08:00
Brian Cain 5d4c9ef8a7
Merge pull request #10513 from briancain/catch-invalid-version-errors-vagrant_cloud
Fixes #10509:  Catch InvalidVersion errors from vagrant_cloud client
2019-01-09 11:16:58 -08:00
Chris Roberts c7a4b05ae7
Merge pull request #10579 from chrisroberts/e-ruby-version
Update ruby version support to include 2.6
2019-01-09 10:46:57 -08:00
Chris Roberts a29273aa17 Update CHANGELOG 2019-01-09 10:46:26 -08:00
Chris Roberts 88793bc706
Merge pull request #10574 from ngyuki/wslpath
Use wslpath command for customized root on WSL
2019-01-09 10:45:36 -08:00
Chris Roberts d8491b7120
Merge pull request #10550 from pkliczewski/master
dependency: update net-ssh version
2019-01-09 10:45:07 -08:00
Chris Roberts 5445c6c79f Update ruby version support to include 2.6 2019-01-09 09:56:23 -08:00
ngyuki 380a1a01b7 Add test using wslpath command in vagrant/util/platform 2019-01-09 20:35:28 +09:00
Brian Cain a37f7a01b2
Update CHANGELOG 2019-01-08 15:41:56 -08:00
Brian Cain e1a13714c0
Merge pull request #10573 from briancain/show-box-version-on-up
Fixes #10339: Show box version during outdated check
2019-01-08 15:41:16 -08:00
Brian Cain 3ca29ff1e0
Merge pull request #10569 from hashicorp/f-updateFAQ-inet
add note to FAQ for internet requirement - license
2019-01-08 12:48:50 -08:00
Alvaro Miranda Aguilera f6f4364173
Update installation.html.md 2019-01-08 20:59:21 +01:00
Alvaro Miranda Aguilera 6cccea8143
Update installation.html.md 2019-01-08 20:56:04 +01:00
Brian Cain ab5e459ed2
Update CHANGELOG 2019-01-08 11:47:43 -08:00
Brian Cain 6b89324a9f
Merge pull request #10554 from iquiw/grep-fix-for-coreos
Fix grep command for network interface of CoreOS guest
2019-01-08 11:47:14 -08:00
ngyuki 924e87342b Use wslpath command for customized root on WSL 2019-01-09 03:59:40 +09:00
Brian Cain c55363412e
Fixes #10339: Show box version during outdated check
This commit updates the output Vagrant displays when checking if a box
is out of date by adding the version.
2019-01-08 10:31:10 -08:00
Chris Roberts 3111c7342a Update CHANGELOG 2019-01-07 16:51:52 -08:00
Chris Roberts abbb5f5ed5
Merge pull request #10571 from chrisroberts/fix/ssh-garbage-detection
Fix garbage detection within SSH communicator
2019-01-07 16:51:05 -08:00
Chris Roberts d87c645bd0 Fix garbage detection within SSH communicator
Fixes #10552
2019-01-07 16:20:56 -08:00
Brian Cain 05dcac11cc
Update CHANGELOG 2019-01-07 13:09:31 -08:00
Brian Cain a8b3d17e5c
Merge pull request #10570 from briancain/show-more-info-with-file-prov
Show source and destination locations with file provisioner
2019-01-07 13:08:48 -08:00
Chris Roberts c8cac957d1
Merge pull request #10564 from dduong42/patch-1
Fix a link to Virtualbox's documentation
2019-01-07 12:48:22 -08:00
Brian Cain b5db5c0156
Show source and destination locations with file provisioner
Prior to this commit, Vagrants output would only show that a file
provisioner was running, but had no detail as to what file was being
copied to where. This is especially confusing if a Vagrantfile has
multiple file provisioners. This commit updates that by showing the
source and destination of the file so that it's clearer what is being
copied and to where.
2019-01-07 11:43:27 -08:00
Alvaro Miranda Aguilera 9f38cd42e9
add note to FAQ for internet requirement - license
Vagrant requires internet access
2019-01-07 19:52:40 +01:00
Daniel Dương 829f9eceae
Fix a link to Virtualbox's documentation 2019-01-04 18:43:19 -02:00
Chris Roberts d84d9ee059
Merge pull request #10561 from anothertobi/update-docs
Add VirtualBox version 6.0.x to docs.
2019-01-04 07:55:05 -08:00
Tobias Nehrlich 54f30f6eeb
Add VirtualBox version 6.0.x to docs. 2019-01-04 11:44:29 +01:00
Chris Roberts 2af84265f1 Update CHANGELOG 2019-01-03 15:26:53 -08:00
Chris Roberts 023238b3d1
Merge pull request #10528 from chrisroberts/e-ps-elevated
Add support for running elevated commands using the powershell command
2019-01-03 15:25:56 -08:00
Chris Roberts 0e933f58eb Update CHANGELOG 2019-01-03 15:19:22 -08:00
Chris Roberts c7522b9114
Merge pull request #10529 from chrisroberts/e-rsync-chown
Add support for using the `--chown` flag with rsync when available.
2019-01-03 15:18:14 -08:00
Chris Roberts 74e5e31967 Update CHANGELOG 2019-01-03 13:53:19 -08:00
Chris Roberts 1f959e03cb
Merge pull request #10532 from chrisroberts/e-reboot
Add reboot option to shell provisioner
2019-01-03 13:52:19 -08:00
Chris Roberts 7fbcb88d82
Merge pull request #10539 from jalandis/disable-required-install_type-salt-option-windows
Disabled salt provision required install_type check on Windows
2019-01-03 13:44:05 -08:00
Chris Roberts 22ed57e9e5 Update CHANGELOG 2019-01-03 13:41:27 -08:00
Chris Roberts 7c1cb4220c
Merge pull request #10537 from jalandis/update-salt-version-in-bootstrap-script
Upgrade default Salt version from 2017.7.1 to 2018.3.3
2019-01-03 13:39:56 -08:00
Chris Roberts 4974fe3a33
Merge pull request #10557 from chrisroberts/f-checkpoint-tests
Update checkpoint client tests
2019-01-03 13:39:37 -08:00
Chris Roberts 4da035200f Update checkpoint client tests
Use `env.ui` for expectations instead of custom double. Fix upgrade
notification test and ensure upgrade notifications are sent to the
error channel.
2019-01-03 10:12:08 -08:00
Iku Iwasa 982534aaed Fix grep command for network interface of CoreOS guest 2019-01-04 00:25:35 +09:00
Piotr Kliczewski 0ad20f725b dependency: update net-ssh version
There is new net-ssh release [1] with a fix needed for vagrant-kubevirt.

Fixes: https://github.com/hashicorp/vagrant/issues/10421

[1] https://github.com/net-ssh/net-ssh/releases/tag/v5.1.0
2019-01-02 15:09:54 +01:00
Yaniv Kaul 68b3ca5a8b
ansible_ssh_host in the example is deprecated
Need to use ansible_host these days. See https://docs.ansible.com/ansible/2.3/intro_inventory.html deprecation note (it was deprecated in 2.0 apparently)
2018-12-31 18:02:33 +02:00
John Landis bd6fa11281
Disabled salt provision required install_type check on Windows where option is not supported. Added test case for salt provisioner config changes. 2018-12-23 11:39:58 -05:00
John Landis 19dc9fd921
Upgrade default Salt version from 2017.7.1 to 2018.3.3 2018-12-22 18:55:38 -05:00
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 cb3b8bd732 Add support for using the `--chown` flag with rsync when available.
Adds a new `rsync__rsync_ownership` option to rsync based synced folders
which will allow rsync to use the `--chown` flag if it is available. The
`rsync` and `rsync-auto` commands have a new `--rsync-chown` flag which
can be used to force the option on folders when running the commands.

Fixes #7329 #7332
2018-12-20 17:16:36 -08:00
Chris Roberts 1f565b8f27 Update CHANGELOG 2018-12-20 14:02:09 -08:00
Chris Roberts 9c33ffd3fa
Merge pull request #10527 from chrisroberts/f-configure-net-nm
Fix guest network configuration by properly extracting extra options
2018-12-20 14:00:30 -08:00
Chris Roberts e3cf74566c Add support for running elevated commands using the powershell command
This PR adds support for running command passed via the --command
flag as elevated tasks. The option is only valid for commands and
not when setting up a remote session. Logic has also been adjusted
for when communicator restrictions are applied and test coverage
has been added.
2018-12-20 11:30:25 -08:00
Chris Roberts 9f1e7d9895 Prevent nil dup as unsupported in 2.3 2018-12-20 07:43:43 -08:00
Chris Roberts 97c3ec961c Update CHANGELOG 2018-12-19 16:22:40 -08:00
Chris Roberts f4cb33e954
Merge pull request #10012 from Aloz1/add-host-voidlinux
Add void linux host support
2018-12-19 16:21:52 -08:00
Chris Roberts a4a98d97fc Fix guest network configuration by properly extracting extra options
Extra options are extracted from the machine configuration for the
network being configured to allow for customized network manager
behavior. The network entries must be filtered to remove non-network
entries (like port forwards) before accessing by index.

Fixes #9546
2018-12-19 16:08:47 -08:00
Chris Roberts 7f3e842bf7 Update CHANGELOG 2018-12-19 12:38:51 -08:00
Chris Roberts 4873d7879a
Merge pull request #10524 from chrisroberts/e-share-unset
Automatically answer yes when pruning SMB shares
2018-12-19 12:37:41 -08:00
Chris Roberts ac5b45445a Remove use of `system`. Add test coverage. 2018-12-19 12:19:22 -08:00
Chris Roberts 8ef1d372ae Add a few more updates to the CONTRIBUTING document
Include extra information within CLA section. Update PR lifecycle
steps to include CLA signing. Fix some small grammar things.
2018-12-19 10:12:41 -08:00
Chris Roberts 59b3ae38cc Add CLA information within CONTRIBUTING document 2018-12-19 10:01:22 -08:00
Chris Roberts ee2072ec53 Automatically answer yes when pruning SMB shares 2018-12-19 08:59:13 -08:00
Chris Roberts 3e8f4a5df4 Update CHANGELOG 2018-12-18 16:09:30 -08:00
Chris Roberts 8eeb48daf6
Merge pull request #10469 from jlduran/fix-network-static
FreeBSD: Fix rcvar in network_static templates
2018-12-18 16:08:27 -08:00
Chris Roberts 564f0163c3 Update CHANGELOG 2018-12-18 11:44:49 -08:00
Chris Roberts f527826f39
Merge pull request #10515 from chrisroberts/f-rsync-auto-clean
Prevent rsync-auto crashes
2018-12-18 11:43:44 -08:00
Chris Roberts 818d1d97ae Update rsync auto post command error handling to be more generic
Rescue and re-wrap any errors encountered when running the post
rsync capability. Rescue this exception type and notify of error
when encountered by rsync auto. Include test coverage.
2018-12-18 09:50:21 -08:00
hieptranquoc 480e992ea1 @ #10460 | vagrant rsync should restart when rsync find chown command error 2018-12-18 09:49:44 -08:00
hieptranquoc aa6908cc00 @ #10460 | fix vagrant rsync-auto is crashed 2018-12-18 09:49:21 -08:00
Chris Roberts a2a4883355 Update CHANGELOG 2018-12-17 16:15:29 -08:00
Chris Roberts 66938d20cf
Merge pull request #10512 from chrisroberts/f-hostnamectl-no-dbus
Validate hostnamectl command is in working state
2018-12-17 16:14:23 -08:00
Brian Cain eaad94635c
Update vagrant_cloud dep for Vagrant
This commit moves up the vagrant_cloud dependency to take advantage of
the new error VagrantCloud::InvalidVersion for the publish command
2018-12-17 14:42:12 -08:00
Brian Cain ca6cc140ff
Catch InvalidVersion errors from vagrant_cloud client
This commit adds a new rescue to the `publish` command for when the
client detects an invalid version prior to making the API request to
create that version.
2018-12-17 14:41:29 -08:00
Chris Roberts 95493d6c59 Validate hostnamectl command is in working state
When checking if the hostnamectl command should be used for configuring
the guest hostname, ensure the command returns a valid result. The
hostnamectl command relies on dbus and if dbus is not available the
command will simply fail.
2018-12-17 12:46:30 -08:00
Brian Cain 6bff374e79
Merge pull request #10502 from kant/patch-1
Minor fix on string #041
2018-12-13 14:42:33 -08:00
Darío Hereñú aae6e34e6f
Minor fix on string #041 2018-12-13 19:20:02 -03:00
Chris Roberts b3707afca0 Update CHANGELOG 2018-12-13 09:19:58 -08:00
Chris Roberts 2daafd9586
Merge pull request #10490 from chrisroberts/f-snapshot-behavior
Update behavior of `snapshot restore` and `snapshot pop`
2018-12-13 09:18:20 -08:00
Chris Roberts 480bb47e1d
Merge pull request #10496 from chrisroberts/e-ssh-config-file
Add support for config and remote_user to SSH options
2018-12-13 09:16:49 -08:00
Chris Roberts 03b06686e4 Update CHANGELOG 2018-12-13 09:16:03 -08:00
Chris Roberts 19025bb8c3
Merge pull request #10488 from chrisroberts/f-powershell-elevated
Only modify elevated username under specific conditions
2018-12-13 09:14:30 -08:00
Brian Cain e1db9a9263
Merge pull request #10500 from Brandon9598/patch-1
Update project_setup.html.md
2018-12-13 08:11:32 -08:00
Brandon9598 8e8bfd60a9
Update project_setup.html.md 2018-12-13 08:36:36 -05:00
Chris Roberts 90a5854684 Fill out ssh options config and remote_user
Include config option within ssh_config command output template. Default
remote_user value to set username value. Include existence check on
provided config value to ensure file is available. Update tests to
include coverage on all changes. Add new options to the docs.
2018-12-11 08:09:43 -08:00
Gavin Williams 0500f2b9b3 Add support for SSH config file to Rsync helper 2018-12-11 07:51:47 -08:00
Gavin Williams 9d72feb36c Add support for SSH config file to to 'vagrant ssh' command 2018-12-11 07:51:47 -08:00
Gavin Williams 122ef7307c Flesh out `:config` support.
Also noticed whilst testing that if the `ProxyCommand` uses `%r`, then
it fails with `unable to find remote user`, so added support for
`config.ssh.remote_user` aswell
2018-12-11 07:51:47 -08:00
Gavin Williams 87e38a0bed Remove 'config' from ssh.defaults, and instead setup in '.connect' 2018-12-11 07:51:47 -08:00
Gavin Williams 50a569747c Use 'be_falsey' matcher 2018-12-11 07:51:47 -08:00
Gavin Williams 87437317dc Add support for passing ssh config file in via config 2018-12-11 07:51:47 -08:00
Brian Cain 94fc57bce1
Merge pull request #10495 from briancain/specify-starter-box
Use specific Vagrant box in tutorial setup
2018-12-10 09:13:07 -08:00
Brian Cain 951902506f
Use specific Vagrant box in tutorial setup
This commit ensures that a proper box is used during the project setup
tutorial. Otherwise later down the road uesrs will run into Vagrant
saying that the box `base` doesn't exist.
2018-12-10 08:47:24 -08:00
Chris Roberts eeecd258f8 Update CHANGELOG 2018-12-07 16:30:42 -08:00
Chris Roberts 598d4254be
Merge pull request #10489 from chrisroberts/f-lots-o-smb
Only prepare 10 shares per command to prevent exceeding allowed command size
2018-12-07 16:29:56 -08:00
Chris Roberts f78ceb57a6 Update CHANGELOG 2018-12-07 16:29:36 -08:00
Chris Roberts 2c62ab9441
Merge pull request #10487 from chrisroberts/f-powershell-encode
Use Base64#strict_encode64 instead of Base64#urlsafe_encode64 for PowerShell
2018-12-07 16:28:37 -08:00
Chris Roberts 4696943ae6 Add new flag to cli docs 2018-12-07 16:26:13 -08:00
Brian Cain e4b028ffac
Update CHANGELOG 2018-12-07 16:25:44 -08:00
Brian Cain 2011e213c3
Merge pull request #10485 from briancain/introduce-experimental-feature-flag
Add experimental flag to guard development features
2018-12-07 16:25:10 -08:00
Chris Roberts c999e7c3d4 Update behavior of `snapshot restore` and `snapshot pop`
Both of these commands failed to default the options disabling
the provisioning from ignoring the sentinel file. This resulted
in different behavior than what was seen with the `up` and
`resume` commands which would only provision items with run set
to "always". This defaults the options to proper match the behavior
of `up` and `resume` to be consistent.

This also adds an extra `--no-start` flag to allow users to restore
a snapshot but not start the restored guest immediately.

Fixes #6752
2018-12-07 16:17:44 -08:00
Brian Cain 2783b121f9
Remove VALID_FEATURES constant 2018-12-07 13:52:02 -08:00
Brian Cain accabdd7ca
Warn users about unknown requested experimental features 2018-12-07 13:36:16 -08:00
Brian Cain 01ec72cac2
Introduce a local and global check for enabled experimental features 2018-12-07 13:30:50 -08:00
Chris Roberts 924fb97e8c Only prepare 10 shares per command to prevent exceeding allowed command size
When a large number of shares are defined it may cause the generated
command to exceed the maximum allowed length. To prevent this, only
allow 10 shares to be processed at a time.

Fixes #10483
2018-12-07 12:56:55 -08:00
Chris Roberts 24cd988d39 Only modify elevated username under specific conditions
Elevated commands can fail via winrm under certain conditions like
the machine name being changed. Detect this by checking for a known
exit code combined with known output included within stderr. If found,
attempt to re-execute the command using a machine prefixed username
if possible.
2018-12-07 12:11:17 -08:00
Brian Cain c07f99fe7d
Move feature flag checking into a single function 2018-12-07 10:59:21 -08:00
Brian Cain d551738bc7
Allow feature_enabled? to accept symbols 2018-12-07 10:50:34 -08:00
Brian Cain fc4ba7f420
Update to global_enabled? 2018-12-07 10:50:20 -08:00
Brian Cain 1a32930017
Add guard_with method for protecting ruby blocks 2018-12-07 10:28:21 -08:00
Brian Cain 611e3dce96
Use util methods in vagrant bin for experimental flag 2018-12-07 10:27:47 -08:00
Brian Cain 44fa134c48
Unfreeze valid features constant 2018-12-07 10:27:21 -08:00
Chris Roberts f7757b58d9 Update CHANGELOG 2018-12-06 16:35:37 -08:00
Chris Roberts 520d4d4da3
Merge pull request #10486 from chrisroberts/f-vbox-warn-req
Adjust requirement on warnings for VirtualBox NIC
2018-12-06 16:31:34 -08:00
Chris Roberts 8d36ba8864 Use Base64#strict_encode64 instead of Base64#urlsafe_encode64 for PowerShell
The #urlsafe_encode64 method complies with RFC 4648 but as the documentation
points out it uses the "URL and Filename Safe Alphabet". The #strict_encode64
method does not, and does not include linefeeds.

Fixes #10438
2018-12-06 16:13:48 -08:00
Chris Roberts 55a8649963 Adjust requirement on warnings for VirtualBox NIC
The changeset _did_ get included in the 5.2.22 release so adjust
the requirement to only warn on previous versions
2018-12-06 15:40:31 -08:00
Brian Cain 1bb6cb21cc
Update CHANGELOG 2018-12-06 15:10:41 -08:00
Brian Cain b6fb971350
Merge pull request #10482 from briancain/redirect-version-check-to-stderr
Fixes #10463: Display version update on stderr instead of stdout
2018-12-06 15:10:06 -08:00
Brian Cain 21b723ca06
Update CHANGELOG 2018-12-06 15:09:33 -08:00
Brian Cain 119f82d826
Merge pull request #10479 from briancain/ensure-tmp-dir-cleanup-package-cmd
Fixes #9593: Ensure temp dir for package command is cleaned up
2018-12-06 15:08:18 -08:00
Brian Cain 212f6ce8bb
Add experimental flag to guard development features
This commit introduces a special flag for enabling features that are not
ready for release. It can either be enabled by setting the
`VAGRANT_EXPERIMENTAL` flag to "1", or by setting it to a string of one
or more comma seperated values for specific features. It also adds a
couple of Vagrant developer focused methods for making it easier to
determine if the flag has been enabled, and if so, what features.
2018-12-06 09:03:49 -08:00
Brian Cain b6c6102e85
Redirect output to stderr instead of using Basic UI class
This preserves the bolding for the version check rather than using the
no format Basic class.
2018-12-05 12:19:51 -08:00
Brian Cain 4a7bff3325
Fixes #10463: Display version update on stderr instead of stdout
This commit updates the behavior of printing the checkpoint version
check for Vagrant. To allow users to filter out the message, it updates
the version check to go to stderr. It updates the UI class for printing
the version check to be a "basic" class, so that the message continues
to be the same color instead of a red error message.
2018-12-04 15:40:28 -08:00
Brian Cain b781331e88
Update CHANGELOG 2018-12-04 14:33:21 -08:00
Brian Cain 2038f2878c
Merge pull request #10470 from wolfgang42/snapshot-error
snapshot plugin: Raise error for bad subcommand.
2018-12-04 14:32:22 -08:00
Brian Cain 86e2b78997
Fixes #9593: Ensure temp dir for package command is cleaned up
Prior to this commit, the package actions would create a temp dir in
the process of packaging and compressing a Vagrant box. This commit
ensures that the temp dir is removed once the command has completed so
that it doesn't leave around lots of temp directories.
2018-12-04 11:07:53 -08:00
Brian Cain 153101d21b
Update CHANGELOG 2018-12-03 16:00:00 -08:00
Brian Cain d561116d16
Merge pull request #10474 from briancain/ensure-install_type-set-with-version
Fixes #10358: Add validation error in salt provider for certain options
2018-12-03 15:58:59 -08:00
Brian Cain 8f722402e5
Update CHANGELOG 2018-12-03 15:58:39 -08:00
Brian Cain 6531ed0970
Merge pull request #10468 from briancain/raise-error-if-provider-file-missing
Fixes #10432: Validate that provider file exists prior to upload
2018-12-03 15:57:50 -08:00
Brian Cain 85a137c1b5
Update CHANGELOG 2018-12-03 15:57:29 -08:00
Brian Cain 604f56b4f3
Merge pull request #10467 from briancain/validate-ignore-provider-installed
Fixes #10224: Clear our registered providers when validating configs …
2018-12-03 15:56:20 -08:00
Brian Cain 5fa3c5866c
Ensure tmp dir for validate is removed once command exits 2018-12-03 14:50:20 -08:00
Brian Cain 34b64ec247
Fixes #10358: Add validation error in salt provider for certain options
Prior to this commit, if you specified a `version` for the salt provider
but no `install_type` Vagrant would fail to pass the proper parameters
to the bootstrap install script. This commit fixes that by adding some
validation to the salt provider if `version` is specified but not
`install_type`. It also adds some extra context for certain config
validation error messages so that the user knows what option was
incorrect, rather than the message just referring to the option as
*this*.
2018-12-03 10:00:11 -08:00
Wolfgang Faust 4ec092f46d snapshot plugin: Raise error for bad subcommand.
Closes #9773.
2018-12-01 14:44:42 -05:00
Jose Luis Duran 5ab323733f
FreeBSD: Fix rcvar in network_static templates
The rcvar should be `defaultrouter` instead:

https://www.freebsd.org/doc/handbook/network-routing.html
2018-12-01 10:07:40 -02:00
Brian Cain 6d4d9b9304
Fixes #10432: Validate that provider file exists prior to upload
Prior to this commit, Vagrant would attempt to path expand a file that
didn't exist if it was left out of the passed in arguments and no
`--url` was used for external box uploading. This commit fixes that by
adding some additional validation for the passed in box file.
2018-11-30 14:13:45 -08:00
Brian Cain 69eacd2b73
Remove machine from initialize method 2018-11-30 11:03:05 -08:00
Brian Cain 68dda8f853
Fixes #10224: Clear our registered providers when validating configs with no provider
Prior to this commit, if you went to validate your Vagrantfile and
wanted to ignore the provider, Vagrant would still fail as it checks if
there are any registered providers that are installed and usable. This
commit mocks out all registered providers to bypass that for the
validate command so that Vagrant can just validate the config and ignore
any provider config blocks.
2018-11-30 10:54:16 -08:00
Chris Roberts e4a3eb5d14 Update vmware utility version 2018-11-28 10:19:06 -08:00
Chris Roberts 01aaf97cd1 Update version for dev 2018-11-27 09:49:31 -08:00
Chris Roberts 5e4f68f529 Update website version to 2.2.2 2018-11-27 09:49:16 -08:00
Chris Roberts 46388d80b6 Release v2.2.2 2018-11-27 09:48:18 -08:00
Chris Roberts ab850c335d Update CHANGELOG 2018-11-27 09:45:12 -08:00
Chris Roberts b886ec0b32
Merge pull request #10450 from chrisroberts/f-vbox-default-nic-type
Update default_nic_type implementation within VirtualBox provider
2018-11-27 09:41:33 -08:00
Chris Roberts d589aa9f81 Update default_nic_type implementation within VirtualBox provider
In some cases the E1000 NIC type is the only acceptable value. Since
defaulting causes breakages to existing boxes, leave the default value
as `nil` but check the VirtualBox version in use and print warning to
user if VirtualBox version is vulnerable and E1000 NIC types are
configured for use within defined network adapters.
2018-11-26 15:58:45 -08:00
Chris Roberts 45766ad00e
Merge pull request #10422 from hashicorp/circleci-website-build
add circleci website build
2018-11-16 12:18:54 -08:00
Alvin Huang 4f59d2b771 remove packer.json since CircleCI builds the site 2018-11-16 15:12:10 -05:00
Alvin Huang 9f8cbec6b4 add circleci website build
move circleci config to root
2018-11-16 15:12:06 -05:00
Chris Roberts f6d6bcf81d Update version for dev 2018-11-15 15:21:58 -08:00
Chris Roberts 30d2e52c46 Update website version to 2.2.1 2018-11-15 15:20:54 -08:00
Chris Roberts e905ab8c8c Release v2.2.1 2018-11-15 15:19:01 -08:00
Chris Roberts 0ff075c5d3
Merge pull request #10417 from chrisroberts/f-vbox6-import
Update VM import for VirtualBox 6
2018-11-15 14:53:30 -08:00
Chris Roberts f031ec4ce8 Add tests for VirtualBox driver version 6 2018-11-15 11:07:10 -08:00
Chris Roberts c5bc8aba46 Remove existing common tests to shared examples. Add custom import test. 2018-11-15 11:06:30 -08:00
Chris Roberts e86824e098 Move common virtualbox 5 driver tests into shared examples 2018-11-15 11:05:51 -08:00
Chris Roberts b8f5752a82 Update VM import for VirtualBox 6 driver
The dry run import with VirtualBox 6 no longer provides full paths
for disks. Extract base path from suggested settings file location
and use that to generate full path name using provided disk base
name.
2018-11-15 11:04:08 -08:00
Chris Roberts 1225114a15 Update CHANGELOG 2018-11-13 15:45:17 -08:00
Chris Roberts efbf99c451
Merge pull request #10409 from chrisroberts/e-vbox-ssh-port-detect
Update VirtualBox driver ssh_port helper
2018-11-13 15:44:15 -08:00
Chris Roberts 1bc0719438 Update CHANGELOG 2018-11-13 15:43:52 -08:00
Chris Roberts 7750d6182d
Merge pull request #10410 from chrisroberts/f-hyperv-net-typo
Fix typo in hyper-v network configuration detection script
2018-11-13 15:43:03 -08:00
Chris Roberts 7d10cad135 Update CHANGELOG 2018-11-13 15:22:53 -08:00
Chris Roberts 8f49e05ad4
Merge pull request #10406 from chrisroberts/e-hyperv-destroy
Disable automatic checkpoints prior to VM removal
2018-11-13 15:22:11 -08:00
Chris Roberts 0364f9b75e Update CHANGELOG 2018-11-13 15:21:49 -08:00
Chris Roberts 2272a0bfa7
Merge pull request #10404 from chrisroberts/e-hyperv-ver-check
Ignore errors when generating new VM configuration
2018-11-13 15:21:03 -08:00
Chris Roberts 9dd137633a Fix typo in hyper-v network configuration detection script 2018-11-13 15:11:04 -08:00
Chris Roberts 30473a4cb1
Merge pull request #10408 from lunchbag/jen/update-share-img
Update open graph image
2018-11-13 15:04:22 -08:00
Chris Roberts c7721f619b Update VirtualBox driver ssh_port helper
Be more restrictive when matching the port forward used for
SSH. Allow matching simply on the guest port, but also include
extra matching criteria for cases where multiple results may
be returned.
2018-11-13 15:04:12 -08:00
Jen 0ab7fc9ecc Update open graph image 2018-11-13 17:29:29 -05:00
Brian Cain 2db2797203
Update CHANGELOG 2018-11-13 14:26:21 -08:00
Brian Cain 608863809a
Merge pull request #10405 from briancain/fixup-inline-windows-trigger-run
Fixes #10393: Only use Shellwords on non-windows hosts
2018-11-13 14:25:27 -08:00
Chris Roberts 0ea4dcdc6e Disable automatic checkpoints prior to VM removal 2018-11-13 13:09:12 -08:00
Brian Cain 69b3b44505
Fixes #10393: Only use Shellwords on non-windows hosts
This commit updates how the trigger `run` inline option works by only
applying `Shellwords.split` to the inline command if it is going to be
run on non-Windows hosts. Otherwise pass the inline script directly to
be executed by Powershell.
2018-11-13 13:07:39 -08:00
Chris Roberts 83ed01869d Ignore errors when generating new VM configuration
The default error action is to stop. When generating the initial
VM configuration during import, if the Compare-VM command fails
it results in a generic error message. Instead the error should
be ignored so the source VM can be inspected and a useful error
message can be returned to the user.
2018-11-13 12:21:17 -08:00
Chris Roberts b2e682b0e3 Update CHANGELOG 2018-11-13 09:20:00 -08:00
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 23b2b0b6ad
Merge pull request #10400 from chrisroberts/e-i18n-lib
Update dependency constraint on i18n
2018-11-12 16:23:02 -08:00
Chris Roberts c4680ae6ee Update CHANGELOG 2018-11-12 16:22:43 -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 d179e5e117 Update dependency constraint on i18n 2018-11-12 15:49:16 -08:00
Chris Roberts 5045ff14cf Update CHANGELOG 2018-11-12 15:43:09 -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 6b02914956 Update shell provisioner documentation
Properly order options alphabetically and include new option
for reset.
2018-11-12 15:36:21 -08:00
Chris Roberts 3ebe5b40e3 Add test coverage on new functionality 2018-11-12 15:36:21 -08:00
Chris Roberts 29880ccd1f Add option to shell provisioner to reset communicator 2018-11-12 15:36:21 -08:00
Chris Roberts afc138478d Add reset! method to winrm communicator 2018-11-12 15:36:21 -08:00
Chris Roberts 747dd9301b Add reset! to ssh communicator. Reduce number of ssh info prints. 2018-11-12 15:36:21 -08:00
Chris Roberts cfc3e9e398 Reset communicator after updating user groups 2018-11-12 15:36:21 -08:00
Chris Roberts c2aa1e207f Add a Communicator#reset! method 2018-11-12 15:36:20 -08:00
Brian Cain 11fe0a84d8
Merge pull request #10398 from briancain/fixup-puppet-doc
Remove `I` from documentation
2018-11-12 11:29:03 -08:00
Brian Cain 8b79aaf34c
Update CHANGELOG 2018-11-12 09:14:44 -08:00
Brian Cain a698188c12
Merge pull request #10389 from briancain/ssh-keyfile-paths-spaces-windows
FIXES #9870: Allow for windows path spaces with ssh utility
2018-11-12 09:14:01 -08:00
Brian Cain eff8f5e22b
Merge pull request #10394 from johanhammar/fix-typos
Fix typos
2018-11-12 08:56:37 -08:00
Brian Cain 8eec4fe6e4
Remove `I` from documentation 2018-11-12 08:45:12 -08:00
Johan Hammar 37a3d7113e Fix typos 2018-11-10 20:16:05 +01:00
Chris Roberts 40a7d97131 Update CHANGELOG 2018-11-09 16:27:33 -08:00
Chris Roberts f2c146d6d7
Merge pull request #10387 from chrisroberts/e-winrm-elevated
Prepend computer name to user when created scheduled tasks
2018-11-09 16:26:03 -08:00
Chris Roberts 4ff5291b89 Update powerup to handle spaces properly in arguments 2018-11-09 15:26:55 -08:00
Brian Cain f8bd2b3f82
Add test for private key paths with '%' characters 2018-11-09 10:46:22 -08:00
Brian Cain 80ac5aaf90
Use path as string rather than Pathname 2018-11-09 10:24:58 -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 e8cee899a8 Update CHANGELOG 2018-11-08 14:40:33 -08:00
Chris Roberts e4cc769b9e
Merge pull request #10383 from chrisroberts/e-vbox-default-nic
Add support for specifying the default NIC type used for guest adapters
2018-11-08 14:39:35 -08:00
Chris Roberts c8f431cf44 Prepend computer name to user when created scheduled tasks
When running a shell provisioner elevated with winrm a scheduled
task is created to bypass permissions issues. If the name of the
computer has changed this may no longer work. To prevent errors
this PR updates the implementation to fetch the computer name
and prepends it to the username before creating the task.
2018-11-08 14:21:20 -08:00
Chris Roberts b7cff2de2b
Merge pull request #10382 from chrisroberts/e-docs-env-sort
Add missing environment variables
2018-11-07 16:02:00 -08:00
Chris Roberts d8bbc5ce09 Add support for specifying the default NIC type used for guest adapters
Provides support for defining the NIC type used for any guest adapter
which does not define an adapter type. This is defaulted to "virtio".
2018-11-07 15:53:46 -08:00
Chris Roberts 28f1e4f36e Update CHANGELOG 2018-11-07 10:13:29 -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
Chris Roberts 07ca8564ad Update CHANGELOG 2018-11-07 09:52:48 -08:00
Chris Roberts 7d90f532c4
Merge pull request #10379 from chrisroberts/e-vbox-6
Add support for VirtualBox 6.0
2018-11-07 09:51:59 -08:00
Chris Roberts fccc68a471 Add important non-VAGRANT_ prefixed environment variables 2018-11-07 09:38:40 -08:00
Chris Roberts 1bdde30a02 Sort environment variables by name 2018-11-07 08:07:33 -08:00
Chris Roberts 9d728682c4 Add vbox provider driver for 6.0 2018-11-06 16:50:17 -08:00
Chris Roberts de42681742 Inherit from common base since 5.1 driver has no changes 2018-11-06 16:50:17 -08:00
Brian Cain ceb1ec9a60
Update CHANGELOG 2018-11-06 09:26:31 -08:00
Brian Cain bcb6bf8acd
Merge pull request #10347 from briancain/add-timeout-for-ssh-info-hyperv
Fixes #10229: Add proper reboot capability for Windows guests
2018-11-06 09:25:36 -08:00
Brian Cain d2b7da065f
Add test for WinRMNotReady exceptions for ready? method 2018-11-05 14:14:50 -08:00
Brian Cain 796ff7b190
Remove logger from windows hostname cap 2018-11-05 14:12:16 -08:00
Brian Cain 251e0b1452
Update CHANGELOG 2018-11-05 13:26:25 -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 8a16b41a10 Update CHANGELOG 2018-11-05 12:54:28 -08:00
Chris Roberts d5f3600c4b
Merge pull request #10366 from chrisroberts/f-hyperv-vlan
Remove module loading from vlan script
2018-11-05 12:53:33 -08:00
Chris Roberts 5b325e7276 Update CHANGELOG 2018-11-05 12:53:17 -08:00
Chris Roberts 11e73eef75
Merge pull request #10365 from chrisroberts/e-ssh-ed25519
Add support for ed25519 keys
2018-11-05 12:52:17 -08:00
Chris Roberts caae50c5e8 Update CHANGELOG 2018-11-05 12:51:58 -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 247f17c279 Update CHANGELOG 2018-11-05 12:50:05 -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
Brian Cain 0188d409d4
Add test for windows reboot cap 2018-11-02 16:34:57 -07:00
Brian Cain 377b900277
Only execute reboot check if guest communicator is ready 2018-11-02 16:33:36 -07:00
Chris Roberts 6b7063ef05 Update CHANGELOG 2018-11-02 15:26:09 -07:00
Brian Cain 142a6898bc
Add reboot cap for windows
This commit introduces a proper reboot cap for Windows guests. Once it
initiates a reboot on the guest, it calls out to the wait_for_reboot cap
to block on until the guest is finished rebooting.
2018-11-02 15:25:57 -07:00
Chris Roberts be6f683009
Merge pull request #7699 from legal90/refactor-network
provider/virtualbox: Refactor host-only network settings
2018-11-02 15:25:09 -07:00
Brian Cain 5ebb4cced5
Merge pull request #10361 from johnyserpa/patch-1
fix broken link to token
2018-11-02 15:18:23 -07:00
Chris Roberts 5add5c24fe Show formatted error message with address and netmask 2018-11-02 15:03:22 -07:00
Mikhail Zholobov d9d081199c
action/network: Validate IP settings, show human-readable error 2018-11-02 22:29:19 +01:00
Mikhail Zholobov a02aaa3195
action/network: Refactor the calculation of host-only adapter IP and DHCP settings 2018-11-02 22:28:49 +01:00
Chris Roberts c2cedc98c2 Update CHANGELOG 2018-11-02 14:10:40 -07:00
Brian Cain 007bf991d5
using vagrantcloud.com instead of app.vagrant.com
Co-Authored-By: johnyserpa <joao.serpapinto@gmail.com>
2018-11-02 21:10:24 +00: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 1ece44ca84 Remove module loading from vlan script 2018-11-02 10:42:28 -07:00
Chris Roberts 04579e0ac7 Add support for ed25519 keys
The net-ssh library supports ed25519 keys but only if the required
dependencies are available. This adds the required dependencies.
2018-11-02 09:24:50 -07:00
Brian Cain 54c8ebc31a
Fixes #10229: Add timeout for changing hostname on windows
Prior to this commit, if Windows was slow to reboot, Vagrant would fail
to find the right IP address to upload the wait_for_reboot script to.
This commit fixes this race condition by adding a timeout to ensure that
Vagrant can retry. It also properly catches an exception in the winrm
ready? method for checking if a guest is properly ready for
communications.
2018-11-02 09:23:00 -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
Johny Serpa eba487a345
fix broken link to token
Link to generate token is broken. Fixed it.
2018-11-01 19:57:34 +00:00
Brian Cain 872c3c957d
Merge pull request #10357 from briancain/add-note-about-install-type-salt
Add note about install_type for version
2018-11-01 10:04:04 -07:00
Chris Roberts 976320ec06 Limit automatic box outdated checks to once per hour 2018-11-01 09:45:11 -07:00
Brian Cain 0dd3f57e81
Merge pull request #10346 from hashicorp/f-updateVMWareDocsBox
Update vmware_desktop in boxes.html.md
2018-11-01 09:39:25 -07:00
Brian Cain 1a0b014ef7
Add note about install_type for version 2018-11-01 08:51:04 -07:00
Brian Cain a25caf1d92
Merge pull request #10355 from briancain/update-salt-version-docs
Update salt provisioner docs
2018-10-31 12:58:40 -07:00
Brian Cain 8a07e731af
Update salt provisioner docs 2018-10-31 11:31:50 -07:00
Brian Cain 6f2ce24325
Update CHANGELOG 2018-10-31 09:09:20 -07:00
Brian Cain 338827e382
Merge pull request #10351 from briancain/ignore-provider-config-on-validate
Fixes #10224: Allow validation of config while ignoring provider
2018-10-31 09:08:34 -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
Alvaro Miranda Aguilera 93fc675ad5
Update boxes.html.md 2018-10-29 19:26:34 +01:00
Brian Cain 716a5f1501
Merge pull request #10343 from glenvillef/glenvillef
Grammar corrections on web pages
2018-10-29 08:45:57 -07:00
Chris Roberts df874adf69
Merge pull request #10341 from chrisroberts/e-docs-update
Update vagrantfile documentation content to use list
2018-10-29 08:29:44 -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
Glenville Fanoo (ZA) cdc0e1c11c
Grammer: corrected 2018-10-27 12:53:02 +02:00
Glenville Fanoo (ZA) e4a7b932fc
Grammer: corrected 2018-10-27 09:38:13 +02:00
Chris Roberts 7a725d7424 Update vmware utility version for website 2018-10-26 17:06:57 -07:00
Chris Roberts 32dbb6185a Update vagrantfile documentation content to use list 2018-10-26 15:32:51 -07:00
Chris Roberts 22119e157b Update CHANGELOG 2018-10-25 09:02:24 -07:00
Chris Roberts 58e6cbb01d
Merge pull request #10332 from chrisroberts/e-hyperv-pwsh-vr
Prevent exception from raising on hyper-v check
2018-10-25 09:01:26 -07:00
Chris Roberts ca81f9d6cb Prevent exception from raising on hyper-v check 2018-10-24 17:06:47 -07:00
Brian Cain ed310a954b
Update CHANGELOG 2018-10-24 16:20:39 -07:00
Brian Cain 580bcaebb0
Merge pull request #10311 from briancain/DOCKER-VM-FOLDER-MOUNT
Deterministic host VM synced folder location for Docker provider
2018-10-24 16:19:41 -07:00
Brian Cain 1f9cec0fba
Update CHANGELOG 2018-10-24 15:58:36 -07:00
Brian Cain f524a191e1
Merge pull request #10330 from briancain/fall-back-on-ifdown-ifup-tools-hostname
Reliably restart Debian and Ubuntu guests networking on setting hostname
2018-10-24 15:53:11 -07:00
Brian Cain a1bb7b837a
Use semicolon over ampersand to separate commands 2018-10-24 15:27:33 -07:00
Brian Cain e8c6916ebc
Restart each interface if systemd-networkd or networkmanager is not used
This commit is a workaround due to how older debian and ubuntu systems
fail to properly restart networking. Instead of relying on the init
scripts or ifup/down tools to restart each interface, this commit
instead restarts each interface individually
2018-10-24 11:34:38 -07:00
Brian Cain 1761e65f26
Fixes #9763 #10300: Fall back on ifdown/ifup tools for network restart
This commit adds some additional logic that falls back to using the
ifdown/ifup tools to restart networking. On Ubuntu 14.04, the init
script was designed to always fail to restart newtorking, so it needs
to use the ifdown/up tools instead. This commit will use the networking
init script as a last resort to restart networking, assuming other
commands haven't broken networking already.

https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1301015
2018-10-23 14:47:12 -07:00
Brian Cain 6b34f3655a
Update CHANGELOG 2018-10-23 09:25:33 -07:00
Brian Cain 238a46299b
Merge pull request #10326 from briancain/add-automount-vbox
Fixes #10016: Add `automount` flag if specified with synced_folder
2018-10-23 09:24:49 -07:00
Brian Cain 7c06950e43
Ensure true or false for automount option 2018-10-23 09:00:55 -07:00
Brian Cain 6d0dfb2690
Fixes #10016: Add `automount` flag if specified with synced_folder
This commit adds a new option to virtualbox synced_folders called
`automount`, where if set to true, will supply the `--automount` flag to
virtualbox.
2018-10-22 15:45:32 -07:00
Chris Roberts 5ac79d2821 Update CHANGELOG 2018-10-19 16:00:39 -07:00
Chris Roberts b0fc33e9b7
Merge pull request #10321 from chrisroberts/f-ssh-comm-output
Prevent overly verbose output from SSH communicator
2018-10-19 15:59:01 -07:00
Chris Roberts 8562daf85e Prevent overly verbose output from SSH communicator
If the type of error changes on retry the messages will effectively
spam the user display with alternating messages. Log each message
sent and only re-display each message once within 10 seconds.
2018-10-19 15:18:03 -07:00
Brian Cain 5f5d874997
Update CHANGELOG 2018-10-19 14:11:06 -07:00
Brian Cain 9fab454bd5
Merge pull request #10319 from briancain/username-prompt-smb
Fixes #9591: Allow for 'default' smb_username if set
2018-10-19 14:09:48 -07:00
Brian Cain 65651178cd
Fixes #9591: Allow for 'default' smb_username if set
Prior to this commit, Vagrant would prompt for smb username and password
every time, even if only smb_username was defined. This commit changes
that by allowing a "default" username from the Vagrantfile, with the
option of overriding it.
2018-10-19 13:26:18 -07:00
Brian Cain 28c4940969
Update CHANGELOG 2018-10-18 09:02:52 -07:00
Brian Cain e54c9b22ef
Merge pull request #10301 from briancain/debian-fixup-hostname-change
Fixes #9763, #10300: Split out how hostname is set with Debian hosts
2018-10-18 08:57:29 -07:00
Brian Cain a1fa319f7e
Merge pull request #10315 from briancain/update-ruby-again
Bump ruby to 2.5.3
2018-10-18 08:49:32 -07:00
Brian Cain 4489b80931
Bump ruby to 2.5.3 2018-10-18 08:17:02 -07:00
Lukas Lösche 73cb4b5b42
Fix WSL detection for customized roots 2018-10-18 15:13:18 +02:00
Brian Cain 94bb50fa7e
Add test for syncing folders with docker provider 2018-10-17 14:14:27 -07:00
Brian Cain 52c04909d5
Merge pull request #10310 from briancain/update-ruby-for-travis
Update ruby to latest for travis tests
2018-10-17 12:42:42 -07:00
Brian Cain 31fabc94f7
Update ruby to latest for travis tests 2018-10-17 12:27:20 -07:00
Martin Jonas 238338d803
Deterministic host VM synced folder location for Docker provider to prevent broken sync after host VM shutdown
Fix for #10282
2018-10-17 11:28:24 -07:00
Brian Cain 2ce62cad65
Merge pull request #10308 from 5uper5hoot/patch-1
Small typo fix
2018-10-17 08:19:24 -07:00
Peter Schutt 78c7549b1b
Small typo fix 2018-10-17 22:12:27 +10:00
Chris Roberts ae7d2bed9d Update version for dev 2018-10-16 15:45:30 -07:00
Chris Roberts 6e37e49708 Update website version 2.2.0 2018-10-16 15:42:23 -07:00
Chris Roberts 9c835d823f Release v2.2.0 2018-10-16 15:39:34 -07:00
Brian Cain f20ab1ab39
Update CHANGELOG 2018-10-16 15:20:35 -07:00
Brian Cain 23de7f0898
Merge pull request #10148 from briancain/add-cloud-command
Introduce `vagrant cloud` subcommand to Vagrant
2018-10-16 15:19:58 -07:00
Brian Cain 15fb2b729d
Remove #Hash.compact for ruby 2.3 compatibility 2018-10-16 14:41:31 -07:00
Chris Roberts e595403419
Merge pull request #10304 from chrisroberts/f-hyperv-config
Add missing hyperv provider configuration option
2018-10-16 14:19:53 -07:00
Chris Roberts 2b157fc9be Add missing hyperv provider configuration option 2018-10-16 13:47:32 -07:00
Brian Cain 6443fe7109
Merge pull request #10302 from nqb/patch-1
Add details and fix typo for run: "never" option
2018-10-16 13:23:34 -07:00
Nicolas Quiniou-Briand 8293b763bd
Add details and fix typo for run: "never" 2018-10-16 15:36:40 -04:00
Brian Cain 0c5d55e69c
Fixes #9763, #10300: Split out how hostname is set with Debian hosts
Prior to this commit, the hostname was set with one big bash script and
attempted to determine what tools are available. This commit changes
that by splitting out that tool check on the Vagrant side of things with
the GuestInspection class, and adds back restarting networking to get a
DHCP lease with the change rather than using `dhclient`. This pattern
matches how hostnames are set in the redhat capability.
2018-10-16 12:00:25 -07:00
Brian Cain b92b1ba0bb
Add `cloud` command to bash completion 2018-10-12 09:49:49 -07:00
Brian Cain b1b829f69d
Fix missing `end` in errors class 2018-10-12 09:16:36 -07:00
Brian Cain 5225b48e00
Fixup cloud cli website documentation 2018-10-12 09:07:12 -07:00
Brian Cain 42c01f241c
Mark password as sensitive in logs 2018-10-12 09:07:12 -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 e67dac0dbb
Alias `vagrant login` command 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 dd3d6c7cf2 Extend assert retries to allow for slow setup 2018-10-11 13:00:44 -07:00
Chris Roberts 9e4a3ee9d0 Update CHANGELOG 2018-10-11 10:49:40 -07:00
Chris Roberts 95fad3a8e3
Merge pull request #10259 from hoatle/bugs/#10258-vagrant_ansible_local_inventory
@ #10258 | BUG: should not create /tmp/vagrant-ansible/inventory/vagrant_ansible_local_inventory/vagrant_ansible_local_inventory
2018-10-11 10:48:27 -07:00
Brian Cain 506f87cf9c
Update CHANGELOG 2018-10-11 10:32:49 -07:00
Brian Cain 06070429c2
Merge pull request #10291 from briancain/create-proper-tmp-dir-rsync
Fixes #10289: Create proper tmp dir for ControlPath
2018-10-11 10:31:43 -07:00
Brian Cain cc14b43a96
Ensure `tmpdir` is loaded for rsync helper class 2018-10-11 09:57:20 -07:00
Brian Cain cb0bd89ae1
Fixes #10289: Create proper tmp dir for ControlPath
Prior to this commit, when creating the ControlPath tmp dir for
socket path, Vagrant would simply rely on `rand(1000)` for making unique
dirs for rsyncing files which could result in collisions. This commit
updates that be properly using `Dir.mktmpdir` with a `vagrant-rsync-`
prefix.
2018-10-11 09:51:03 -07:00
Chris Roberts 56aa5860cb
Merge pull request #10288 from chrisroberts/e-win-pageant-doc
Add information on using pageant with ssh
2018-10-11 08:40:48 -07:00
Chris Roberts 55fbc30fca Add information on using pageant with ssh
Fixes #10195
2018-10-10 17:06:26 -07:00
Chris Roberts 3b100d0781 Update CHANGELOG 2018-10-10 16:39:09 -07:00
Chris Roberts a841a75a78
Merge pull request #10279 from chrisroberts/e-local-encoded
Provide rgloader for project local plugins
2018-10-10 16:38:09 -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 9333e54990 Update CHANGELOG 2018-10-09 14:49:09 -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 ae6ff4256b Update CHANGELOG 2018-10-09 14:47:53 -07:00
Chris Roberts 080dd748ef
Merge pull request #10265 from chrisroberts/f-win-chktyp
Only configure CheckpointType if available to be configured.
2018-10-09 14:47:15 -07:00
Chris Roberts a7a55398fe Update CHANGELOG 2018-10-09 14:46:58 -07:00
Chris Roberts 7241bd9fda
Merge pull request #10264 from chrisroberts/f-win-autochk
Wrap automatic checkpoint enable to prevent inadvertent execution
2018-10-09 14:46:04 -07:00
Chris Roberts 4742c6ae2a Update CHANGELOG 2018-10-09 14:45:07 -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 ba0f0fbcab Default destination to basename of clean source 2018-10-08 15:29:55 -07:00
Chris Roberts 67bb5d2e6c Update Hyper-V admin check 2018-10-08 14:39:40 -07:00
Chris Roberts 49a9ae4bd9 Remove current communicator name from error text 2018-10-08 14:30:11 -07:00
Chris Roberts 3181b5c1f9 Ensure winrm helper is loaded for command 2018-10-08 14:28:52 -07:00
Chris Roberts d81abc1245 Fix active machine check to use common types when setting arguments 2018-10-08 14:22:32 -07:00
Chris Roberts 412290828b Fix trailing quotes in source path 2018-10-08 14:18:30 -07:00
Brian Cain 23f98f9a15
Merge pull request #10273 from briancain/add-more-ruby-trigger-context-docs
Add more information about Ruby trigger option
2018-10-08 10:51:55 -07:00
Brian Cain af91b3bb2f
Add more information about Ruby trigger option
This commit provides a bit more context to using the new Ruby trigger
option.
2018-10-08 10:30:29 -07:00
Brian Cain 9ee153802a
Update CHANGELOG 2018-10-08 09:03:13 -07:00
Brian Cain 5daa25db80
Merge pull request #10267 from briancain/ruby-trigger-option
Fixes #9840: Introduce `ruby` option for trigger
2018-10-08 09:02:17 -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 88469d99f7 Only configure CheckpointType if available to be configured. 2018-10-04 15:24:05 -07:00
Chris Roberts 9c1ab2bd9f Wrap automatic checkpoint enable to prevent inadvertent execution 2018-10-04 15:16:58 -07:00
Chris Roberts 904a712838 Provide correct RDP information within configuration information
Dynamically generate RDP information when applicable via provider
if supported. When no RDP port is provided ignore RDP in config
and omit from output.
2018-10-04 14:41:10 -07:00
Chris Roberts a4231d630a Update CHANGELOG 2018-10-04 13:39:24 -07:00
Chris Roberts 64987daf06
Merge pull request #10255 from chrisroberts/e-base-mac-vbox
Allow automatic mac address assignment with virtuabox provider
2018-10-04 13:38:08 -07:00
Chris Roberts 48d358adcb Add winrm and upload commands 2018-10-04 13:26:41 -07:00
Brian Cain c6a0793cc3
Merge pull request #10262 from jeff-jk/machine-settings-doc-update
Add :windows to config.vm.guest in machine settings doc
2018-10-03 16:46:47 -07:00
jeff-jk 141bcc03f5 :windows should be a symbol in machine_settings doc
This should just be a symbol :windows rather than a string ":windows"
2018-10-03 17:36:24 -06:00
jeff-jk f1f4003fa9 Add :windows to config.vm.guest option
This commit updates the documentation so that it is more clear that Windows guests need to change the `config.vm.guest` option along with the `config.vm.communicator` option.
2018-10-03 15:47:25 -06:00
hoatle cae2119c0f @ #10258 | BUG: should not create /tmp/vagrant-ansible/inventory/vagrant_ansible_local_inventory/vagrant_ansible_local_inventory 2018-10-02 16:21:15 +07:00
Chris Roberts 648e0ddeaa Explicitly define driver version used for tests 2018-10-01 11:51:14 -07:00
Brian Cain 6aedc66c1c
Update CHANEGLOG 2018-10-01 11:08:35 -07:00
Brian Cain 184d114374
Merge pull request #10242 from briancain/IGNORE-BOX-VAGRNANTFILE
Add config option `ignore_box_vagrantfile`
2018-10-01 11:07:28 -07:00
Chris Roberts 85dc0ebec9 Allow automatic mac address assignment with virtuabox provider 2018-10-01 11:05:28 -07:00
Chris Roberts 11b0d58fa0 Include communicator on call 2018-10-01 08:43:49 -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 2c7c38e3bb
Merge pull request #10250 from briancain/fix-old-box-url
Update old URL for box_url example
2018-09-28 08:42:20 -07:00
Brian Cain 4060722ea1
Update old URL for box_url example 2018-09-28 08:31:18 -07:00
Chris Roberts 1797798760 Fix module name 2018-09-28 07:59:39 -07:00
Chris Roberts 976149b9a4
Merge pull request #10247 from hashicorp/je.fix-download-tracking
Fix download tracking analytics events
2018-09-27 17:49:19 -07:00
Jeff Escalante d4cf8b088e fix download tracking analytics events 2018-09-27 20:00:06 -04:00
Chris Roberts b5cb5f300b
Merge pull request #10243 from chrisroberts/e-vmware
Website updates for VMware
2018-09-26 14:02:01 -07:00
Chris Roberts f7f83faacd Website updates for VMware 2018-09-26 13:27:49 -07:00
Brian Cain f6ae328346
Add test for ignore_box_vagrantfile option 2018-09-26 10:31:55 -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
Alex Wu 282c7341c9
add a option to ignore the vagrantfile packaged with the box 2018-09-26 10:10:45 -07:00
Brian Cain 0699323da2
Update CHANGELOG 2018-09-25 13:54:24 -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 5d877c0e2a
Update CHANGELOG 2018-09-25 10:46:56 -07:00
Brian Cain f6ac70e86e
Merge pull request #10232 from briancain/clean-halt-trigger
Add abort option to core triggers
2018-09-25 10:45:47 -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
Brian Cain 36582ef1b1
Update CHANGELOG 2018-09-24 15:18:07 -07:00
Brian Cain 99be58c1e5
Merge pull request #10235 from chregu/fix-sudoers-osx
Fix the broken sudoers file for OS X
2018-09-24 15:14:34 -07:00
Christian Stocker f44b98238c
Fix the pretty broken sudoers file for OS X 2018-09-24 23:39:01 +02: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 bc217d5e57 Update redhat change host name capability tests for systemd/NetworkManger updates 2018-09-20 16:46:45 -07:00
Chris Roberts ff021fcab4 Update redhat change host name capability to support systemd
Update capability to use guest inspection module for determining
correct actions to execute. When systemd is in use restart the
correct active service, either NetworkManager or networkd. Default
to using the original service restart when systemd service is not
found.
2018-09-20 16:44:08 -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
shotop a12b09b098 add specs around network restart logic 2018-09-20 15:28:37 -07:00
Joe Doss 86ab4533b1 Fix the test to check for systemctl restart NetworkManager.service too. 2018-09-20 15:28:37 -07:00
Joe Doss 19aa9578c7 Exit 1 if we cannot set the hostname. 2018-09-20 15:28:37 -07:00
Joe Doss c14a4a09f7 Switch if statements, check for systemctl, and switch to is-active. 2018-09-20 15:28:37 -07:00
Joe Doss 94954739b5 Simplified if statements. 2018-09-20 15:28:37 -07:00
Joe Doss 80006251f4 Add in logic to restart NetworkManager if it is enabled. 2018-09-20 15:28:36 -07:00
Brian Cain 7402823ad0
Merge pull request #10222 from zwass/patch-1
Update Docker containerization docs
2018-09-20 14:30:18 -07:00
Zachary Wasserman 4a0628afbd
same for mac, linux and windows 2018-09-20 17:11:56 -04:00
Zachary Wasserman 995c7933b3
Update Docker containerization docs
The docs indicate that most systems must use a VM for containerization. This is no longer the case as Docker For Mac now uses HyperKit.

See https://docs.docker.com/v17.12/docker-for-mac/docker-toolbox/
2018-09-20 13:17:58 -04:00
Brian Cain 97d343b0ab
Update CHANGELOG 2018-09-20 09:20:08 -07:00
Brian Cain f3dcb7655b
Update CHANGELOG 2018-09-20 09:19:18 -07:00
Brian Cain a4d5ee6ac1
Merge pull request #10215 from briancain/FIX-SALT-PILLAR
Salt pillar configuration on Windows guests
2018-09-20 09:17:32 -07:00
Brian Cain 3b7e37a2ed
Merge pull request #10221 from briancain/DOCKER-REPO-GIT
Docker provider build from repo
2018-09-20 09:16:22 -07:00
Brian Cain d471932a4e
Update website about required docker params 2018-09-19 10:54:14 -07:00
Brian Cain 4612619dc4
Fixup docker config update 2018-09-19 10:52:59 -07:00
Brian Cain 29128e73b9
Remove old changelog addition 2018-09-19 10:52:42 -07:00
Brian Cain aecfc45eab
Add note about required docker config options 2018-09-19 10:38:40 -07:00
Oleksiy Protas 166fe374b6
More explicit logging and 'dockerfile' option support 2018-09-19 10:25:37 -07:00
Oleksiy Protas cbc69f5158
Build from git operation for docker 2018-09-19 10:24:09 -07:00
Oleksiy Protas de6a1794c7
Config, validation and test 2018-09-19 10:24:09 -07:00
Oleksiy Protas 8d1b5fc1c9
Docu changes for building Docker images from git 2018-09-19 10:24:05 -07:00
Brian Cain 7c7a2ed465
Update CHANGELOG 2018-09-19 09:04:39 -07:00
Brian Cain c3c7ad4ea2
Merge pull request #10218 from briancain/fix-env-vars-puppet-windows
Fixes #8315: Properly set env variables for puppet provisioner
2018-09-19 09:04:01 -07:00
Brian Cain b19e891bab
Update CHANGELOG 2018-09-19 09:02:50 -07:00
Brian Cain 5834b1ca70
Merge pull request #10219 from briancain/SMB-PASSWORD-CHARS
Allow special characters in SMB password field
2018-09-19 09:02:08 -07:00
Brian Cain 3ed4ab7022
Update CHANGELOG 2018-09-19 09:01:44 -07:00
Brian Cain b580268730
Merge pull request #10220 from briancain/FIX-PATH-WARNING-WINDOWS
Ensure file paths are identical when checking for cwd
2018-09-19 09:01:09 -07:00
Brian Cain dac78eb626
Add test for identical file paths 2018-09-18 14:15:34 -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
Brian Cain 5ebb548be9
Add test for SMB mount_shared_folder function
This commit ensures that the command that adds the smb username and
password properly quotes the password given by the user.
2018-09-18 13:38:57 -07:00
John Rizzo b7d702ab5f
Update mount_shared_folder.rb
This change allows special characters in the password such as ) which will cause cmdkey to fail without the quotes.
2018-09-18 13:34:32 -07:00
Brian Cain 06b3268b6f
Fixes #8315: Properly set env variables for puppet provisioner
Prior to this commit, the puppet provisioner would not properly set its
environment variables, if any were configured in the Vagrantfile. This
commit separates those properly with semicolons when calling out to
puppet apply.
2018-09-18 10:09:01 -07:00
Brian Cain 96a00ad692
Include test for get_pillar salt function 2018-09-17 14:32:17 -07:00
mtkennerly 38175f93c6
Specify Salt pillar dependency on PowerShell 3.0 due to --% syntax. 2018-09-17 14:20:34 -07:00
mtkennerly 5c50c50d73
Fix #8328: Use special quote and backslash formatting for Windows when setting Salt pillar. 2018-09-17 14:20:31 -07:00
Brian Cain 89a21f0f47
Update CHANGELOG 2018-09-17 11:48:11 -07:00
Brian Cain 31689b6032
Merge pull request #9054 from tom-mi/master
Add completion for snapshot names for vagrant snapshot restore|delete
2018-09-17 11:47:32 -07:00
Brian Cain 07a2bc4d1d
Update CHANGELOG 2018-09-17 11:27:37 -07:00
Brian Cain 9ad04ada6c
Merge pull request #9431 from blueyed/options-without-leading-space
salt: remove leading space with bootstrap_options
2018-09-17 11:26:54 -07:00
Brian Cain ff3d1235fb
Update CHANEGLOG 2018-09-17 11:14:09 -07:00
Brian Cain 4fd9d522f6
Merge pull request #9432 from blueyed/curl-s
salt: bootstrap-salt.sh: use -s with curl
2018-09-17 11:13:21 -07:00
Chris Roberts de62a86d48 Update version for dev 2018-09-12 09:01:55 -07:00
Chris Roberts fb0eb56c3a Update website version 2.1.5 2018-09-12 08:45:01 -07:00
Chris Roberts 47b2f27d27 Release v2.1.5 2018-09-12 08:00:32 -07:00
Chris Roberts 63ae9556c6 Fix typo in spec runner script 2018-09-11 15:07:21 -07:00
Chris Roberts 28ea7a565b Fix typo in changelog 2018-09-11 15:07:10 -07:00
Chris Roberts 467ba9f6e4 Update CHANGELOG 2018-09-11 10:47:07 -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 1b4da1c9bf Update CHANGELOG 2018-09-11 10:45:44 -07:00
Chris Roberts c29ff8b39b
Merge pull request #10200 from chrisroberts/e-customized-logger
Remove sensitive values from logger output
2018-09-11 10:45:08 -07:00
Chris Roberts 8500a609f5 Remove sensitive values from logger output 2018-09-10 10:40:51 -07:00
Brian Cain 4b95040810
Update CHANGELOG 2018-09-10 10:28:57 -07:00
Brian Cain c31fd2cd1e
Merge pull request #10194 from briancain/specify-salt-version
Allow non-windows hosts to pass along version
2018-09-10 10:28:16 -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
Brian Cain b8e3705768
Update CHANGELOG 2018-09-10 09:20:06 -07:00
Brian Cain 95bec5953c
Merge pull request #10198 from mkostrikin/sudo_ps_systemd_detect
Hardened proc disallow systemd detection
2018-09-10 09:19:00 -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
Brian Cain 13b09bedac
(#9802) Allow non-windows hosts to pass along version
The salt bootstrap can now accept version arguments on non-windows
hosts, so this commit allows the Vagrant provisinoer to specify a
version.
2018-09-07 13:39:36 -07:00
Brian Cain 770b6e0cca
Update CHANGELOG 2018-09-07 13:05:37 -07:00
Brian Cain 9da922c871
Merge pull request #10168 from lelutin/bash_completion_destroy
bash: complete running VM names for destroy subcommand
2018-09-07 13:05:00 -07:00
Brian Cain 5a1b065834
Update CHANGELOG 2018-09-07 11:18:20 -07:00
Brian Cain 4f42da15de
Merge pull request #10171 from eigengrau/default-template
vagrant init: Support VAGRANT_DEFAULT_TEMPLATE
2018-09-07 11:17:46 -07:00
Brian Cain e76c35e466
Update CHANGELOG 2018-09-07 10:45:02 -07:00
Brian Cain 6c8d997053
Merge pull request #10181 from chrisroberts/f-auto-checkpoints
Check for automatic checkpoint support before configuring
2018-09-07 10:44:26 -07:00
Brian Cain 1b05a68277
Update CHANGELOG 2018-09-07 10:44:03 -07:00
Brian Cain c589a667ed
Merge pull request #10182 from chrisroberts/f-ssh-config
Check verify_host_key for falsey or :never values when generating ssh config
2018-09-07 10:43:26 -07:00
Brian Cain b6961d7453
Update CHANGELOG 2018-09-07 10:37:38 -07:00
Brian Cain 798c673408
Merge pull request #10191 from fnordfish/feature/ask_version_match
add `Vagrant.version?` helper method
2018-09-07 10:36:38 -07:00
Brian Cain 5710910ee5
Merge pull request #10192 from briancain/fixup-rsync-auto-option-docs
Add note about rsync__auto option
2018-09-07 10:27:24 -07:00
Brian Cain b339d9edf3
(#10002) Add note about rsync__auto option 2018-09-07 10:09:56 -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
Brian Cain 3ec55d2a51
Update CHANGELOG 2018-09-05 14:28:01 -07:00
Brian Cain cf2de6d714
Merge pull request #10180 from briancain/powershell-cmd-fixup
vagrant powershell command fixup
2018-09-05 14:27:10 -07:00
Chris Roberts 147b5c653e Check verify_host_key for falsey or :never values when generating ssh config 2018-09-05 13:44:07 -07:00
Chris Roberts 1f74aedeaa Check for automatic checkpoint support before configuring
The AutomaticCheckpointsEnabled option may not always be available
depending on the version in use. Check for support before applying
the configured value. If automatic checkpoints are to be enabled
and support is not available, force an error.
2018-09-05 13:37:45 -07:00
Brian Cain c3c65a3793
Fixup docs and website wording for command 2018-09-05 13:26:22 -07:00
Brian Cain b1a0fa628f
Add subcommand docstring to powershell 2018-09-05 12:56:17 -07:00
Brian Cain d6e43d3197
Include winrm locales 2018-09-05 11:00:45 -07:00
Chris Roberts 7a7ae59704 Update CHANGELOG 2018-09-04 08:03:34 -07:00
Chris Roberts f50bf62cd1
Merge pull request #10165 from chrisroberts/f-has-plugin
Update Vagrant.has_plugin? helper to function prior to plugin loading
2018-09-04 08:02:29 -07:00
Sebastian Reuße 3efdc8960c vagrant init: Support VAGRANT_DEFAULT_TEMPLATE 2018-09-04 10:48:16 +02:00
Gabriel Filion da600bc940 bash: complete running VM names for destroy subcommand
for some reason there is currently no completion at all for the destroy
subcommand. like the other commands already present in that code block,
destroy acts on currently running VMs and so it makes sense to complete
those names.
2018-09-03 04:00:47 -04: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
Brian Cain 07092bc36f
Update CHANGELOG 2018-08-31 11:04:09 -07:00
Brian Cain f51176a101
Merge pull request #10140 from berney/fix-ansible-perm-issue
Fix ansible_local provisioner permission bug
2018-08-31 11:02:47 -07:00
Brian Cain 143d75a2bd
Update CHANGELOG 2018-08-31 10:40:17 -07:00
Brian Cain 3243f996b5
Merge pull request #8912 from tolbrino/fix/master/openbsd_ipv6
Add IPv6 network template for OpenBSD machines
2018-08-31 10:39:45 -07:00
Brian Cain ac749db2d4
Update CHANGELOG 2018-08-31 10:04:58 -07:00
Brian Cain 11c619bff6
Merge pull request #10092 from jmaness/patch-1
[#10098] Filter out empty strings and loopback interfaces when constructing the list of network interfaces
2018-08-31 10:03:49 -07:00
Chris Roberts e3df56be64
Merge pull request #10159 from bbrala/patch-1
Changelog missing version
2018-08-31 07:36:05 -07:00
Chris Roberts 9cc642f3bf Update vmware utility version 2018-08-31 07:18:09 -07:00
Björn Brala 96db54d23c
Changelog missing version
Seems in the rush to get a new version out, the changelog wasn't updated?
2018-08-31 09:20:09 +02:00
Chris Roberts 4647fc743e Update version for dev 2018-08-30 13:44:16 -07:00
Chris Roberts e1e6755b19 Update website version 2.1.4 2018-08-30 13:43:18 -07:00
Chris Roberts 574ae312c9 Release v2.1.4 2018-08-30 13:39:10 -07:00
Chris Roberts e4da39c011 Update CHANGELOG 2018-08-30 11:34:04 -07:00
Chris Roberts a5177f506d
Merge pull request #10156 from chrisroberts/f-smb-list-parse
Extract smblist information based on position
2018-08-30 11:32:45 -07:00
Chris Roberts 0208b5459f Update CHANGELOG 2018-08-30 11:30:47 -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 e7eb03908e Update CHANGELOG 2018-08-30 11:29:45 -07:00
Chris Roberts 9204e41d61
Merge pull request #10154 from chrisroberts/f-local-plugin-prompt
Fix local plugin prompt and add coverage
2018-08-30 11:29:00 -07:00
Chris Roberts c4084a6387 Extract smblist information based on position
Since we are no longer extracting information based on key value due
to localization issues, use start and end locations to extract data.
This prevents errors when extra information is included like Scope.
2018-08-30 10:58:56 -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
Chris Roberts 4974c14845 Update version for dev 2018-08-29 14:15:15 -07:00
Chris Roberts 0c356f526d Update website version 2.1.3 2018-08-29 14:14:48 -07:00
Chris Roberts 825e62087e Release v2.1.3 2018-08-29 12:59:24 -07:00
Chris Roberts 6ecfb831b5
Merge pull request #10147 from hashicorp/f-updateReseller
Update reseller.html.md
2018-08-29 07:23:49 -07:00
Alvaro Miranda Aguilera 7919d74a90
Update reseller.html.md 2018-08-28 21:53:46 +02:00
Alvaro Miranda Aguilera c1d27fa36c
Update reseller.html.md 2018-08-28 21:52:09 +02:00
Chris Roberts 636b1c9702
Merge pull request #10143 from chrisroberts/f-rsync-host-key
Check :verify_host_key value for :never or if falsey
2018-08-24 14:47:00 -07:00
Chris Roberts d48b95ffaf Check :verify_host_key value for :never or if falsey 2018-08-24 14:11:30 -07:00
Berne Campbell b036032cb0 fix typo 2018-08-23 13:07:56 +10:00
Berne Campbell 0d23724a1f Fix ansible provisioner permission bug 2018-08-22 20:32:40 +10:00
Brian Cain 38d48ba153
Update CHANGELOG 2018-08-17 15:29:41 -07:00
Brian Cain 6a57ae74a8
Merge pull request #10118 from briancain/TRIGGER-SPACE-PATH
Allow for spaces in `path` for trigger run option
2018-08-17 15:29:07 -07:00
Brian Cain 6dab92f209
Update CHANGELOG 2018-08-17 15:19:13 -07:00
Brian Cain b1357a2f60
Merge pull request #10123 from briancain/add-force-flag-reload
Add `--force` flag to reload command
2018-08-17 15:18:36 -07:00
Brian Cain 5723c7181a
Add test for trigger run path with spaces 2018-08-17 15:17:49 -07:00
Brian Cain 93c7bd5e22
Merge pull request #10127 from briancain/doc-hostname-etc-hosts
Add note about /etc/hosts for guest hostname setting
2018-08-17 15:16:18 -07:00
Brian Cain 864974d762
Merge pull request #10121 from briancain/fix-login-typo
Fix typo in cli login docs
2018-08-17 15:16:06 -07:00
Brian Cain e18bd076e7
Merge pull request #10117 from briancain/puppet-module-list
Documentation: Update `module_path` type for puppet apply provisioner
2018-08-17 15:16:00 -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 1679e383d6
Update CHANGELOG 2018-08-17 15:13:46 -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 c9a31f7800
Merge pull request #10115 from briancain/flatten-ps-cmds-triggers
Properly join commands from passed in array
2018-08-17 15:10:46 -07:00
Brian Cain f9892e0b24
Merge pull request #10124 from briancain/fixup-subprocess-tests-darwin
Fix up subprocess test to not be darwin
2018-08-17 15:10:25 -07:00
Brian Cain e784112be1
Update CHANGELOG 2018-08-17 15:09:39 -07:00
Brian Cain c2cff0dc07
Merge pull request #10100 from briancain/DOCKER-TOOLBOX
Convert windows paths for volume mounts on docker driver
2018-08-17 15:08:59 -07:00
Brian Cain efcdec5729
Update CHANGELOG 2018-08-17 11:23:51 -07:00
Brian Cain c61f58049c
Merge pull request #10126 from briancain/docker-machine-name
Only write box metadata if guest has box object
2018-08-17 11:22:44 -07:00
Brian Cain c562db4c6e
(#10125) Add note about /etc/hosts for guest hostname setting 2018-08-17 10:51:00 -07:00
Brian Cain e5364e7798
Only write box metadata if guest has box object
Prior to this commit, providers like docker would fail to be brought up
because they do not store box objects like virtualbox or vmware
provider guests. This commit fixes that by making sure the box object
exists before writing the metadata file to disk.
2018-08-17 09:58:24 -07:00
Brian Cain fec681c1af
Fix up subprocess test to not be darwin 2018-08-16 14:57:56 -07:00
Brian Cain c65a0a9054
(#9677) Add `--force` flag to reload command
This commit introduces the `--force` flag to the reload command. This
change means that if the flag is included, the halt step of the reload
will forcefully shutdown the virtual machine rather than a graceful
halt.
2018-08-16 13:57:13 -07:00
Brian Cain bd27c15c56
Fix typo in cli login docs 2018-08-15 09:51:22 -07:00
Brian Cain 8bce4f3828
Update tests to include passed in arg values 2018-08-14 13:24:42 -07:00
Brian Cain bcd0deba8b
(#10091) Update `module_path` type for puppet apply provisioner
This commit updates the documentation for `module_path` to say that it
can be both a string or array of string paths.
2018-08-14 13:07:14 -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
Tino Breddin 5e642a513f Add IPv6 network template for OpenBSD machines 2018-08-13 16:51:57 +02:00
Brian Cain 5d2d784ae7
(#9085) - Add test for converting windows paths
This commit adds a test for checking that a windows path for mounting a
volume in a container is properly converted into something that's
usable.
2018-08-08 10:30:04 -07:00
Chris Roberts 64acd68c64 Update CHANGELOG 2018-08-08 08:30:08 -07:00
Chris Roberts 2c4c14c57c
Merge pull request #10084 from chrisroberts/f-host-nfs-sudo
Fix sudo usage in exports write within linux host cap
2018-08-08 08:28:49 -07:00
Chris Roberts cc2d3c159e Update CHANGELOG 2018-08-08 08:28:21 -07:00
Chris Roberts 8ec7963968
Merge pull request #10083 from chrisroberts/f-box-ver-up
Store box metadata of active guest
2018-08-08 08:25:47 -07:00
Brian Cain 08fc577603
Update CHANGELOG 2018-08-07 13:14:22 -07:00
Brian Cain 9ec2eae5c9
Merge pull request #9976 from Biteable/fix-cmd-command
Allow shared folders to be mounted after installing MSYS2
2018-08-07 13:13:05 -07:00
Paweł Niedzielski e76d0e78d2 Add usable_port_range to port forwarding docs (#10090)
* Add usable_port_range to port forwarding docs

* Add usable_port_range to port forwarding docs
2018-08-06 10:52:01 -07:00
Jeremy Maness a73fb9c139 - Filter out empty strings when constructing the list of network interfaces
- Sort interfaces properly whose name does not contain a numeric suffix (e.g. lo)
- Filter out loopback interfaces
2018-08-04 21:16:51 -04:00
Chris Roberts d44b97482f Remove migration page from vagrantcloud docs 2018-08-03 06:57:17 -07:00
Chris Roberts ceb7a0b5ac When doing box lookup, use explicit provider, machine provider, then default 2018-08-02 16:41:28 -07:00
Chris Roberts 00b783a6a5 Lookup latest available installed box if required on update
When performing a box update and the box version has been updated
to be different than the installed version, perform a lookup for
the latest available installed box to allow the update command to
continue successfully
2018-08-02 16:12:10 -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 051c7a7823 Fix sudo usage in exports write within linux host cap
Only move new exports file to destination without sudo when the
file has write access and the directory has write access. Always
use sudo when changing file ownership.
2018-08-02 15:13:27 -07:00
Brian Cain 88d2e25634
Update CHANGELOG 2018-08-02 11:33:42 -07:00
Brian Cain 7ab3ba8cd3
Merge pull request #10081 from briancain/add-extra-guest-check-solaris11
Add back check for Solaris derived guests
2018-08-02 11:32:33 -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
Brian Cain b3da2bd21f
(#9614) Add back check for Solaris derived guests
This commit adds back the `uname` test 93c571adbf
removed to catch any solaris 11 derived guests like openindiana
2018-08-01 14:25:04 -07:00
Chris Roberts 9daea21c4f Update CHANGELOG 2018-07-31 13:58:11 -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 6a0bb8b8bc Update CHANGELOG 2018-07-31 13:55:35 -07:00
Chris Roberts de284a9056
Merge pull request #10079 from chrisroberts/f-win-virt-ext
Enable ExposeVirtualizationExtensions only when available
2018-07-31 13:54:55 -07:00
Chris Roberts 80d242c4ba Update CHANGELOG 2018-07-31 13:53:38 -07:00
Chris Roberts 09c8e2800c
Merge pull request #10077 from chrisroberts/e-ipv6-link-local
Skip link-local addresses when fixing IPv6 route
2018-07-31 13:52:50 -07:00
Chris Roberts 8be550b339 Update CHANGELOG 2018-07-31 13:52:09 -07:00
Chris Roberts e3e68c9b51
Merge pull request #10076 from chrisroberts/e-winrm-warn
Add warning when vagrant-winrm is found
2018-07-31 13:51:23 -07:00
Chris Roberts 0f421dbc81 Update CHANGELOG 2018-07-31 13:50:59 -07:00
Chris Roberts fa9bda9554
Merge pull request #10066 from chrisroberts/e-net-ssh-update
Update net-ssh constraint
2018-07-31 13:48:49 -07:00
Chris Roberts 9c149ba8b1 Only enable ExposeVirtualizationExtensions if available within Hyper-V version 2018-07-31 13:33:41 -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 87ee57d94a Add test coverage on link-local skip for ipv6 in vbox 2018-07-30 15:16:50 -07:00
Cédric Félizard f53238d253 Skip link-local addresses when fixing IPv6 route
This occurs with a Linux host when a link-local address is configured
for vboxnet0 (which is the default for VirtualBox 5.2.6).

`connect': Invalid argument - connect(2) for "fe80::ffff:ffff:ffff:ffff" port 80 (Errno::EINVAL)
2018-07-30 15:00:35 -07:00
Chris Roberts dcfb84893d Only reset the _init on testing cleanup 2018-07-30 14:44:36 -07:00
Chris Roberts cd7215ab13 Add warning when vagrant-winrm is found 2018-07-30 13:27:20 -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
Brian Cain 80edb39122
Merge pull request #10069 from mmwtsn/docs-synced-folder-ownership
Clarify the owner/group of synced folders
2018-07-30 09:27:18 -07:00
Brian Cain 61f5511631
Merge pull request #10073 from dareenzo/patch-1
Fix typo: operation systems -> operating systems
2018-07-30 09:17:35 -07:00
Brian Cain 66bd13732c
Merge pull request #10067 from pleycpl/patch-1
Colorize ruby commands
2018-07-30 08:59:24 -07:00
Paulo Phagula 6d79afd8fe
Fix typo: operation systems -> operating systems 2018-07-30 12:24:00 +02:00
h4rvey r0ss 63e712dead Colorize ruby commands 2018-07-28 20:10:57 +03:00
Brian Cain cd3271ba2d
Merge pull request #10065 from briancain/VIRT-INSTALL-NOTE
Update installation docs with multi-hypervisor warning
2018-07-27 16:54:34 -07:00
Chris Roberts 0e0f660f62 Fix stray test checking verify_host_key 2018-07-27 16:51:58 -07:00
Chris Roberts 57e0bb5105 Update net-ssh constraint
Also includes mapping of verify_host_key value to new values
introduced in 5.0.0
2018-07-27 16:30:06 -07:00
Brian Cain f7b0fbeb88
Add message about hyper-v and virtualbox 2018-07-27 16:24:34 -07:00
Brian Cain b54d14465c
Merge pull request #10047 from hashicorp/kikitux-patch-1
Update ssh.html.md
2018-07-27 15:51:25 -07:00
Brian Cain e31c73d287
Update CHANGELOG 2018-07-27 15:33:26 -07:00
Brian Cain cd7c4e3428
Merge pull request #10064 from briancain/DOCKER-VOLUME
Support Docker volume consistency for synced folders
2018-07-27 15:32:38 -07:00
Brian Cain a3ef471cb0
(#9811) Add test for volume consistency and improve documentation 2018-07-27 15:16:39 -07:00
Matthew Olenik 428eb3ed93
Support Docker volume consistency for synced folders
Adds the `docker_consistency` option, which sets the Docker volume
consistency level. This can be used to greatly improved synced folder
performance, especially on macOS.

See for details: moby/moby#31047
2018-07-27 15:16:39 -07:00
Brian Cain 5ca95c9e5a
Update CHANGELOG 2018-07-27 13:59:55 -07:00
Brian Cain 9f8663551c
Merge pull request #10063 from briancain/ensure-securerandom-is-required
Ensure the SecureRandom library is loaded
2018-07-27 13:59:10 -07:00
Brian Cain 72f3a7be14
Ensure the SecureRandom library is loaded 2018-07-27 13:44:24 -07:00
Chris Roberts 523d8196d7 Update CHANGELOG 2018-07-27 12:12:44 -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 6c40b905cb Update CHANGELOG 2018-07-27 10:28:51 -07:00
Chris Roberts 8ff29d5c05
Merge pull request #10043 from chrisroberts/f-smb-localization
Remove localization dependency from SMB list generation
2018-07-27 10:27:54 -07:00
Chris Roberts 6059204ec6 Update CHANGELOG 2018-07-27 10:27:08 -07:00
Chris Roberts f9e994a15d Match package install string and fix test name 2018-07-27 10:26:10 -07:00
Chris Roberts 584b288b8f
Merge pull request #9935 from whitel/fix-for-#9878
Fixes the change in packaging for nfs in f28 (#9878)
2018-07-27 10:22:42 -07:00
Chris Roberts 11745207db Update CHANGELOG 2018-07-27 10:03:40 -07:00
Chris Roberts 7cae959a53
Merge pull request #9987 from oaken-source/master
contrib/bash/completion.sh: replaced -VAGRANTSLASH- with a literal sl…
2018-07-27 10:01:42 -07:00
Chris Roberts b8bb139fcd Update CHANGELOG 2018-07-27 09:58:26 -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 58bff66cbb Update CHANGELOG 2018-07-27 09:51:02 -07:00
Chris Roberts ab4dbe85d6
Merge pull request #10041 from chrisroberts/f-downloader-mtch
Prevent matching on other Location headers
2018-07-27 09:50:17 -07:00
Maxwell Watson 6713717b95
Clarify the owner/group of synced folders
This is the intended behavior but it is not obvious. When setting up synced
folders that require parent folders (e.g. folders that live in Go's `GOPATH`)
this has the potential to catch users off guard. See #2257.
2018-07-27 12:28:49 -04:00
Alvaro Miranda Aguilera d174fc960a
feedback update
update based on feedback
2018-07-20 21:48:46 +02:00
Brian Cain 0ee1d82359
Merge pull request #10048 from briancain/fix-powershell-timeout-docs
Add more information about powershell timeout env var
2018-07-20 09:24:14 -07:00
Brian Cain f2187e08bf
Add more information about powershell timeout env var 2018-07-20 09:15:31 -07:00
Alvaro Miranda Aguilera c31953a6d7
Update ssh.html.md 2018-07-20 17:20:59 +02:00
Chris Roberts c7ea127ab9 Update CHANGELOG 2018-07-19 14:15:21 -07:00
Chris Roberts 4d4e707b73
Merge pull request #9889 from treytabner/debian-systemd-networkd
Increase priority and support multiple networks for Debian with systemd-networkd
2018-07-19 14:13:46 -07:00
Chris Roberts 2096bce36f Remove localization dependency from SMB list generation 2018-07-19 13:40:54 -07:00
Chris Roberts a55cf16923 Remove atlas reference from docs and update link to Packer documentation 2018-07-19 10:58:15 -07:00
Chris Roberts ae14f95124 Properly downcase answer for check. Default response to no. 2018-07-19 10:31:32 -07:00
Chris Roberts 0558a2f49e Include missing assignment in docs 2018-07-19 09:52:34 -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 1b9465ea2c Update CHANGELOG 2018-07-18 16:43:52 -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 fc2ff39a86 Update CHANGELOG 2018-07-18 16:42:13 -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 30846c8195 Update CHANGELOG 2018-07-18 16:40:41 -07:00
Chris Roberts 110600970a
Merge pull request #10000 from chrisroberts/f-hyperv-access-localized
Fix Hyper-V access check
2018-07-18 16:39:54 -07:00
Chris Roberts 84d2caeec1 Update CHANGELOG 2018-07-18 16:39:32 -07:00
Chris Roberts 10faa599e7
Merge pull request #9999 from chrisroberts/f-hyper-v-snaps
Enable checkpoints for snapshots if disabled
2018-07-18 16:38:32 -07:00
Chris Roberts 2f135b99c8 Update CHANGELOG 2018-07-18 16:37:50 -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 e9623ca52b Add documentation for plugins entry in Vagrantfile 2018-07-18 15:49:30 -07:00
Chris Roberts 7c9fb9a5d7 Use availablity of local plugins file instead of option 2018-07-18 15:49:30 -07:00
Chris Roberts 8e0e2fc53a Add output for local repair 2018-07-18 15:49:30 -07:00
Chris Roberts ab39125570 Set options directly instead of lazy merging 2018-07-18 15:47:35 -07:00
Chris Roberts 0a3d40bd33 Include documentation on local plugin load environment variable 2018-07-18 14:20:39 -07:00
Chris Roberts 7a20c772ec Add new flags for the plugin subcommands 2018-07-18 14:20:08 -07:00
Chris Roberts 8445b496d8 Use consistent terms for describing local flag 2018-07-18 14:19:29 -07:00
Chris Roberts 7a623d2826 Include local flag for plugin update command 2018-07-18 14:02:17 -07:00
Chris Roberts 3fd55dac23 Add local plugin repair support. Update global repair implementation. 2018-07-18 13:46:17 -07:00
Chris Roberts ef0269c538 Add action method for local plugin repair 2018-07-18 13:45:15 -07:00
Chris Roberts 14edb8f423 Add local only and global only flags to plugin expunge command 2018-07-18 13:43:52 -07:00
Chris Roberts 564dff651e Add coverage on vagrantfile_name stubbing behavior 2018-07-18 10:50:41 -07:00
Chris Roberts 1cd8a4b9be Allow vagrantfile_name stub disable via environment variable 2018-07-18 10:50:06 -07:00
Chris Roberts 3e22764ac8 Add test coverage on globalize and localize within plugin manager 2018-07-18 10:48:57 -07:00
Chris Roberts c5a6790192 Only run bundler initialization if plugin initialization is enabled 2018-07-18 10:48:22 -07:00
Chris Roberts 9d191a2419 Add local option stub to allow Vagrantfile loading 2018-07-17 15:35:25 -07:00
Chris Roberts c605b7d875 Update option name for local plugin installation 2018-07-17 15:35:25 -07:00
Chris Roberts 8baf7ced38 Use path of state file, not state file itself 2018-07-17 15:35:25 -07:00
Chris Roberts 737ef0eded Allow Vagrantfile to load when using --local 2018-07-17 15:00:38 -07:00
Chris Roberts 78bf131dc8 Do not use singleton for testing 2018-07-17 14:49:41 -07:00
Chris Roberts 3223737734 Use env_local consistently internally 2018-07-17 14:49:41 -07:00
Chris Roberts a410b0af51 Start adding bundler coverage 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 1f279445ac Update CHANGELOG 2018-07-17 14:49:19 -07:00
Chris Roberts 81f9994293
Merge pull request #10030 from chrisroberts/f-plugin-cmd
Disable vagrantfile with plugin commands
2018-07-17 14:48:26 -07:00
Chris Roberts 8c7e420b20 Update CHANGELOG 2018-07-17 10:01:09 -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 516e1d2621 Add test coverage on the vagrant bin file behavior 2018-07-17 08:00:12 -07:00
Chris Roberts 9321f3cb6c Ensure the vagrantfile_name option is stubbed when using plugin commands 2018-07-16 16:54:43 -07:00
Chris Roberts 2ac0b0c3a9 Update utility version for downloads page 2018-07-16 15:08:14 -07:00
Justin Campbell e56e85c94d
Merge pull request #10020 from hashicorp/website-vagrant-cloud-api-search
website: Document Vagrant Cloud search API
2018-07-16 16:46:49 -04:00
Aloz1 b9b9eeac85 Void requires root access to check service status
Service status check was failing because it was not being run as root. This resulted in vagrant thinking the service was not running, hence it would always try to start nfs rather than updating exports.
2018-07-14 15:53:13 +10:00
Brian Cain 386b646fc2
Update CHANGELOG 2018-07-13 15:47:11 -07:00
Brian Cain 15a9185616
Merge pull request #10005 from briancain/add-exit-code-checks-for-run-scripts
Catch and allow for non-standard exit codes
2018-07-13 15:45:54 -07:00
Chris Roberts 8aa74a03a0 Differentiate checkpoints and automatic checkpoints
Provide separate configuration settings for enabling/disabling
checkpoints and automatic checkpoints with Hyper-V provider.
2018-07-13 15:23:09 -07:00
Justin Campbell 3e0477c20b website: Add downloads to box API responses 2018-07-13 14:57:05 -04:00
Justin Campbell a2abbcdc92 website: Document Vagrant Cloud search API 2018-07-13 14:55:00 -04:00
Chris Roberts 6f81d16691 Remove final #to_s on path 2018-07-12 16:49:22 -07:00
Aloz1 5e258cbc7c Fixed nfs_start_command. NFS now starts. 2018-07-13 08:08:05 +10:00
Thomas Röggla 2613d620fd checking whether the field location_uri.host is nil 2018-07-12 15:49:26 +02:00
Aloz1 98f70d4d7a Add void linux host support 2018-07-12 08:40:33 +10: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 1a67b59292 Update WSL docs page 2018-07-06 16:58:12 -07:00
Chris Roberts 2667de163b Enable rsync synced folders for non-DrvFs file systems within WSL 2018-07-06 16:58:12 -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 1f99da7a11 Update CHANGELOG 2018-07-06 16:51:57 -07:00
Chris Roberts 41d4c9aad4
Merge pull request #9952 from chrisroberts/f-ftp-push-toomanyfiles
Provide custom error when attempting to push too many files with FTP
2018-07-06 16:50:56 -07:00
Chris Roberts cf29085d33 Fix root directory generation on failed access 2018-07-06 16:27:52 -07:00
Chris Roberts 15dacc80c0 Update ACL check to use identifier to prevent localization errors 2018-07-06 16:25:05 -07:00
Chris Roberts a9bc0bb800 Do not provision and configure when state is saved 2018-07-06 15:49:36 -07:00
Chris Roberts 630bc6540d Enable standard checkpoint on VM for snapshot if disabled 2018-07-06 15:29:07 -07:00
Caleb Martinez 0a1f10c829
Added corresponding documentation
Documentation added for proposed environment variable `VAGRANT_USER_AGENT_PROVISIONAL_STRING`.
2018-07-06 17:51:59 -04:00
Chris Roberts 6aa5c1a008 Always force string type conversion of path
Fixes #9984
2018-07-06 14:29:32 -07:00
Andreas Grapentin 31766f8ba1
contrib/bash/completion.sh: replaced -VAGRANTSLASH- with a literal slash in box names 2018-07-04 13:55:05 +02:00
William Bowling 4ec865b69d
Make sure that the correct cmd is run
After installing msys2, there is another `cmd` on the path which prevents shared folders from being mounted. Explicitly calling `cmd.exe` fixes the issue
2018-07-02 13:15:10 +10:00
Brian Cain 04f7215b5e
Update CHANGELOG 2018-06-29 09:26:48 -07:00
Brian Cain 0872609b59
Merge pull request #9968 from verheyenkoen/version-check-display-installed-version
Display current version in version check
2018-06-29 09:25:59 -07:00
Koen Verheyen 614570fd89 Typo in en.yml 2018-06-29 16:44:43 +02: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
Justin Campbell 45dcc43392
Merge pull request #9953 from hashicorp/website-vagrant-cloud-api-delete-token
website: Vagrant Cloud API docs - deleting tokens
2018-06-27 14:04:28 -04:00
Chris Roberts 8617e1cf26 Update version for dev 2018-06-26 13:51:13 -07:00
Chris Roberts 2cc33870d0 Update website vagrant version 2.1.2 2018-06-26 13:50:11 -07:00
Justin Campbell 969f6fda41 website: Vagrant Cloud API docs - deleting tokens 2018-06-26 12:44:56 -04:00
Chris Roberts 26497ec2b1 Release v2.1.2 2018-06-26 08:54:09 -07:00
Chris Roberts ac8ad59823 Provide custom error when attempting to push too many files with FTP
When the configured directory for FTP push has too many files, it will
generate an exception and fail due to a stack overflow. When this happens
just rescue out the exception and re-raise a custom error to provide
some context to the user on the actual problem.
2018-06-26 08:28:01 -07:00
Chris Roberts 85acf0cac7 Update box versions 2018-06-19 09:57:03 -07:00
Chris Roberts 3f9755b698 Update CHANGELOG 2018-06-18 15:46:56 -07:00
Chris Roberts 54986a90fd
Merge pull request #9944 from chrisroberts/e-hyperv-dirperms
Add Hyper-V access check on data directory
2018-06-18 15:45:10 -07:00
Chris Roberts 101fc447ec Add Hyper-V access check on data directory 2018-06-18 15:36:45 -07:00
Chris Roberts d12c280005 Update CHANGELOG 2018-06-18 15:30:24 -07:00
Chris Roberts 0134a235e7
Merge pull request #9943 from chrisroberts/e-wsl-hyperv
Support Hyper-V provider within WSL
2018-06-18 15:29:01 -07:00
Chris Roberts ed2af17e45 Add delete vm action checks for data directory removal and creation 2018-06-18 10:18:05 -07:00
Chris Roberts 69ece0db4e Always return string value when converting path 2018-06-18 10:02:59 -07:00
Chris Roberts ea4e60247d Check for module_path entry instead of custom environment variable 2018-06-18 09:53:22 -07:00
Chris Roberts 941dd77a90 Force string conversion on paths 2018-06-18 09:53:06 -07:00
Chris Roberts 835c500892 Add WSL check on usable? test for provider 2018-06-18 09:50:56 -07:00
Chris Roberts c5c63d291d Only expand path if not in windows format 2018-06-18 09:39:30 -07:00
Chris Roberts cdab45424e Clean up powershell tests and add test for full path check 2018-06-18 09:39:17 -07:00
langdon f0b9d025e4 Fixes the change in packaging for nfs in f28 (#9878). However, removed part of the unit test which will be very difficult to fix (I expect). The unit test is still doing a good test that nfs and rpcbind work though. If you go far enough back, you need to bury the error out too. 2018-06-18 12:16:23 -04:00
Chris Roberts fe8fe55d1f Delete and re-create data directory when destroying guest 2018-06-18 09:09:27 -07:00
Chris Roberts a8abb6898c Fix PowerShell cmdlet name for clones 2018-06-18 09:09:01 -07:00
Chris Roberts 1e5c8bf275 Add check for WSL when determining if Hyper-V is usable 2018-06-18 09:08:35 -07:00
Chris Roberts d84f29f12c Just provide module path as conversion is done earlier 2018-06-18 09:08:05 -07:00
Chris Roberts 07c5fd4885 Fix SMB error message to be within the correct namespace 2018-06-18 09:07:30 -07:00
Chris Roberts 97eb459f56 Always expand to full path before converting to Windows path 2018-06-18 09:07:12 -07:00
Brian Cain 43f63dfbc2
Merge pull request #9940 from marjune163/doc-improve
use vagrant file version 2 configuration for nfs synced folder
2018-06-18 09:00:50 -07:00
Chris Roberts 3f23466703 Replace file separators when decompressing box files 2018-06-18 08:57:29 -07:00
marjune f2faabec25 use vagrant file version 2 configuration for nfs synced folder 2018-06-17 23:31:15 +08: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
Chris Roberts 5384c037b7 Update CHANGELOG 2018-06-15 08:59:30 -07:00
Chris Roberts 59709802da
Merge pull request #9936 from chrisroberts/u-hyperv-import-errors
Attempt to provide helper error message on failed VM import
2018-06-15 08:57:14 -07:00
Chris Roberts 8fbf27772a Always ensure full path to configuration file on import 2018-06-15 07:48:14 -07:00
Chris Roberts 694104b005 Attempt to provide helper error message on failed VM import
When importing a Hyper-V VM fails, attempt to manually build
a system definition and inspect the result to determine cause
of the failure.
2018-06-14 16:40:37 -07:00
Chris Roberts 2c24bcc433 Update CHANGELOG 2018-06-13 14:52:53 -07:00
Chris Roberts 3919455f08
Merge pull request #9932 from chrisroberts/e-hyperv-maxmem-chk
Validate maxmemory setting within Hyper-V provider
2018-06-13 14:52:09 -07:00
Chris Roberts 4d3f5d33c6
Merge pull request #9925 from chrisroberts/u-powershelling
Misc. PowerShell cleanup
2018-06-13 14:51:43 -07:00
Chris Roberts 9482f351fc Validate maxmemory setting within Hyper-V provider
Forces an error if maxmemory value is less than the configured
minimum or startup memory.

Fixes #9477
2018-06-13 13:27:11 -07:00
Chris Roberts c7e35d655c
Merge pull request #9929 from chrisroberts/f-hyperv-netadapt
Disconnect all configured network adapters
2018-06-13 13:15:32 -07:00
Trey Tabner c218267436
Merge branch 'master' into debian-systemd-networkd 2018-06-13 12:49:50 -05:00
Brian Cain 52c1abbcfc
Merge pull request #9930 from mstovicek/patch-1
Add `suspend` into a list of available actions
2018-06-13 10:02:11 -07:00
Milan Stovicek 3ce7c0cf3f
Add `suspend` into a list of available actions
`suspend` action is not listed, even though it can be used and it works.

```
$ vagrant --version
Vagrant 2.1.1
```

```
config.trigger.before [:suspend] do |trigger|
  trigger.name = "Before suspend"
  trigger.run = {inline: "..."}
end
````
2018-06-13 18:51:45 +02:00
Chris Roberts 1554f447f2 Disconnect all configured network adapters
When importing a Hyper-V VM ensure all adapters are disconnected from
switches that were used when the box was built.
2018-06-13 07:59:56 -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 10ac204c29 Prevent SMB output from being wrapped 2018-06-12 16:47:47 -07:00
Chris Roberts ef4d431d36 Remove console resizing on powershell commands 2018-06-12 16:47:47 -07:00
Chris Roberts 57842d7269 Update powershell messaging functions to not include second `-` character. 2018-06-12 16:47:47 -07:00
Chris Roberts e43a94b797 Update CHANGELOG 2018-06-12 16:46:57 -07:00
Chris Roberts ee5656da37
Merge pull request #9923 from chrisroberts/f-win-perms
Update SSH key file permissions handling
2018-06-12 16:45:39 -07:00
Chris Roberts 305a251c7b Update Ruby test versions 2018-06-12 16:31:53 -07:00
Chris Roberts 7e0cc99ffd Include flag check on ssh cap test 2018-06-12 16:30:51 -07:00
Chris Roberts d2723f2008 Update CHANGELOG 2018-06-12 16:25:44 -07:00
Chris Roberts 4bf8fe1463
Merge pull request #9917 from chrisroberts/f-smb-garbage
Fix SMB information generation when using net share
2018-06-12 16:24:54 -07:00
Chris Roberts d8e64dd9be Update CHANGELOG 2018-06-12 16:24:21 -07:00
Chris Roberts 87ce38df93
Merge pull request #9916 from chrisroberts/f-chef-provisioner
Fix Chef apply provisioner to not set node_name
2018-06-12 16:23:39 -07:00
Chris Roberts e39b3555e6 Disable inherit on key file for parent ACL rules 2018-06-12 16:21:13 -07:00
Chris Roberts ae8e25aabc Include key path flag when calling script 2018-06-12 16:20:49 -07:00
Chris Roberts 16bcc1d874 Include scripts directory when building pathname 2018-06-12 16:20:30 -07:00
Chris Roberts 2628d93370 Rename method name when checking capability 2018-06-12 14:13:10 -07:00
Chris Roberts 87b8321702 Remove win32 dependencies 2018-06-12 13:54:37 -07:00
Chris Roberts bf7cd4fb0a Add test coverage for powershell module option 2018-06-12 12:32:04 -07:00
Chris Roberts 42cbae1e90 Add test coverage on ssh capabilities 2018-06-12 11:57:14 -07:00
Chris Roberts 98c6903e9c Fix path variable name. Return process result. 2018-06-12 11:56:37 -07:00
Chris Roberts a5582eb1c8 Add ssh key permissions set caps to hosts 2018-06-12 10:49:10 -07:00
Chris Roberts 5ba91de4d8 Use host capability to update key file permissions if available 2018-06-12 10:46:53 -07:00
Chris Roberts 5325000fa6 Add helper option for setting custom module path on PowerShell executes 2018-06-12 10:44:12 -07:00
Jordan Hewitt 6b022bcbfb Added note on other virtualizers before pre-install. 2018-06-12 08:44:41 -07:00
Chris Roberts ef5eca16d2 Fix SMB information generation when using net share
Adds the final line of output to tests and properly simulates
failure. Fix with type casting to prevent calling methods on
nil and drop the final entry as it's not valid.

Fixes #9806
2018-06-11 12:58:35 -07:00
Chris Roberts 7df6ea5a30 Fix Chef apply provisioner to not set node_name
The base chef provisioner class will set the node name automatically
if not provided in the configuration. Since the chef apply provisioner
does not provide a node_name option, setting it will invalidate the
configuration. This checks for the node name before attempting to
use it.

Fixes #9901
2018-06-11 10:35:52 -07:00
Brian Cain 4efec92643
Merge pull request #9913 from marjune163/doc-improve
add missing section separator for config.ssh part
2018-06-11 09:00:11 -07:00
marjune 8e5dc0dfe8 add missing section separator for config.ssh part 2018-06-10 22:36:45 +08:00
Chris Roberts 0a89909ebd
Merge pull request #9804 from chrisroberts/e-download-changelog
Add link to CHANGELOG for current release on downloads page
2018-06-08 16:19:43 -07:00
Chris Roberts 53b760923a Update CHANGELOG 2018-06-08 16:18:59 -07:00
Chris Roberts 52c174da75
Merge pull request #9833 from afischer-opentext-com/9174
#9174 Remove masterless? config attribute
2018-06-08 16:18:06 -07:00
Chris Roberts 924189b6c2 Update CHANGELOG 2018-06-08 16:09:37 -07:00
Chris Roberts 6f76275f9e
Merge pull request #9867 from jnahorny/fix-9592-systemd-networkd
Fix issue 9592 when systemd-networkd is used by Debian guest
2018-06-08 16:08:27 -07:00
Chris Roberts 77d229edaa Update CHANGELOG 2018-06-08 16:04:44 -07:00
Chris Roberts 9001dc6b9b
Merge pull request #9855 from WIgor/master
Fix for ubuntu 17.10+ netplan
2018-06-08 16:03:07 -07:00
Chris Roberts 6645b7b906
Merge pull request #9910 from TonyApuzzo/fix-set_vm_integration_services
Fix: Correct  typo in hyperv provider, $Enable instead of $enabled
2018-06-08 15:56:39 -07:00
Tony Apuzzo 5ac8bb8620 Correct typo, $Enable instead of $enabled. 2018-06-07 15:00:09 -06:00
Brian Cain 1ee2365599
Merge pull request #9906 from briancain/fix-vc-docs
Fix broken link in Vagrant Cloud API docs
2018-06-06 15:26:10 -07:00
Brian Cain 97806a693e
Fix broken link in Vagrant Cloud API docs
This commit fixes the #TODO link with the proper docs link to upload a
provider.
2018-06-06 15:03:39 -07:00
Chris Roberts 7b8818d985 Update CHANGELOG 2018-06-04 16:53:13 -07:00
Chris Roberts 120fa07a8d
Merge pull request #9872 from chrisroberts/e-hyperv-2
Hyper-V provider overhaul
2018-06-04 16:51:12 -07:00
Brian Cain 67874590b5
Merge pull request #9892 from hashicorp/changelog-update/9879
Update CHANGELOG about #9879 and #9796
2018-05-31 08:22:51 -07:00
Gilles Cornu 56051c1fb0
Update CHANGELOG about #9879 and #9796 2018-05-31 05:52:19 +02:00
Gilles Cornu d5b5e9ea8c ansible_local: Improve installation from PPA
- Fix #9796: Failing installation on bionic (18.04 LTS)
- Remove support for precise (12.04 LTS), which is out of public support
  (On this version, the package python-software-properties contained
  the add-apt-repository tool)
- Reduce the number of SSH calls, and avoid unnecessary apt-get calls.
2018-05-31 05:47:50 +02:00
Chris Roberts 5e68c896cf Force types for testing 2018-05-30 15:42:04 -07:00
Chris Roberts 1be87662da Add missing test coverage for powershell util methods 2018-05-30 15:05:27 -07:00
Chris Roberts 5f4e661155 Add automatic console resize and environment support for powershell commands 2018-05-30 15:04:59 -07:00
Trey Tabner 9197036499
The restart command was moved to after the loop 2018-05-30 11:00:58 -05:00
Brian Cain 708dedc3c3
Merge pull request #9885 from ceefour/patch-1
Remove .
2018-05-30 08:17:18 -07:00
Trey Tabner 59474f80fd Increase priority and support multiple networks 2018-05-30 10:10:36 -05:00
Hendy Irawan 0cd2ea6548
Remove .
The command should be stand-alone, not part of a "sentence":

```
Enable-WindowsOptionalFeature : A positional parameter cannot be found that accepts argument '.'.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Enable-WindowsOptionalFeature], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
```
2018-05-30 17:11:14 +07:00
Chris Roberts 4e09a15acd Remove deprecated warning from non-deprecated option 2018-05-29 11:43:13 -07:00
Chris Roberts 1becae50a5 Include test coverage on provider option deprecation 2018-05-29 10:25:48 -07:00
Chris Roberts 12194cba5a Update Hyper-V provider configuration documentation 2018-05-29 10:21:52 -07:00
Chris Roberts 73c09de1a9 Add deprecation warning when `differencing_disk` option is used 2018-05-29 10:21:06 -07:00
Chris Roberts c238dc0a35 Include machine name when raising invalid box errors 2018-05-25 16:43:17 -07:00
Chris Roberts eba552ea73 Add more test coverage on Hyper-V Provider actions 2018-05-25 16:23:45 -07:00
Chris Roberts d24b432273 Add Hyper-V provider actions test coverage 2018-05-25 15:12:39 -07:00
Chris Roberts 35d8920325 Case insensitive switch check and only write sentinel file if not found 2018-05-25 15:11:58 -07:00
Brian Cain 2f31abfc68
Merge pull request #9869 from hashicorp/review/pr-9864
Review and Adaptation to PR #9864
2018-05-25 13:16:44 -07:00
Gilles Cornu f9f0a9ac0d Ansible Docs: Review and Adapt PR #9864
- Remove undesired blank characters
- The examples attached to a specific option must be concise
- The original example is a tip for a non-standard use case
2018-05-25 21:03:42 +02:00
Chris Roberts 6c731fb86c Add test coverage on hyper-v provider driver 2018-05-25 10:11:44 -07:00
Chris Roberts 2bd6f537ef Clean up syntax and force string type when setting integration option 2018-05-25 10:11:05 -07:00
Chris Roberts beacb5bada Add test coverage for all hyper-v configuration options 2018-05-24 16:56:46 -07:00
Chris Roberts b1f0f1566d Add new entries for hyper-v config validation errors 2018-05-24 16:56:18 -07:00
Chris Roberts d2bc634623 Add vm_integration_services validation 2018-05-24 16:55:35 -07:00
Chris Roberts 52bae21933 Remove unused PowerShell scripts 2018-05-24 15:33:36 -07:00
Jaroslaw Gorny 995c43dd0c Fix issue 9592 when systemd-networkd is used by Debian guest 2018-05-25 00:06:20 +02:00
Chris Roberts e6457d5061 Overhaul the Hyper-V provider 2018-05-24 14:43:44 -07:00
Rémy G 57f12d115c
Update ansible_common.html.md
Added an explanation about locating ansible roles in a non vagrant writeable directory
2018-05-24 14:54:15 +02:00
Rémy G 4b896d9945
ansible_local provisioner tuning example
According to @gildegoma in #9863, here's a concrete example about tuning ansible(_local) provisioner.
2018-05-24 14:22:43 +02:00
Igor Mazur 66b2866373
Shorten if 2018-05-23 11:17:40 +03:00
Igor Mazur 07bbaf9ac5
Fix fo tests (symbol and string dhcp) 2018-05-22 23:29:53 +03:00
Brian Cain dbba41a7ec
Update CHANGELOG 2018-05-22 09:39:47 -07:00
Brian Cain e9f9853b6a
Merge pull request #9856 from Aga303/global_status_informs_about_prune
global status informs about --prune
2018-05-22 09:39:08 -07:00
Aleksi Aalto fa272816ff global status informs about --prune
It's not obvious from the old explanation, how to get
rid of get rid of data that "may not be completely
up-to-date".
2018-05-22 15:20:40 +03:00
Igor Mazur be096c3ef4
Fix for ubuntu 17.10+ netplan
https://github.com/hashicorp/vagrant/issues/9570
2018-05-21 23:48:40 +03:00
Chris Roberts dfb2a9e823
Merge pull request #9841 from hashicorp/welcome
Update CONTRIBUTING.md (and related stuff)
2018-05-17 09:09:30 -07:00
Gilles Cornu 2b684b6f97 CONTRIBUTING: Add missing URL in mailing list link 2018-05-17 08:08:49 +02:00
Gilles Cornu e7da25b9f0 website/README: Add a link to CONTRIBUTING.md 2018-05-16 14:26:14 +02:00
Gilles Cornu 4471bc48fb Update CONTRIBUTING.md (and related stuff)
Motivated by https://twitter.com/mitchellh/status/996381507756294144

[skip ci]
2018-05-16 11:50:37 +02:00
Brian Cain f110d15c93
Update CHANGELOG 2018-05-11 16:42:07 -07:00
Brian Cain c6cd8f1e9a
Merge pull request #9829 from briancain/add-suspend-global
Introduce flag for suspending all machines
2018-05-11 16:41:24 -07:00
Brian Cain aebf20b35c
Update CHANGELOG 2018-05-11 16:41:00 -07:00
Brian Cain 5981ea2c28
Merge pull request #9824 from briancain/fix-netplan-network-renderer
Update netplan config generation to detect NetworkManager
2018-05-11 16:39:52 -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
Brian Cain aa5687cd14
(#7221) Introduce flag for suspending all machines
This commit introduces a new flag to the suspend command,
`--all-global`, which will suepend all vms both locally and globally.
2018-05-11 10:15:48 -07:00
Chris Roberts ba75a03028 Create CODE_OF_CONDUCT.md 2018-05-11 09:01:00 -07:00
Alexander Fischer 0b87184ad4
#9174 Remove masterless? config attribute
Remove the @config.masterless? attribute as there is no benefit from it
2018-05-11 08:49:57 +02:00
Brian Cain 728a9135c8
(#9726) Update netplan config generation to detect NetworkManager
Prior to this commit, when setting up private networks on Ubuntu using
netplan, it assumed that the guest was using systemd, the suggested
default tool to manage networking, and did not take into account devices
that could be managed with NetworkManager. This commit fixes that by
looking at the devices managed on the guest to see if its managed by
NetworkManager, and if so, use that renderer for netplan instead of
networkd.
2018-05-10 13:02:05 -07:00
Brian Cain 02c207b42e
Merge pull request #9817 from jkohrman/master
Add link to privacy policy in website footer
2018-05-09 11:32:12 -07:00
Jeff Kohrman 7d1b9eed17
Add link to privacy policy in website footer
Added link to updated privacy policy in footer of `layout.erb` for the OSS website.
2018-05-09 12:16:58 -06:00
Chris Roberts 4fe840d380 Update CHANGELOG 2018-05-09 09:06:33 -07:00
Brian Cain ad10997049
Update CHANGELOG 2018-05-09 09:04:18 -07:00
Brian Cain e6905501de
Merge pull request #9692 from cyungmann/propagate-unset-guestpath
propagate unset guestpath
2018-05-09 08:58:21 -07:00
Chris Roberts 0b963a5213
Merge pull request #9808 from chrisroberts/f-vagrant-plugin-loading
Vagrant plugin updates
2018-05-09 08:37:04 -07:00
Chris Yungmann 7fb9d3eb4f propagate unset guestpath 2018-05-08 22:51:30 -05:00
Chris Roberts 91018d4edc Remove existing items from request set prior to installation 2018-05-08 13:52:23 -07:00
Chris Roberts d58096da31 Update plugin loading to prevent error suppression
Only catch exception types we care about when attempting to load
plugins. If no require call is successful, force an exception
instead of ignoring.
2018-05-08 13:47:31 -07:00
Chris Roberts 1bba1f86bb Disable plugins on plugin commands but allow init when listing 2018-05-08 13:46:44 -07:00
Chris Roberts f9f762dc0a Add link to CHANGELOG for current release on downloads page 2018-05-07 16:49:53 -07:00
Chris Roberts addc7576cc Update version for dev 2018-05-07 16:40:18 -07:00
Chris Roberts 27fd56de74 Update website vagrant version 2.1.1 2018-05-07 16:38:46 -07:00
Chris Roberts b95e42ad6f Release 2.1.1 2018-05-07 15:08:55 -07:00
Chris Roberts 3f91b39607 Update CHANGELOG 2018-05-07 13:26:12 -07:00
Chris Roberts 3bcdd2901b
Merge pull request #9800 from chrisroberts/e-vbox-builtin
Support VirtualBox shared folders using builtin kernel module
2018-05-07 13:24:50 -07:00
Chris Roberts 9114a1ac80 Update CHANGELOG 2018-05-07 13:09:32 -07:00
Chris Roberts 0a523bc12b
Merge pull request #9785 from chrisroberts/f-smb-list
Use net.exe to fetch SMB shares when Get-SmbShare is not available
2018-05-07 13:07:47 -07:00
Chris Roberts c571249000 Support VirtualBox shared folders using builtin kernel module
Check error output if initial mount command fails to determine if
the builtin module should be used for mounting instead.
2018-05-07 13:02:19 -07:00
Brian Cain 1e857eb360
Update CHANGELOG 2018-05-07 12:25:07 -07:00
Brian Cain e75260d471
Merge pull request #9799 from briancain/guard-trigger-calls
Ensure internal trigger fire does not get called if plugin installed
2018-05-07 12:24:34 -07:00
Brian Cain a177bcf4b7
Ensure internal trigger fire does not get called if plugin installed
This commit wraps up the internal machine action level trigger calls if
the community vagrant-trigger plugin is installed.
2018-05-07 11:33:55 -07:00
Brian Cain 83d102e708
Merge pull request #9793 from rgl/patch-2
reword the triggers only_on documentation
2018-05-07 09:30:19 -07:00
Brian Cain bf095a8525
Merge pull request #9792 from rgl/patch-1
Update configuration.html.md
2018-05-07 09:25:25 -07:00
Chris Roberts e9f9bc75af Update CHANGELOG 2018-05-07 07:59:43 -07:00
Chris Roberts faf7f00a4e
Merge pull request #9781 from chrisroberts/f-hyperv-switch
Update script parameter name in option to switchid
2018-05-07 07:58:49 -07:00
Chris Roberts de1c28aad0 Remove files url from example 2018-05-07 07:27:01 -07:00
Rui Lopes f3b377bd5c
reword the triggers only_on documentation 2018-05-06 20:25:46 +01:00
Rui Lopes a3175259db
Update configuration.html.md
fix typos
2018-05-06 20:23:20 +01:00
Brian Cain dcffe56b74
Update CHANGELOG 2018-05-04 15:01:33 -07:00
Brian Cain f43cacd36a
Merge pull request #9784 from briancain/move-trigger-obj-init
Move triggers object init in machine
2018-05-04 15:00:19 -07:00
Brian Cain 092e73d87f
(#9775) Move triggers object init in machine
Prior to this commit, the hyper-v provider called an action on a machine
that hadn't fully finished initializing. This commit fixes that by
moving up the initialization of the triggers object next to the rest of
the instance variables of the machine object.
2018-05-04 14:32:57 -07:00
Chris Roberts 7a4150dc3f Use net.exe to fetch SMB shares when Get-SmbShare is not available
Fixes #9547
2018-05-04 14:07:33 -07:00
Brian Cain 09be82f1e2
Merge pull request #9778 from OverByThere/patch-1
Syntax error for running remote script
2018-05-04 09:08:56 -07:00
Brian Cain 8c6e574e8a
Merge pull request #9777 from rquadling/patch-1
Update usage.html.md
2018-05-04 09:08:03 -07:00
Chris Roberts 2730fe7ec9 Update script parameter name in option to switchid
Fixes #9774
2018-05-04 08:55:18 -07:00
Dan Clarke 4b99e5676d
Syntax error for running remote script
I either got:
`syntax error, unexpected ':', expecting '}` or `wrong number of arguments (given 1, expected 0) (ArgumentError)` until I added the `=` in.
2018-05-04 15:44:31 +01:00
Richard Quadling 3da8f57d6e
Update usage.html.md
Show a `before` and an `after`.
2018-05-04 15:31:27 +01:00
Chris Roberts 6152f2aa0e Update version for dev 2018-05-03 14:20:44 -07:00
Chris Roberts 0af7ccd2ee Update website vagrant version 2.1.0 2018-05-03 14:16:03 -07:00
Chris Roberts 4eaa045f42 Release v2.1.0 2018-05-03 12:54:04 -07:00
Chris Roberts f5bb95491e Update CHANGELOG 2018-05-03 12:43:22 -07:00
Chris Roberts 02b9d625d3
Merge pull request #9759 from StefanScherer/wsl-remove-raise-vboxmanage-missing
Allow other providers in WSL
2018-05-03 12:42:16 -07:00
Chris Roberts 36622bf932 Update CHANGELOG 2018-05-03 12:41:55 -07:00
Chris Roberts 89d00f4204
Merge pull request #9758 from StefanScherer/wsl-rdp
Call mstsc.exe Windows RDP client in WSL
2018-05-03 12:40:37 -07:00
Chris Roberts d7ccfdd819 Update CHANGELOG 2018-05-03 12:35:54 -07:00
Chris Roberts 40ae8aa38d
Merge pull request #9769 from chrisroberts/e-key-perms
Log error and proceed when private key permissions fail
2018-05-03 12:34:50 -07:00
Chris Roberts 257c04401b Update CHANGELOG 2018-05-03 12:34:29 -07:00
Chris Roberts 483bcdd519
Merge pull request #9766 from chrisroberts/f-chef-solo-path
Trim drive letter prefix from path
2018-05-03 12:33:38 -07:00
Chris Roberts f0e232d739 Log error and proceed when private key permissions fail
Fixes #9765
2018-05-03 11:48:57 -07:00
Chris Roberts 8b398b66a3 Trim drive letter prefix from path
Fixes #9764
2018-05-03 09:28:19 -07:00
Brian Cain c056a86f1f
Update CHANGELOG 2018-05-02 15:49:40 -07:00
Brian Cain 70df6d4b2a
Merge pull request #9760 from briancain/continue-on-malformed-json
Continue on if vagrant fails to parse metadata box for update
2018-05-02 15:49:08 -07:00
Brian Cain 2ab58d7369
Update CHANGELOG 2018-05-02 15:48:37 -07:00
Brian Cain e1129d27f9
Merge pull request #9761 from briancain/FIX-DOCKER-EXEC
Use Util::SafeExec if docker-exec is run with `-t` option
2018-05-02 15:47:46 -07:00
Brian Cain 79e535a7ee
(#9622) Use SafeExec for docker-exec
This commit uses the internal helper SafeExec rather than using the
Kernel class directly. It also adds a test to ensure that if the `-t`
option is used, it will call SafeExec.
2018-05-02 14:23:50 -07:00
Brian Cain beb08b51a4
(#7076) Continue on if vagrant fails to parse metadata box for update
Prior to this commit, vagrant would halt if it could not parse the
metadata file for a box to check for updates with. This commit changes
that to behave like when vagrant fails to download a metadata file and
continue on but warn the user it failed to check for box updates.
2018-05-02 13:58:21 -07:00
Stefan Scherer f14e8bcbf2
Allow other providers in WSL 2018-05-02 22:36:17 +02:00
Chris Roberts b0cbac3da5 Update CHANGELOG 2018-05-02 08:56:35 -07:00
Chris Roberts fbcd86993b
Merge pull request #9737 from chrisroberts/e-hyper-v-addr
Check neighbors for valid guest address when default lookup fails
2018-05-02 08:54:57 -07:00
Chris Roberts 47ce9a407b Update CHANGELOG 2018-05-02 07:48:47 -07:00
Chris Roberts bf281a912c
Merge pull request #9747 from chrisroberts/e-hyper-v-checkpoints
Reference Hyper-V switch by ID instead of name
2018-05-02 07:47:31 -07:00
Chris Roberts 7d752d2155 Update CHANGELOG 2018-05-02 07:47:02 -07:00
Chris Roberts 3f3777f03a
Merge pull request #9746 from chrisroberts/e-hyper-v-check
Update Windows Hyper-V check
2018-05-02 07:45:26 -07:00
Stefan Scherer a01d68b2e0
Call mstsc in WSL 2018-05-02 15:21:47 +02:00
Brian Cain 6fc2d9d82d
Merge pull request #9754 from briancain/DOCKER-PROV-WINDOWS
Update docker provisioner for windows, fix command filter behavior for `rm`
2018-05-01 13:46:33 -07:00
Brian Cain 93356d4635
Update rm filters to test for path
This commit updates the rm filter for winrm to operate like how rm works
in bash. If a folder doesn't exist, the command returns 0 rather than 1.
2018-05-01 13:35:45 -07:00
Chris Roberts 9f08337ce1 Ignore errors on neighbor lookup and validate result 2018-04-30 17:39:27 -07:00
Chris Roberts 486bcb4fc1 Update CHANGELOG 2018-04-27 17:05:54 -07:00
Chris Roberts 3dcc350364
Merge pull request #9696 from D4rkSh1t/fix-rootpath-for-wsl
fix rootpath if the vagrantfile is located under the root directory (WSL)
2018-04-27 17:04:23 -07:00
Chris Roberts 96ffd0c81e Update CHANGELOG 2018-04-27 17:03:42 -07:00
Chris Roberts 39bb589f7d
Merge pull request #9739 from chrisroberts/f-midware-invalid-uri
Ignore URLs which cannot be parsed in the authentication middleware
2018-04-27 17:03:02 -07:00
Chris Roberts 2b493460f7 Update CHANGELOG 2018-04-27 17:02:29 -07:00
Chris Roberts f2f5239973
Merge pull request #9738 from chrisroberts/e-trace-report
Disable report on exception by default
2018-04-27 17:01:56 -07:00
Chris Roberts e47e1df228 Reference Hyper-V switch by ID instead of name
Keep track of selected Hyper-V switch using the ID instead of name
to prevent any encoding issues that may occur switching between
PowerShell and Ruby. With the IDs staying consistent, the switch
name can be fetched from the provided ID.

Fixes #9679 #8794 #9451
2018-04-27 16:52:16 -07:00
Chris Roberts a997a27b57 Update Windows Hyper-V check
Checks only if the Hyper-V hypervisor is enabled instead of all
Hyper-V features. This will allow detection where Hyper-V is in
use for things like ApplicationGuard.

Uses both Get-WindowsOptionalFeature and Get-WindowsFeature to
support check on server and non-server version.
2018-04-27 14:13:34 -07:00
Joe Pleso c882d888a7
Add docker cap to windows to detect daemon and fix whitespace 2018-04-27 09:45:24 -07:00
Chris Roberts b75732416c
Merge pull request #9743 from chrisroberts/f-fout
Remove CSS for FOUT prevention
2018-04-27 08:45:08 -07:00
Chris Roberts 6484f70e1a Remove CSS for FOUT prevention 2018-04-27 08:41:52 -07:00
Brian Cain 1f25b2cc22
Merge pull request #9736 from briancain/disable-loading-triggers-if-plugin-exists
Add warning if vagrant-triggers plugin is installed
2018-04-26 16:11:31 -07:00
Chris Roberts 97f5822dee Ignore URLs which cannot be parsed in the authentication middleware
Fixes #9725
2018-04-26 15:08:06 -07:00
Brian Cain 1ef45d8073
Add warning if vagrant-triggers plugin is installed
To allow users to continue to use the community plugin, this commit adds
a switch that will not load the core trigger feature if it detects the
community plugin is installed. It also allows the user to disable the
warning so they can continue to use the plugin without extra output.
2018-04-26 14:59:09 -07:00
Chris Roberts e743fe050e Disable report on exception by default
Fixes #9727
2018-04-26 14:58:05 -07:00
Chris Roberts a26d861ae6 Update CHANGELOG 2018-04-26 14:49:24 -07:00
Chris Roberts d2ec4d9312
Merge pull request #9734 from chrisroberts/f-win-smb-mount
Default SMB version to 2.0 for linux guest mounts on Windows hosts
2018-04-26 14:48:01 -07:00
Chris Roberts 1f22d4f725 Update CHANGELOG 2018-04-26 14:47:22 -07:00
Chris Roberts 6fb293736e
Merge pull request #9730 from chrisroberts/f-smb-urls
Return original URL value when unmodified
2018-04-26 14:44:13 -07:00
Chris Roberts 7a769a879f
Merge pull request #9707 from hashicorp/je.remove-turbolinks
Turbolinks adjustments
2018-04-26 13:22:49 -07:00
Chris Roberts d15ff38d5c Check neighbors for valid guest address when default lookup fails
If the guest address is unavailable via Hyper-V inspection, extract
MAC address of network adapters and check neighbor information for
any currently matching known address.
2018-04-26 12:53:52 -07:00
Brian Cain 2cdbb1eee7
Update CHANGELOG 2018-04-26 11:00:57 -07:00
Brian Cain 0b199fe3b0
Merge pull request #9735 from briancain/suggest-known-providers
Improve messaging around not finding requested provider
2018-04-26 11:00:21 -07:00
Brian Cain fd3d78746c
(#9717) Improve messaging around not finding requested provider
This commit adds a bit more helpful messaging for the user when asking
for a provider that might not exist or does not follow the correct
casing. If it can find a match on a provider it knows about, it will
suggest it.
2018-04-26 09:43:58 -07:00
Chris Roberts 40a1d2faf3 Default SMB version to 2.0 for linux guest mounts
Fixes #8959
2018-04-26 08:45:05 -07:00
Chris Roberts 5feb234665 Return original URL value when unmodified
Due to the behavior of URI.parse on Ruby < 2.5 returning the string
value of the parsed URI object may modify the original URL. Specifically
it will remove the `//` prefix characters from SMB paths. When no
host modifications are being made, always return the original value.

Fixes #9636
2018-04-25 16:21:21 -07:00
Brian Cain 2b13a6a608
Update CHANGELOG 2018-04-25 14:11:24 -07:00
Brian Cain 18f8c305ac
Merge pull request #9729 from briancain/dont-raise-416
Don't raise error if response is HTTP 416
2018-04-25 14:10:26 -07:00
Brian Cain 67c3f866dd
(#7886) Add tests and simplify code for continuing on 416 2018-04-25 14:03:24 -07:00
Alexey Kamenskiy f1993dfa19
Fixed minor typo in comment 2018-04-25 09:12:08 -07:00
Alexey Kamenskiy cd3035e5e9
Issue #7885 Don't raise error if response is 416
416 means there is no more bytes to download (which works only with `--continue-at -` of curl)
2018-04-25 09:12:08 -07:00
Brian Cain f8be3cd009
Update CHANGELOG 2018-04-24 15:46:25 -07:00
Brian Cain b409f0e203
Merge pull request #9669 from dduponchel/data_bags_path
Support arrays for data_bags_path in chef-zero
2018-04-24 15:45:36 -07:00
Brian Cain 6cd3de6573
Update CHANGELOG 2018-04-24 11:35:57 -07:00
Brian Cain 5643ba0c7d
Merge pull request #9713 from briancain/vagrant-triggers-config
Integrate vagrant-triggers plugin functionality into core Vagrant
2018-04-24 11:35:04 -07:00
Brian Cain afc074fb11
Document valid trigger commands 2018-04-24 11:23:13 -07:00
Brian Cain a9be56b356
Code updates based on PR feedback 2018-04-24 10:04:40 -07:00
Brian Cain b365a585f3
Update CHANGELOG 2018-04-24 09:31:47 -07:00
Brian Cain 50445505f3
Merge pull request #9720 from briancain/puppet-prov-fix
Properly finalize structured_facts config option
2018-04-24 09:30:54 -07:00
Chris Roberts c31f87d434 Update website utility version 1.0.1 2018-04-23 14:54:00 -07:00
Brian Cain 7f004656db
(#9718) Properly finalize structured_facts config option
This commit sets the structured_facts option to nil if its still
UNSET_VALUE at the finalize step. This was causing a bug when the facter
config was set but was not using structured facts.
2018-04-23 14:23:59 -07:00
Jeff Escalante 9273b5f794 turbolinks and script optimizations 2018-04-23 13:14:11 -04:00
Brian Cain 1eabd0901e
Website updates based on feedback 2018-04-23 09:14:31 -07:00
Chris Roberts 2b68e5ac25 Update version for dev 2018-04-20 14:44:11 -07:00
Chris Roberts bd586178f5 Update website vagrant version 2.0.4 2018-04-20 14:38:40 -07:00
Brian Cain daffd87200
Use match over match? for Ruby 2.3 2018-04-20 12:24:32 -07:00
Chris Roberts 6a6805f284 Release v2.0.4 2018-04-20 11:56:47 -07:00
Brian Cain a1ca29c5e4
Add warn and info validation translation strings 2018-04-20 10:51:38 -07:00
Brian Cain 2000a11042
Add tests for powershell run functions 2018-04-20 10:51:38 -07:00
Brian Cain bd133e1727
Docs updates for triggers 2018-04-20 10:51:38 -07:00
Brian Cain e25cb51f15
Properly print warnings on config settings that aren't supported 2018-04-20 10:51:38 -07:00
Brian Cain 188fd5d6a6
Split out run methods with Powershell functions 2018-04-20 10:51:38 -07:00
Brian Cain 12b1a3dfe4
Update triggers based on code review 2018-04-20 10:51:38 -07:00
Brian Cain 5e9387dca8
Add basic triggers example 2018-04-20 10:51:38 -07:00
Brian Cain 6f2b5a9fa0
Update trigger docs 2018-04-20 10:51:38 -07:00
Brian Cain 4e5e4d0214
Use args setting for run option in trigger 2018-04-20 10:51:38 -07:00
Brian Cain 8451cbf854
Move up location of error message 2018-04-20 10:51:38 -07:00
Brian Cain c35e0a4f9a
Update docs with some basic trigger examples 2018-04-20 10:51:38 -07:00
Brian Cain e0806f623c
Remove TODO 2018-04-20 10:51:38 -07:00
Brian Cain a20404599e
Add trigger documentation 2018-04-20 10:51:38 -07:00
Brian Cain 2dadc0463e
Fix trigger doc sidebar 2018-04-20 10:51:38 -07:00
Brian Cain 0054c5aae6
Raise error if incomplete trigger block is defined 2018-04-20 10:51:38 -07:00
Brian Cain 6bf01965de
Fix run command for windows hosts 2018-04-20 10:51:38 -07:00
Brian Cain a5fe84d64f
Fix string translation 2018-04-20 10:51:38 -07:00
Brian Cain 7cdb32f642
Use inclunde? instead of any? for ruby 2.3 2018-04-20 10:51:38 -07:00
Brian Cain e7d07cb110
Add rspec tests for trigger plugin 2018-04-20 10:51:38 -07:00
Brian Cain 767a315393
Trigger cleanup 2018-04-20 10:51:38 -07:00
Brian Cain 693eb2fbbb
Add machine level warning when privileged option is set for run 2018-04-20 10:51:38 -07:00
Brian Cain 3ad4f576c0
Add only_on validation for config 2018-04-20 10:51:38 -07:00
Brian Cain ca672eb8e6
Trigger plugin cleanup 2018-04-20 10:51:38 -07:00
Brian Cain c832168846
Update trigger config docs 2018-04-20 10:51:38 -07:00
Brian Cain 6ea7819402
Update rspec tests for trigger plugin 2018-04-20 10:51:38 -07:00
Brian Cain 85dedf25d9
Ensure that :all triggers don't get filtered out 2018-04-20 10:51:38 -07:00
Brian Cain 600557ff24
Move strings to translation file 2018-04-20 10:51:38 -07:00
Brian Cain a1e4fe4411
Align how local provisioner looks with shell provisioner 2018-04-20 10:51:38 -07:00
Brian Cain a857056136
Update color for run_remote to match shell provisioner colors 2018-04-20 10:51:38 -07:00
Brian Cain 8b71c24f90
Match properly on guests with trigger filtering 2018-04-20 10:51:38 -07:00
Brian Cain a4faaa1a4d
Provision run_remote using the shell provisioner 2018-04-20 10:51:38 -07:00
Brian Cain 2c30eab723
Don't run local commands as sudo by default 2018-04-20 10:51:38 -07:00
Brian Cain fd2878309b
Move exception warnings in run function 2018-04-20 10:51:38 -07:00
Brian Cain e078767b2b
run now supports script files as well as inline scripts 2018-04-20 10:51:38 -07:00
Brian Cain 8b70abd4d0
Send the correct config message to warn 2018-04-20 10:51:38 -07:00
Brian Cain 59965f4fd6
Properly filter triggers 2018-04-20 10:51:38 -07:00
Brian Cain 975b8e774c
Get basic run triggers executing inline scripts 2018-04-20 10:51:38 -07:00
Brian Cain d750169f6e
Add some logging around run and run_remote 2018-04-20 10:51:38 -07:00
Brian Cain fbad4c749d
Add basic spec test for trigger class 2018-04-20 10:51:38 -07:00
Brian Cain 0953287262
Relax only_on rspec tests
only_on can be either a string or regex
2018-04-20 10:51:38 -07:00
Brian Cain 616b0f9ba6
Preserve returning environment after machine action gets called 2018-04-20 10:51:38 -07:00
Brian Cain 48b7c682ad
Use active machine object 2018-04-20 10:51:38 -07:00
Brian Cain 93af398f9e
Update params for NoStageGiven error 2018-04-20 10:51:38 -07:00
Brian Cain bbf4e3c521
Reduce fire trigger methods to a single method 2018-04-20 10:51:38 -07:00
Brian Cain eac2fcf71e
Filter triggers based on only_on restraint 2018-04-20 10:51:38 -07:00
Brian Cain 09bb98679c
Add basic website pages for triggers 2018-04-20 10:51:38 -07:00
Brian Cain 6373441ab2
Ensure guest name is a string 2018-04-20 10:51:38 -07:00
Brian Cain 76418b9fcd
Simplify trigger selection 2018-04-20 10:51:38 -07:00
Brian Cain 0e5cd900f8
Add missing param 2018-04-20 10:51:38 -07:00
Brian Cain 1462b3f718
Simplify trigger command filtering 2018-04-20 10:51:38 -07:00
Brian Cain 372a6a7911
Initial trigger plugin scaffolding 2018-04-20 10:51:38 -07:00
Brian Cain 4ecf682265
Add basic trigger plugin scaffold 2018-04-20 10:51:38 -07:00
Brian Cain a5d8cc1caa
Update trigger classes with comments 2018-04-20 10:51:38 -07:00
Brian Cain e7274f1b6c
Improve config rspec tests 2018-04-20 10:51:38 -07:00
Brian Cain 956ed004bb
Update trigger config merge function 2018-04-20 10:51:38 -07:00
Brian Cain 7dae1acd21
Add some "default" options to be validated 2018-04-20 10:51:38 -07:00
Brian Cain fc526a164a
Add basic create_trigger rspec test 2018-04-20 10:51:38 -07:00
Brian Cain e157362ace
Add run and run_remote expectations 2018-04-20 10:51:38 -07:00
Brian Cain 7b1b044e72
Check for default on_error behavior setting 2018-04-20 10:51:38 -07:00
Brian Cain abb6d77442
Move location of command validator 2018-04-20 10:51:38 -07:00
Brian Cain 6cbb5d8e5d
Add unit tests for config, fix type change bug with map! 2018-04-20 10:51:38 -07:00
Brian Cain 3dec6869bb
Update trigger unit tests 2018-04-20 10:51:38 -07:00
Brian Cain 42419bbd49
Fix rspec tests 2018-04-20 10:51:38 -07:00
Brian Cain d0d69e59c9
Update return doc string on validate 2018-04-20 10:51:38 -07:00
Brian Cain 60c4ffa8a6
Ensure run & run_remote are Hashes before updating to shell config 2018-04-20 10:51:38 -07:00
Brian Cain e752878de9
Update finalize method for run and run_remote objects 2018-04-20 10:51:38 -07:00
Brian Cain d3dde739fe
Update trigger code docs 2018-04-20 10:51:38 -07:00
Brian Cain 1591ae9916
Make run and run_remote settings shell provisioner configs 2018-04-20 10:51:38 -07:00
Brian Cain f0ec7c750b
Potential solution for trigger validation when guest is defined
Send the defined before and or after triggers in the merge function if
triggers exist already
2018-04-20 10:51:38 -07:00
Brian Cain 51e4118cc2
Debug commit 2018-04-20 10:51:38 -07:00
Brian Cain 0cbf6970fc
Update config class setting 2018-04-20 10:51:38 -07:00
Brian Cain 607368a66c
Introduce merge function to preserve internal state 2018-04-20 10:51:38 -07:00
Brian Cain d26a925bd7
Update variable doc 2018-04-20 10:51:38 -07:00
Brian Cain 5ca1d1ab64
Finalize config in plugins finalize, improve docs 2018-04-20 10:51:38 -07:00
Brian Cain b04f13657b
Move warning to logger rather than guest 2018-04-20 10:51:38 -07:00
Brian Cain a96baad0d7
Add comments for later dev 2018-04-20 10:51:38 -07:00
Brian Cain 60ff2489c4
Display warning if vagrant command for trigger is not found 2018-04-20 10:51:38 -07:00
Brian Cain 8e72ae5bd6
Add basic validation for trigger config objects 2018-04-20 10:51:38 -07:00
Brian Cain 375e8d7153
Remove old comments 2018-04-20 10:51:38 -07:00
Brian Cain 3c5e4b2464
Fix variable doc 2018-04-20 10:51:38 -07:00
Brian Cain 50ecf45d50
Add more doc to create_trigger function 2018-04-20 10:51:38 -07:00
Brian Cain c10ae070b6
Store correct command for trigger 2018-04-20 10:51:38 -07:00
Brian Cain e0a5b1d647
Parse block trigger configs 2018-04-20 10:51:38 -07:00
Brian Cain 6f00eb5679
Move trigger options into own plugin class 2018-04-20 10:51:38 -07:00
Brian Cain fdf1b58570
Introduce ids for trigger blocks 2018-04-20 10:51:38 -07:00
Brian Cain bb2f3b35b9
Add basic unit test 2018-04-20 10:51:38 -07:00
Brian Cain 7cccddc009
Add basic scaffolding for command parsing 2018-04-20 10:51:38 -07:00
Brian Cain 01b904061d
Use proper command reference for command whitelist params 2018-04-20 10:51:38 -07:00
Brian Cain 0142722787
Add run and run_remote scaffolding 2018-04-20 10:51:38 -07:00
Brian Cain 813ffd06ec
Add more trigger config options 2018-04-20 10:51:38 -07:00
Brian Cain a194057fc0
Add trigger config plugin 2018-04-20 10:51:38 -07:00
Brian Cain 3a84ae0ec4
Update CHANGELOG 2018-04-19 15:12:15 -07:00
Brian Cain 887afcd0bc
Merge pull request #9705 from jlduran/fix-freebsd-configure-networks
Fix network configuration on FreeBSD hosts
2018-04-19 15:10:39 -07:00
Jose Luis Duran 53acd20548
Fix network configuration on FreeBSD hosts
There was a missing space within `sed` parameters that caused the
`rc.conf` file to be wrongly created as `rc.conf-e`.
2018-04-19 16:25:16 -03:00
Isaac Freeman de71626922 docker: use Kernel.system for docker-exec when -t is given 2018-04-18 17:50:47 -04:00
Brian Cain ed0ccd8ca0
Update CHANGELOG 2018-04-18 13:05:58 -07:00
Brian Cain 9f29812db8
Merge pull request #9690 from briancain/expand_nodes_path_chef
File path expand all chef_zero config path options
2018-04-18 13:04:38 -07:00
Chris Roberts 2a79879a41
Merge pull request #9703 from chrisroberts/f-win-ffi-ext
Fix require for ffi-win32-extensions
2018-04-18 12:54:50 -07:00
Chris Roberts 6ae1f4a2f6 Fix require for ffi-win32-extensions
Fixes #9698
2018-04-18 12:42:46 -07:00
Brian Cain 620166ee1c
Update CHANGELOG 2018-04-18 08:32:31 -07:00
Brian Cain 9660951c89
Merge pull request #9490 from jzinn/solo-rb-cookbook-path
Improve Windows drive letter removal hack
2018-04-18 08:31:23 -07:00
Julian Zinn 269645f63d Improve Windows drive letter removal hack 2018-04-17 13:23:14 -07:00
Maximilian Gotter 134060d577 fix rootpath if the vagrantfile is located under the root directory 2018-04-17 07:10:41 +00:00
Brian Cain e6887b8305
Update CHANGELOG 2018-04-16 15:39:10 -07:00
Brian Cain 151095a3e9
Merge pull request #9420 from ryanwalder/salt-json
Add master_json_config & minion_json_config options to salt provisioner
2018-04-16 15:37:44 -07:00
Brian Cain e8ab85e92b
(#9383) File path expand all chef_zero config path options
This commit ensures that all paths are properly file path expanded for
each config option in chef_zero.
2018-04-16 11:05:39 -07:00
Brian Cain a9c7b3efe2
Update CHANGELOG 2018-04-12 15:25:04 -07:00
Brian Cain 42df3e7185
Merge pull request #9685 from briancain/improve-hostonly-conf-error
Improve network collision error message
2018-04-12 15:18:50 -07:00
Brian Cain 4db3d49157
Improve network collision error message
This commit provides a bit more information when a non-hostonly network
collides with a host network.
2018-04-12 14:16:13 -07:00
Chris Roberts 9ba44fcece
Merge pull request #9545 from hashicorp/je.segment
Switch web analytics to segment
2018-04-10 15:15:21 -07:00
Chris Roberts 30b77c96c9 Update CHANGELOG 2018-04-10 14:57:29 -07:00
Chris Roberts 5d7506afe3
Merge pull request #9676 from chrisroberts/e-win-file-perms
Update generated ssh private key file permissions on create
2018-04-10 14:56:28 -07:00
Chris Roberts 2ccfccb70c
Merge pull request #9675 from chrisroberts/e-docs-share
Include installation information for vagrant share plugin
2018-04-10 14:52:53 -07:00
Chris Roberts f838883483 Update CHANGELOG 2018-04-10 14:52:27 -07:00
Chris Roberts b2db1adb7c
Merge pull request #9674 from chrisroberts/f-wsl-version-check
Check Windows installed Vagrant version using --version
2018-04-10 14:47:06 -07:00
Chris Roberts 71c1e3537d Update CHANGELOG 2018-04-10 14:46:51 -07:00
Chris Roberts b605da0ef5
Merge pull request #9673 from chrisroberts/f-win-paths-filter
Fix windows command filters
2018-04-10 14:44:32 -07:00
Chris Roberts 9731720773 Update generated ssh private key file permissions on create
This updates the permissions on the automatically generated private
key file to only be readable by the user. Includes support for file
permission modification on Windows platform.
2018-04-10 14:15:14 -07:00
Chris Roberts 100976fad0 Include installation information for vagrant share plugin
Fixes #9485
2018-04-10 10:03:46 -07:00
Brian Cain 1fd67b521c
Update CHANGELOG 2018-04-10 09:17:20 -07:00
Brian Cain f1de9821e1
Merge pull request #8099 from chrisroberts/windows/shared-folder-path
Fix virtualbox shared folders path
2018-04-10 09:16:06 -07:00
Chris Roberts e4399a5724 Check Windows installed Vagrant version using --version
Using the --version flag keeps Vagrant from doing a full startup
and prevents the Vagrantfile from being parsed. This makes the
version check faster, and stops things like syntax errors within
a Vagrantfile from causing an unexpected error.

Fixes #9635
2018-04-10 08:05:23 -07:00
Chris Roberts ddfd86f3d1 Split with shellwords and quote paths in command filter
This uses shellwords to split the command in the command filter
inside the winrm communicator. Using shellwords properly handles
things like quoted paths. Path arguments are also quoted to
prevent issues with paths that include spaces.

Fixes #9390
2018-04-09 17:00:30 -07:00
David Duponchel d08a472610 Support arrays for data_bags_path in chef-zero
The pull request #6561 added the support for arrays for data_bags_path
in chef-solo and chef-zero, but missed a `.first` in chef-zero (which
only keeps the first data bag path). The documentation and the template
for chef-zero are already good (since #6561).

Fixes #9668.
2018-04-09 17:46:42 +02:00
Jeff Escalante db959c16c5 switch web analytics from ga to segment 2018-04-06 18:25:11 -04:00
mihab 03178bbe04 Fixes #9085: Cannot `up` a machine with Docker Toolbox and Git Bash 2018-03-01 21:38:39 +01:00
Daniel Hahler ec99b75c53 squash! salt: bootstrap-salt.sh: use -s with curl
Also use --show-error, and long option for --silent.
2018-02-02 00:39:32 +01:00
Daniel Hahler 6f7c383fe8 salt: bootstrap-salt.sh: use -s with curl
This makes it silent (no progress information), which would otherwise
result in output like the following (when the output from the bootstrap
script is displayed in verbose mode):

      % Total    % Recei
    ved % Xferd  Avera
    ge Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0
       0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    100  244k  100
     244k    0     0
       458k      0 --:--:-- --:--:-- --:--:--  458k
     *  INFO: Running version: 2017.12.13
     …
2018-02-01 21:27:27 +01:00
Daniel Hahler 496d9b24c1 salt: remove leading space with bootstrap_options 2018-02-01 21:24:15 +01:00
Ryan Walder db457e6318 Add master_json_config & minion_json_config options to salt provisioner
* Allow use of -j/-J bootstrap options for configuring master/minion
2018-01-31 12:28:36 +00:00
Thomas Reifenberger 52bf853cee Add completion for snapshot names for vagrant snapshot restore|delete
- Note that this does not cover additional options like --no-provision
- It is also a bit slow, as `vagrant snapshot list` is used to gather
  the data
2017-10-13 12:59:01 +02:00
Chris Roberts 7f9a4b67d2 Fix virtualbox shared folders path 2016-12-13 12:09:36 -08:00
722 changed files with 33224 additions and 3880 deletions

20
.ci/build.sh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
csource="${BASH_SOURCE[0]}"
while [ -h "$csource" ] ; do csource="$(readlink "$csource")"; done
root="$( cd -P "$( dirname "$csource" )/../" && pwd )"
. "${root}/.ci/init.sh"
pushd "${root}" > "${output}"
# Build our gem
wrap gem build *.gemspec \
"Failed to build Vagrant RubyGem"
# Get the path of our new gem
g=(vagrant*.gem)
gem=$(printf "%s" "${g}")
wrap aws s3 cp "${gem}" "${ASSETS_PRIVATE_BUCKET}/${repository}/vagrant-master.gem" \
"Failed to store Vagrant RubyGem master build"

432
.ci/common.sh Executable file
View File

@ -0,0 +1,432 @@
# last-modified: Tue Jan 14 20:37:58 UTC 2020
#!/usr/bin/env bash
# Path to file used for output redirect
# and extracting messages for warning and
# failure information sent to slack
function output_file() {
printf "/tmp/.ci-output"
}
# Write failure message, send error to configured
# slack, and exit with non-zero status. If an
# "$(output_file)" file exists, the last 5 lines will be
# included in the slack message.
#
# $1: Failure message
function fail() {
(>&2 echo "ERROR: ${1}")
if [ -f ""$(output_file)"" ]; then
slack -s error -m "ERROR: ${1}" -f "$(output_file)" -T 5
else
slack -s error -m "ERROR: ${1}"
fi
exit 1
}
# Write warning message, send warning to configured
# slack
#
# $1: Warning message
function warn() {
(>&2 echo "WARN: ${1}")
if [ -f ""$(output_file)"" ]; then
slack -s warn -m "WARNING: ${1}" -f "$(output_file)"
else
slack -s warn -m "WARNING: ${1}"
fi
}
# Execute command while redirecting all output to
# a file (file is used within fail mesage on when
# command is unsuccessful). Final argument is the
# error message used when the command fails.
#
# $@{1:$#-1}: Command to execute
# $@{$#}: Failure message
function wrap() {
i=$(("${#}" - 1))
wrap_raw "${@:1:$i}"
if [ $? -ne 0 ]; then
cat "$(output_file)"
fail "${@:$#}"
fi
rm "$(output_file)"
}
# Execute command while redirecting all output to
# a file. Exit status is returned.
function wrap_raw() {
rm -f "$(output_file)"
"${@}" > "$(output_file)" 2>&1
return $?
}
# Execute command while redirecting all output to
# a file (file is used within fail mesage on when
# command is unsuccessful). Command output will be
# streamed during execution. Final argument is the
# error message used when the command fails.
#
# $@{1:$#-1}: Command to execute
# $@{$#}: Failure message
function wrap_stream() {
i=$(("${#}" - 1))
wrap_stream_raw "${@:1:$i}"
if [ $? -ne 0 ]; then
fail "${@:$#}"
fi
rm "$(output_file)"
}
# Execute command while redirecting all output
# to a file. Command output will be streamed
# during execution. Exit status is returned
function wrap_stream_raw() {
rm -f "$(output_file)"
"${@}" > "$(output_file)" 2>&1 &
pid=$!
until [ -f "$(output_file)" ]; do
sleep 0.1
done
tail -f --quiet --pid "${pid}" "$(output_file)"
wait "${pid}"
return $?
}
# Send command to packet device and wrap
# execution
# $@{1:$#-1}: Command to execute
# $@{$#}: Failure message
function pkt_wrap() {
wrap packet-exec run -quiet -- "${@}"
}
# Send command to packet device and wrap
# execution
# $@: Command to execute
function pkt_wrap_raw() {
wrap_raw packet-exec run -quiet -- "${@}"
}
# Send command to packet device and wrap
# execution with output streaming
# $@{1:$#-1}: Command to execute
# $@{$#}: Failure message
function pkt_wrap_stream() {
wrap_stream packet-exec run -quiet -- "${@}"
}
# Send command to packet device and wrap
# execution with output streaming
# $@: Command to execute
function pkt_wrap_stream_raw() {
wrap_stream_raw packet-exec run -quiet -- "${@}"
}
# Generates location within the asset storage
# bucket to retain built assets.
function asset_location() {
if [ "${tag}" = "" ]; then
dst="${ASSETS_PRIVATE_LONGTERM}/${repository}/${ident_ref}/${short_sha}"
else
if [[ "${tag}" = *"+"* ]]; then
dst="${ASSETS_PRIVATE_LONGTERM}/${repository}/${tag}"
else
dst="${ASSETS_PRIVATE_BUCKET}/${repository}/${tag}"
fi
fi
echo -n "${dst}"
}
# Upload assets to the asset storage bucket.
#
# $1: Path to asset file or directory to upload
function upload_assets() {
if [ "${1}" = "" ]; then
fail "Parameter required for asset upload"
fi
if [ -d "${1}" ]; then
wrap aws s3 cp --recursive "${1}" "$(asset_location)/" \
"Upload to asset storage failed"
else
wrap aws s3 cp "${1}" "$(asset_location)/" \
"Upload to asset storage failed"
fi
}
# Download assets from the asset storage bucket. If
# destination is not provided, remote path will be
# used locally.
#
# $1: Path to asset or directory to download
# $2: Optional destination for downloaded assets
function download_assets() {
if [ "${1}" = "" ]; then
fail "At least one parameter required for asset download"
fi
if [ "${2}" = "" ]; then
dst="${1#/}"
else
dst="${2}"
fi
mkdir -p "${dst}"
src="$(asset_location)/${1#/}"
remote=$(aws s3 ls "${src}")
if [[ "${remote}" = *" PRE "* ]]; then
mkdir -p "${dst}"
wrap aws s3 cp --recursive "${src%/}/" "${dst}" \
"Download from asset storage failed"
else
mkdir -p "$(dirname "${dst}")"
wrap aws s3 cp "${src}" "${dst}" \
"Download from asset storage failed"
fi
}
# Upload assets to the cache storage bucket.
#
# $1: Path to asset file or directory to upload
function upload_cache() {
if [ "${1}" = "" ]; then
fail "Parameter required for cache upload"
fi
if [ -d "${1}" ]; then
wrap aws s3 cp --recursive "${1}" "${asset_cache}/" \
"Upload to cache failed"
else
wrap aws s3 cp "${1}" "${asset_cache}/" \
"Upload to cache failed"
fi
}
# Download assets from the cache storage bucket. If
# destination is not provided, remote path will be
# used locally.
#
# $1: Path to asset or directory to download
# $2: Optional destination for downloaded assets
function download_cache() {
if [ "${1}" = "" ]; then
fail "At least one parameter required for cache download"
fi
if [ "${2}" = "" ]; then
dst="${1#/}"
else
dst="${2}"
fi
mkdir -p "${dst}"
src="${asset_cache}/${1#/}"
remote=$(aws s3 ls "${src}")
if [[ "${remote}" = *" PRE "* ]]; then
mkdir -p "${dst}"
wrap aws s3 cp --recursive "${src%/}/" "${dst}" \
"Download from cache storage failed"
else
mkdir -p "$(dirname "${dst}")"
wrap aws s3 cp "${src}" "${dst}" \
"Download from cache storage failed"
fi
}
# Validate arguments for GitHub release. Checks for
# two arguments and that second argument is an exiting
# file asset, or directory.
#
# $1: GitHub tag name
# $2: Asset file or directory of assets
function release_validate() {
if [ "${1}" = "" ]; then
fail "Missing required position 1 argument (TAG) for release"
fi
if [ "${2}" = "" ]; then
fail "Missing required position 2 argument (PATH) for release"
fi
if [ ! -e "${2}" ]; then
fail "Path provided for release (${2}) does not exist"
fi
}
# Generate a GitHub release
#
# $1: GitHub tag name
# $2: Asset file or directory of assets
function release() {
release_validate "${@}"
wrap_raw ghr -u "${repo_owner}" -r "${repo_name}" -c "${full_sha}" -n "${1}" -delete
if [ $? -ne 0 ]; then
wrap ghr -u "${repo_owner}" -r "${repo_name}" -c "${full_sha}" -n "${1}" \
"${1}" "${2}" "Failed to create release for version ${1}"
fi
}
# Generate a GitHub prerelease
#
# $1: GitHub tag name
# $2: Asset file or directory of assets
function prerelease() {
release_validate "${@}"
if [[ "${1}" != *"+"* ]]; then
ptag="${1}+${short_sha}"
else
ptag="${1}"
fi
wrap_raw ghr -u "${repo_owner}" -r "${repo_name}" -c "${full_sha}" -n "${ptag}" \
-delete -prerelease "${ptag}" "${2}"
if [ $? -ne 0 ]; then
wrap ghr -u "${repo_owner}" -r "${repo_name}" -c "${full_sha}" -n "${ptag}" \
-prerelease "${ptag}" "${2}" \
"Failed to create prerelease for version ${1}"
fi
echo -n "${ptag}"
}
# Check if version string is valid for release
#
# $1: Version
# Returns: 0 if valid, 1 if invalid
function valid_release_version() {
if [[ "${1}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
return 0
else
return 1
fi
}
# Validate arguments for HashiCorp release. Ensures asset
# directory exists, and checks that the SHASUMS and SHASUM.sig
# files are present.
#
# $1: Asset directory
function hashicorp_release_validate() {
directory="${1}"
# Directory checks
if [ "${directory}" = "" ]; then
fail "No asset directory was provided for HashiCorp release"
fi
if [ ! -d "${directory}" ]; then
fail "Asset directory for HashiCorp release does not exist"
fi
# SHASUMS checks
if [ ! -e "${directory}/"*SHASUMS ]; then
fail "Asset directory is missing SHASUMS file"
fi
if [ ! -e "${directory}/"*SHASUMS.sig ]; then
fail "Asset directory is missing SHASUMS signature file"
fi
}
# Verify release assets by validating checksum properly match
# and that signature file is valid
#
# $1: Asset directory
function hashicorp_release_verify() {
directory="${1}"
pushd "${directory}" > "${output}"
# First do a checksum validation
wrap shasum -a 256 -c *_SHA256SUMS \
"Checksum validation of release assets failed"
# Next check that the signature is valid
gpghome=$(mktemp -qd)
export GNUPGHOME="${gpghome}"
wrap gpg --import "${HASHICORP_PUBLIC_GPG_KEY}" \
"Failed to import HashiCorp public GPG key"
wrap gpg --verify *SHA256SUMS.sig *SHA256SUMS \
"Validation of SHA256SUMS signature failed"
rm -rf "${gpghome}" > "${output}" 2>&1
popd > "${output}"
}
# Generate a HashiCorp release
#
# $1: Asset directory
function hashicorp_release() {
directory="${1}"
hashicorp_release_validate "${directory}"
hashicorp_release_verify "${directory}"
oid="${AWS_ACCESS_KEY_ID}"
okey="${AWS_SECRET_ACCESS_KEY}"
export AWS_ACCESS_KEY_ID="${RELEASE_AWS_ACCESS_KEY_ID}"
export AWS_SECRET_ACCESS_KEY="${RELEASE_AWS_SECRET_ACCESS_KEY}"
wrap_stream hc-releases upload "${directory}" \
"Failed to upload HashiCorp release assets"
wrap_stream hc-releases publish \
"Failed to publish HashiCorp release"
export AWS_ACCESS_KEY_ID="${oid}"
export AWS_SECRET_ACCESS_KEY="${okey}"
}
# Configures git for hashibot usage
function hashibot_git() {
wrap git config user.name "${HASHIBOT_USERNAME}" \
"Failed to setup git for hashibot usage (username)"
wrap git config user.email "${HASHIBOT_EMAIL}" \
"Failed to setup git for hashibot usage (email)"
wrap git remote set-url origin "https://${HASHIBOT_USERNAME}:${HASHIBOT_TOKEN}@github.com/${repository}" \
"Failed to setup git for hashibot usage (remote)"
}
# Stub cleanup method which can be redefined
# within actual script
function cleanup() {
(>&2 echo "** No cleanup tasks defined")
}
trap cleanup EXIT
# Enable debugging. This needs to be enabled with
# extreme caution when used on public repositories.
# Output with debugging enabled will likely include
# secret values which should not be publicly exposed.
#
# If repository is public, FORCE_PUBLIC_DEBUG environment
# variable must also be set.
is_private=$(curl -H "Authorization: token ${HASHIBOT_TOKEN}" -s "https://api.github.com/repos/${GITHUB_REPOSITORY}" | jq .private)
if [ "${DEBUG}" != "" ]; then
if [ "${is_private}" = "false" ]; then
if [ "${FORCE_PUBLIC_DEBUG}" != "" ]; then
set -x
output="/dev/stdout"
else
fail "Cannot enable debug mode on public repository unless forced"
fi
else
set -x
output="/dev/stdout"
fi
else
output="/dev/null"
fi
# Check if we are running a public repository on private runners
if [ "${VAGRANT_PRIVATE}" != "" ] && [ "${is_private}" = "false" ]; then
fail "Cannot run public repositories on private Vagrant runners. Disable runners now!"
fi
# Common variables
full_sha="${GITHUB_SHA}"
short_sha="${full_sha:0:8}"
ident_ref="${GITHUB_REF#*/*/}"
if [[ "${GITHUB_REF}" == *"refs/tags/"* ]]; then
tag="${GITHUB_REF##*tags/}"
valid_release_version "${tag}"
if [ $? -eq 0 ]; then
release=1
fi
fi
repository="${GITHUB_REPOSITORY}"
repo_owner="${repository%/*}"
repo_name="${repository#*/}"
asset_cache="${ASSETS_PRIVATE_SHORTTERM}/${repository}/${GITHUB_ACTION}"
job_id="${GITHUB_ACTION}"

6
.ci/init.sh Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
. "${root}/.ci/common.sh"
export DEBIAN_FRONTEND="noninteractive"
export PATH="${PATH}:${root}/.ci"

62
.ci/release.sh Executable file
View File

@ -0,0 +1,62 @@
#!/usr/bin/env bash
ghr_version="0.13.0"
# NOTE: This release will generate a new release on the installers
# repository which in turn triggers a full package build
target_owner="hashicorp"
target_repository="vagrant-builders"
csource="${BASH_SOURCE[0]}"
while [ -h "$csource" ] ; do csource="$(readlink "$csource")"; done
root="$( cd -P "$( dirname "$csource" )/../" && pwd )"
. "${root}/.ci/init.sh"
pushd "${root}" > "${output}"
# Install ghr
wrap curl -Lso /tmp/ghr.tgz "https://github.com/tcnksm/ghr/releases/download/v${ghr_version}/ghr_v${ghr_version}_linux_amd64.tar.gz" \
"Failed to download ghr utility"
wrap tar -C /tmp/ -xf /tmp/ghr.tgz \
"Failed to unpack ghr archive"
wrap mv "/tmp/ghr_v${ghr_version}_linux_amd64/ghr" "${root}/.ci/" \
"Failed to install ghr utility"
# Build our gem
wrap gem build *.gemspec \
"Failed to build Vagrant RubyGem"
# Get the path of our new gem
g=(vagrant*.gem)
gem=$(printf "%s" "${g}")
# Determine the version of the release
vagrant_version="$(gem specification "${gem}" version)"
vagrant_version="${vagrant_version##*version: }"
# We want to release into the builders repository so
# update the repository variable with the desired destination
repo_owner="${target_owner}"
repo_name="${target_repository}"
full_sha="master"
export GITHUB_TOKEN="${HASHIBOT_TOKEN}"
if [ "${tag}" = "" ]; then
echo "Generating Vagrant RubyGem pre-release... "
version="v${vagrant_version}+${short_sha}"
prerelease "${version}" "${gem}"
else
# Validate this is a proper release version
valid_release_version "${vagrant_version}"
if [ $? -ne 0 ]; then
fail "Invalid version format for Vagrant release: ${vagrant_version}"
fi
echo "Generating Vagrant RubyGem release... "
version="v${vagrant_version}"
release "${version}" "${gem}"
fi
slack -m "New Vagrant installers release triggered: *${version}*"

176
.ci/slack Executable file
View File

@ -0,0 +1,176 @@
#!/usr/bin/env ruby
require "optparse"
require "net/https"
require "uri"
require "json"
OPTIONS = [:channel, :username, :icon, :state, :message,
:message_file, :file, :title, :tail, :webhook].freeze
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: #{File.basename(__FILE__)} [options]"
opts.on("-c", "--channel CHAN", "Send to channel") do |c|
options[:channel] = c
end
opts.on("-u", "--username USER", "Send as username") do |u|
options[:username] = u
end
opts.on("-i", "--icon URL", "User icon image") do |i|
options[:icon] = i
end
opts.on("-s", "--state STATE", "Message state (success, warn, error, or color code)") do |s|
options[:state] = s
end
opts.on("-m", "--message MESSAGE", "Message to send") do |m|
options[:message] = m
end
opts.on("-M", "--message-file MESSAGE_FILE", "Use file contents as message") do |m|
options[:message_file] = m
end
opts.on("-f", "--file MESSAGE_FILE", "Send raw contents of file in message") do |f|
options[:file] = f
end
opts.on("-t", "--title TITLE", "Message title") do |t|
options[:title] = t
end
opts.on("-T", "--tail N", "Send last N lines of content from raw message file") do |t|
options[:tail] = t
end
opts.on("-w", "--webhook HOOK", "Slack webhook") do |w|
options[:webhook] = w
end
opts.on("-h", "--help", "Print help") do
puts opts
exit
end
end.parse!
OPTIONS.each do |key|
if !options.key?(key)
env_key = "SLACK_#{key.to_s.upcase}"
if ENV[env_key]
options[key] = ENV[env_key]
end
end
end
if !options[:webhook]
$stderr.puts "ERROR: Webhook is required!"
exit 1
end
if ENV["CIRCLECI"]
options[:icon] = "https://emoji.slack-edge.com/TF1GCKJNM/circleci/054b58d488e65138.png" unless options[:icon]
options[:username] = "circleci" unless options[:username]
options[:footer] = "CircleCI - <#{ENV["CIRCLE_BUILD_URL"]}|#{ENV["CIRCLE_PROJECT_USERNAME"]}/#{ENV["CIRCLE_PROJECT_REPONAME"]}>"
options[:footer_icon] = "https://emoji.slack-edge.com/TF1GCKJNM/circleci/054b58d488e65138.png"
end
if ENV["GITHUB_ACTIONS"]
options[:icon] = "https://ca.slack-edge.com/T024UT03C-WG8NDATGT-f82ae03b9fca-48" unless options[:icon]
options[:username] = "github" unless options[:username]
options[:footer] = "Actions - <https://github.com/#{ENV["GITHUB_REPOSITORY"]}/commit/#{ENV["GITHUB_SHA"]}/checks|#{ENV["GITHUB_REPOSITORY"]}>"
options[:footer_icon] = "https://ca.slack-edge.com/T024UT03C-WG8NDATGT-f82ae03b9fca-48"
end
options[:state] = "success" unless options[:state]
case options[:state]
when "success", "good"
options[:state] = "good"
when "warn", "warning"
options[:state] = "warning"
when "error", "danger"
options[:state] = "danger"
else
if !options[:state].start_with?("#")
$stderr.puts "ERROR: Invalid value for `state` (#{options[:state]})"
exit 1
end
end
msg = options[:message]
# NOTE: Message provided from CLI argument will end up with
# double escaped newlines so remove one
msg.gsub!("\\n", "\n") if msg
if options[:message_file]
if !File.exist?(options[:message_file])
$stderr.puts "ERROR: Message file does not exist `#{options[:message_file]}`"
exit 1
end
msg_c = File.read(options[:message_file])
msg = msg ? "#{msg}\n\n#{msg_c}" : msg_c
end
if options[:file]
if !File.exist?(options[:file])
$stderr.puts "ERROR: Message file does not exist `#{options[:file]}`"
exit 1
end
if (tail = options[:tail].to_i) > 0
content = ""
buffer = 0
File.open(options[:file], "r") do |f|
until (content.split("\n").size > tail) || buffer >= f.size
buffer += 1000
buffer = f.size if buffer > f.size
f.seek(f.size - buffer)
content = f.read
end
end
parts = content.split("\n")
if parts.size > tail
parts = parts.slice(-tail, tail)
end
fmsg = parts ? parts.join("\n") : ""
else
fmsg = File.read(options[:file])
end
fmsg = "```\n#{fmsg}\n```"
if msg
msg = msg << "\n\n" << fmsg
end
end
if msg.to_s.empty?
$stderr.puts "ERROR: No message content provided!"
exit 1
end
attach = {text: msg, fallback: msg, color: options[:state], mrkdn: true}
attach[:title] = options[:title] if options[:title]
attach[:footer] = options[:footer] if options[:footer]
attach[:footer_icon] = options[:footer_icon] if options[:footer_icon]
attach[:ts] = Time.now.to_i
payload = {}.tap do |pd|
pd[:username] = options.fetch(:username, "packet-exec")
pd[:channel] = options[:channel] if options[:channel]
pd[:icon_url] = options[:icon] if options[:icon]
pd[:attachments] = [attach]
end
result = Net::HTTP.post(URI(options[:webhook]), payload.to_json, "Content-Type" => "application/json")
if !result.code.start_with?("2")
$stderr.puts "Failed to send slack message"
exit 1
else
$stdout.puts "ok"
end

27
.ci/test.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
csource="${BASH_SOURCE[0]}"
while [ -h "$csource" ] ; do csource="$(readlink "$csource")"; done
root="$( cd -P "$( dirname "$csource" )/../" && pwd )"
pushd "${root}" > /dev/null
export DEBIAN_FRONTEND="noninteractive"
# Install required dependencies
sudo apt-get update || exit 1
sudo apt-get install -yq bsdtar || exit 1
# Ensure bundler is installed
gem install --no-document bundler || exit 1
# Install the bundle
bundle install || exit 1
# Run tests
bundle exec rake test:unit
result=$?
popd > /dev/null
exit $result

33
.circleci/config.yml Normal file
View File

@ -0,0 +1,33 @@
version: 2
jobs:
build-website:
# setting the working_directory along with the checkout path allows us to not have
# to cd into the website/ directory for commands
working_directory: ~/project/website
docker:
- image: hashicorp/middleman-hashicorp:0.3.35
steps:
- checkout:
path: ~/project
- restore_cache:
key: static-site-gems-v1-{{ checksum "Gemfile.lock" }}
- run:
command: bundle check || bundle install --path vendor/bundle
- save_cache:
key: static-site-gems-v1-{{ checksum "Gemfile.lock" }}
paths:
- ~/project/website/vendor/bundle
- run:
command: bundle exec middleman build
- run:
command: ./scripts/deploy.sh
workflows:
version: 2
website:
jobs:
- build-website:
context: static-sites
filters:
branches:
only: stable-website

5
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@ -0,0 +1,5 @@
# Code of Conduct
HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code.
Please read the full text at https://www.hashicorp.com/community-guidelines

View File

@ -1,41 +1,79 @@
# How to contribute
# Contributing to Vagrant
We like to encourage you to contribute to the repository.
This should be as easy as possible for you but there are a few things to consider when contributing.
The following guidelines for contribution should be followed if you want to submit a pull request.
**First:** We like to encourage you to contribute to the repository. If you're unsure or afraid of _anything_, just ask or submit the issue or pull request anyways. You won't be yelled at for giving your best effort. The worst that can happen is that you'll be politely asked to change something. We appreciate any sort of contributions, and don't want a wall of rules to get in the way of that.
## How to prepare
However, for those individuals who want a bit more guidance on the best way to contribute to the project, read on. This document will cover what we're looking for. By addressing all the points we're looking for, it raises the chances we can quickly merge or address your contributions.
* You need a [GitHub account](https://github.com/signup/free)
* Submit an [issue ticket](https://github.com/hashicorp/vagrant/issues) for your issue if there is not one yet.
* Describe the issue and include steps to reproduce when it's a bug.
* Ensure to mention the earliest version that you know is affected.
* If you plan on submitting a bug report, please submit debug-level logs along
with the report using [gist](https://gist.github.com/) or some other paste
service by prepending `VAGRANT_LOG=debug` to your `vagrant` commands.
* Fork the repository on GitHub
Before opening a new issue or pull request, we do appreciate if you take some time to search for [possible duplicates](https://github.com/hashicorp/vagrant/issues?q=sort%3Aupdated-desc), or similar discussions in the [mailing list](https://groups.google.com/forum/#!forum/vagrant-up). On GitHub, you can scope searches by labels to narrow things down.
## Make Changes
## Issues
### Reporting an Issue
**Tip:** We have provided a [GitHub issue template](https://github.com/hashicorp/vagrant/blob/master/.github/ISSUE_TEMPLATE.md). By respecting the proposed format and filling all the relevant sections, you'll strongly help the Vagrant collaborators to handle your request the best possible way.
### Issue Lifecycle
1. The issue is reported.
2. The issue is verified and categorized by Vagrant collaborator(s). Categorization is done via GitHub tags for different dimensions (like issue type, affected components, pending actions, etc.)
3. Unless it is critical, the issue is left for a period of time, giving outside contributors a chance to address the issue. Later, the issue may be assigned to a Vagrant collaborator and planned for a specific release [milestone](https://github.com/hashicorp/vagrant/milestones)
4. The issue is addressed in a pull request or commit. The issue will be referenced in the commit message so that the code that fixes it is clearly linked.
5. The issue is closed. Sometimes, valid issues will be closed to keep the issue tracker clean. The issue is still indexed and available for future viewers, or can be re-opened if necessary.
## Pull Requests
Thank you for contributing! Here you'll find information on what to include in your Pull Request (“PR” for short) to ensure it is reviewed quickly, and possibly accepted.
Before starting work on a new feature or anything besides a minor bug fix, it is highly recommended to first initiate a discussion with the Vagrant community (either via a GitHub issue, the [mailing list](https://groups.google.com/forum/#!forum/vagrant-up), IRC freenode `#vagrant` or [Gitter](https://gitter.im/mitchellh/vagrant)). This will save you from wasting days implementing a feature that could be rejected in the end.
No pull request template is provided on GitHub. The expected changes are often already described and validated in an existing issue, that obviously should be referenced. The Pull Request thread should be mainly used for the code review.
**Tip:** Make it small! A focused PR gives you the best chance of having it accepted. Then, repeat if you have more to propose!
### How to prepare
Once you're confident that your upcoming changes will be accepted:
* In your forked repository, create a topic branch for your upcoming patch.
* Usually this is based on the master branch.
* Create a branch based on master; `git branch
fix/master/my_contribution master` then checkout the new branch with `git
checkout fix/master/my_contribution`. Please avoid working directly on the `master` branch.
* Make commits of logical units and describe them properly.
* Usually this is based on the master branch.
* Checkout a new branch based on master; `git checkout -b my-contrib master`
Please avoid working directly on the `master` branch.
* Make focused commits of logical units and describe them properly.
* Avoid re-formatting of the existing code
* Check for unnecessary whitespace with `git diff --check` before committing.
* If possible, submit tests along with your topic branch. It will help a lot to get your your patch / new feature accepted, and should prevent unwanted breaking changes to silently happen in future developments.
* Assure nothing is broken by running manual tests, and all the automated tests.
* If possible, submit tests to your patch / new feature so it can be tested easily.
* Assure nothing is broken by running all the tests.
## Submit Changes
### Submit Changes
* Push your changes to a topic branch in your fork of the repository.
* Open a pull request to the original repository and choose the right original branch you want to patch.
* Open a PR to the original repository and choose the right original branch you want to patch (master for most cases).
* If not done in commit messages (which you really should do) please reference and update your issue with the code changes.
* Even if you have write access to the repository, do not directly push or merge pull-requests. Let another team member review your pull request and approve.
* Even if you have write access to the repository, do not directly push or merge your own pull requests. Let another team member review your PR and approve.
### Pull Request Lifecycle
1. You are welcome to submit your PR for commentary or review before it is fully completed. Please prefix the title of your PR with "[WIP]" to indicate this. It's also a good idea to include specific questions or items you'd like feedback on.
2. Sign the [HashiCorp CLA](#hashicorp-cla). If you haven't signed the CLA yet, a bot will ask you to do so. You only need to sign the CLA once. If you've already signed the CLA, the CLA status will be green automatically.
3. The PR is categorized by Vagrant collaborator(s), applying GitHub tags similarly to issues triage.
4. Once you believe your PR is ready to be merged, you can remove any
"[WIP]" prefix from the title and a Vagrant collaborator will review.
5. One of the Vagrant collaborators will look over your contribution and either provide comments letting you know if there is anything left to do. We do our best to provide feedback in a timely manner, but it may take some time for us to respond.
6. Once all outstanding comments have been addressed, your contribution will be merged! Merged PRs will be included in the next Vagrant release. The Vagrant contributors will take care of updating the CHANGELOG as they merge.
7. We might decide that a PR should be closed. We'll make sure to provide clear reasoning when this happens.
## HashiCorp CLA
We require all contributors to sign the [HashiCorp CLA](https://www.hashicorp.com/cla).
In simple terms, the CLA affirms that the work you're contributing is original, that you grant HashiCorp permission to use that work (including license to any patents necessary), and that HashiCorp may relicense your work for our commercial products if necessary. Note that this description is a summary and the specific legal terms should be read directly in the [CLA](https://www.hashicorp.com/cla).
The CLA does not change the terms of the standard open source license used by our software such as MPL2 or MIT. You are still free to use our projects within your own projects or businesses, republish modified source, and more. Please reference the appropriate license of this project to learn more.
To sign the CLA, open a pull request as usual. If you haven't signed the CLA yet, a bot will respond with a link asking you to sign the CLA. We cannot merge any pull request until the CLA is signed. You only need to sign the CLA once. If you've signed the CLA before, the bot will not respond to your PR and your PR will be allowed to merge.
# Additional Resources
* [HashiCorp Community Guidelines](https://www.hashicorp.com/community-guidelines)
* [General GitHub documentation](https://help.github.com/)
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)

View File

@ -1,7 +1,8 @@
Please note that the Vagrant issue tracker is reserved for bug reports and
enhancements. For general usage questions, please use the Vagrant mailing list:
Please note that the Vagrant issue tracker is in priority reserved for bug reports and enhancements. For general usage questions, please use the Vagrant mailing list:
https://groups.google.com/forum/#!forum/vagrant-up. Thank you!
**Tip:** Before submitting your issue, don't hesitate to remove the above introductory text, possible empty sections (e.g. References), and this tip.
### Vagrant version
Run `vagrant -v` to show the version. If you are not running the latest version
of Vagrant, please upgrade before submitting an issue.

37
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,37 @@
on:
push:
branches:
- master
paths-ignore:
- 'CHANGELOG.md'
- 'website/**'
jobs:
build-gem:
name: Build Vagrant RubyGem
runs-on: ubuntu-18.04
steps:
- name: Code Checkout
uses: actions/checkout@v1
- name: Set Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Build RubyGem
run: ./.ci/build.sh
working-directory: ${{github.workspace}}
env:
ASSETS_LONGTERM_PREFIX: elt
ASSETS_PRIVATE_BUCKET: ${{ secrets.ASSETS_PRIVATE_BUCKET }}
ASSETS_PRIVATE_LONGTERM: ${{ secrets.ASSETS_PRIVATE_LONGTERM }}
ASSETS_PRIVATE_SHORTTERM: ${{ secrets.ASSETS_PRIVATE_SHORTTERM }}
ASSETS_PUBLIC_BUCKET: ${{ secrets.ASSETS_PUBLIC_BUCKET }}
ASSETS_PUBLIC_LONGTERM: ${{ secrets.ASSETS_PUBLIC_LONGTERM }}
ASSETS_PUBLIC_SHORTTERM: ${{ secrets.ASSETS_PUBLIC_SHORTTERM }}
ASSETS_SHORTTERM_PREFIX: est
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HASHIBOT_EMAIL: ${{ secrets.HASHIBOT_EMAIL }}
HASHIBOT_TOKEN: ${{ secrets.HASHIBOT_TOKEN }}
HASHIBOT_USERNAME: ${{ secrets.HASHIBOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

38
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,38 @@
on:
push:
branches:
- 'build-*'
tags: '*'
paths-ignore:
- 'CHANGELOG.md'
- 'website/**'
jobs:
trigger-release:
name: Trigger Installers Build
runs-on: ubuntu-18.04
steps:
- name: Code Checkout
uses: actions/checkout@v1
- name: Set Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Create Builders Release
run: ./.ci/release.sh
working-directory: ${{github.workspace}}
env:
ASSETS_LONGTERM_PREFIX: elt
ASSETS_PRIVATE_BUCKET: est
ASSETS_PRIVATE_LONGTERM: ${{ secrets.ASSETS_PRIVATE_LONGTERM }}
ASSETS_PRIVATE_SHORTTERM: ${{ secrets.ASSETS_PRIVATE_SHORTTERM }}
ASSETS_PUBLIC_BUCKET: ${{ secrets.ASSETS_PUBLIC_BUCKET }}
ASSETS_PUBLIC_LONGTERM: ${{ secrets.ASSETS_PUBLIC_LONGTERM }}
ASSETS_PUBLIC_SHORTTERM: ${{ secrets.ASSETS_PUBLIC_SHORTTERM }}
ASSETS_SHORTTERM_PREFIX: ${{ secrets.ASSETS_SHORTTERM_PREFIX }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HASHIBOT_EMAIL: ${{ secrets.HASHIBOT_EMAIL }}
HASHIBOT_TOKEN: ${{ secrets.HASHIBOT_TOKEN }}
HASHIBOT_USERNAME: ${{ secrets.HASHIBOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

29
.github/workflows/testing.yml vendored Normal file
View File

@ -0,0 +1,29 @@
on:
push:
branches:
- master
- 'test-*'
paths-ignore:
- 'CHANGELOG.md'
- 'website/**'
pull_request:
branches:
- master
jobs:
unit-tests:
runs-on: ubuntu-18.04
strategy:
matrix:
ruby: [ '2.4.x', '2.5.x', '2.6.x' ]
name: Vagrant unit tests on Ruby ${{ matrix.ruby }}
steps:
- name: Code Checkout
uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
architecture: 'x64'
- name: Run Tests
run: .ci/test.sh

12
.hashibot.hcl Normal file
View File

@ -0,0 +1,12 @@
poll "closed_issue_locker" "locker" {
schedule = "0 50 1 * * *"
closed_for = "720h" # 30 days
max_issues = 500
sleep_between_issues = "5s"
message = <<-EOF
I'm going to lock this issue because it has been closed for _30 days_ . This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
EOF
}

View File

@ -1,25 +0,0 @@
language: ruby
sudo: false
cache: bundler
addons:
apt:
packages:
- bsdtar
rvm:
- 2.3.6
- 2.4.3
- 2.5.0
branches:
only:
- master
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
script: bundle exec rake test:unit

View File

@ -2,10 +2,432 @@
FEATURES:
IMPROVEMENTS:
BUG FIXES:
## 2.2.7 (January 27, 2020)
IMPROVEMENTS:
- guest/opensuse: Check for basename hostname prior to setting hostname [GH-11170]
- host/linux: Check for modinfo in /sbin if it's not on PATH [GH-11178]
- core: Show guest name in hostname error message [GH-11175]
- provisioners/shell: Linux guests now support `reboot` option [GH-11194]
- darwin/nfs: Put each NFS export on its own line [GH-11216]
- contrib/bash: Add more completion flags to up command [GH-11223]
- provider/virtualbox: Add VirtualBox provider support for version 6.1.x [GH-11250]
- box/outdated: Allow to force check for box updates and ignore cached check [GH-11231]
- guest/alpine: Update apk cache when installing rsync [GH-11220]
- provider/virtualbox: Improve error message when machine folder is inaccessible [GH-11239]
- provisioner/ansible_local: Add pip install method for arch guests [GH-11265]
- communicators/winssh: Use Windows shell for `vagrant ssh -c` [GH-11258]
BUG FIXES:
- command/snapshot/save: Fix regression that prevented snapshot of all guests in environment [GH-11152]
- core: Update UI to properly retain newlines when adding prefix [GH-11126]
- core: Check if box update is available locally [GH-11188]
- core: Ensure Vagrant::Errors are loaded in file_checksum util [GH-11183]
- cloud/publish: Improve argument handling for missing arguments to command [GH-11184]
- core: Get latest version for current provider during outdated check [GH-11192]
- linux/nfs: avoid adding extra newlines to /etc/exports [GH-11201]
- guest/darwin: Fix VMware synced folders on APFS [GH-11267]
- guest/redhat: Ensure `nfs-server` is restarted when installing nfs client [GH-11212]
- core: Do not validate checksums if options are empty string [GH-11211]
- provider/docker: Enhance docker build method to match against buildkit output [GH-11205]
- provisioner/ansible_local: Don't prompt for input when installing Ansible on Ubuntu and Debian [GH-11191]
- provisioner/ansible_local: Ensure all guest caps accept all passed in arguments [GH-11265]
- host/windows: Fix regression that prevented port collisions from being detected [GH-11244]
- core/provisioner: Set top level provisioner name if set in a provisioner config [GH-11295]
## 2.2.6 (October 14, 2019)
FEATURES:
- core/provisioners: Introduce new Provisioner options: before and after [GH-11043]
- guest/alpine: Integrate the vagrant-alpine plugin into Vagrant core [GH-10975]
IMPROVEMENTS:
- command/box/prune: Allow prompt skip while preserving actively in use boxes [GH-10908]
- command/cloud: Support providing checksum information with boxes [GH-11101]
- dev: Fixed Vagrantfile for Vagrant development [GH-11012]
- guest/alt: Improve handling for using network tools when setting hostname [GH-11000]
- guest/suse: Add ipv6 network config templates for SUSE based distributions [GH-11013]
- guest/windows: Retry on connection timeout errors for the reboot capability [GH-11093]
- host/bsd: Use host resolve path capability to modify local paths if required [GH-11108]
- host/darwin: Add host resolve path capability to provide real paths for firmlinks [GH-11108]
- provisioners/chef: Update pkg install flags for chef on FreeBSD guests [GH-11075]
- provider/hyperv: Improve error message when VMMS is not running [GH-10978]
- provider/virtualbox: Raise additional errors for incomplete virtualbox installation on usable check [GH-10938]
- util/filechecksum: Add support for more checksum types [GH-11101]
BUG FIXES:
- command/rsync-auto: Fix path watcher bug so that all subdirectories are synced when changed [GH-11089]
- command/snapshot/save: Ensure VM id is passed to list snapshots for hyper-v provider [GH-11097]
- core: Ensure proper paths are shown in config loading exceptions [GH-11056]
- guest/suse: Use hostnamectl instead of hostname to set the hostname under SUSE [GH-11100]
- provider/docker: Fix default provider validation if password is used [GH-11053]
- provider/docker: Fix Docker providers usable? check [GH-11068]
- provisioner/ansible_local: Ensure pip_install_cmd is finalized to emptry string [GH-11098]
- provisioner/file: Ensure relative path for file provisioner source is relative to guest machines cwd [GH-11099]
- provider/docker: Ensure docker build_args option is properly set in docker compose config yaml [GH-11106]
- guest/suse: Update nfs & service daemon names for suse based hosts and guests [GH-11076]
- provider/docker: Determine ip address prefix workaround for docker public networks [GH-11111]
- provider/docker: Only return interfaces where addr is not nil for networks [GH-11116]
## 2.2.5 (June 19, 2019)
FEATURES:
- providers/docker: Private and Public networking support [GH-10702]
IMPROVEMENTS:
- command/global-status: Provide machine-readable information [GH-10506]
- command/snapshot: Separate snapshot names for guests when listing snapshots [GH-10828]
- command/box/update: Ignore missing metadata files when updating all boxes [GH-10829]
- core: Use consistent settings when unpacking boxes as root [GH-10707]
- core: Write metadata.json file when packaging box [GH-10706]
- core: Remove whitespace from id file on load [GH-10727]
- core/bundler: Support resolution when installed within system [GH-10894]
- guest/coreos: Update network configuration and hostname setting [GH-10752]
- guest/freebsd: Add proper VirtualBox share folders support for FreeBSD guests [GH-10717]
- guest/freebsd: Add unmount share folder for VirtualBox guests [GH-10761]
- guest/freebsd: Simplify network interface listing when configuring networks [GH-10763]
- providers/docker: Add usable? check to docker provider [GH-10890]
- synced_folder/smb: Remove configuration information from synced folder data [GH-10811]
BUG FIXES:
- command/box/update: Ensure the right version is picked when updating specific boxes [GH-10810]
- command/cloud: Properly set variable from CLI argument parsing for `username` field [GH-10726]
- command/rsync_auto: Use relative paths to machines folder path for file path Listener [GH-10902]
- communicator/ssh: Remove net/sftp loading to prevent loading errors [GH-10745]
- contrib/bash: Search for running_vm_list only in `machines` folder [GH-10841]
- core/bundler: Properly parse multiple constants when installing plugins [GH-10896]
- core/environment: Support plugin configuration within box Vagrantfiles [GH-10889]
- core/triggers: Fix typo in UI output [GH-10748]
- core/triggers: Properly exit with abort option [GH-10824]
- core/triggers: Ensure guest names are string when filtering trigger configs [GH-10854]
- core/triggers: Abort after all running processes have completed when parallel is enabled [GH-10891]
- guest/void: Fix NFS capability detection [GH-10713]
- guest/bsd: Properly set BSD options order for /etc/exports [GH-10909]
- host/windows: Fix rubygems error when host has directory named `c` [GH-10803]
- provider/virtualbox: Ensure non-existent machines do not attempt to list snapshots [GH-10784]
- provider/docker: Properly set docker-compose config file with volume names [GH-10820]
- provisioner/ansible: Fix pip installer hardcoded curl get_pip.py piped to python [GH-10625]
- provisioner/chef: Update chef install check for guests [GH-10917]
- synced_folders/rsync: Remove rsync__excludes from command if array is empty [GH-10901]
## 2.2.4 (February 27, 2019)
FEATURES:
- core/triggers: Introduce new option `:type` for actions, hooks, and commands [GH-10615]
IMPROVEMENTS:
- communicator/ssh: Update `#upload` behavior to work properly with new sshd path checks [GH-10698]
- communicator/winrm: Update `#upload` behavior to match ssh communicator upload behavior [GH-10698]
- guest/windows: Add reboot output to guest capability [GH-10638]
- provisioner/file: Refactor path modification rules and allow communicator to handle details [GH-10698]
BUG FIXES:
- core: Fix format finalization of plugins in Vagrantfile [GH-10664]
- core: Fix SIGINT behavior and prevent backtrace [GH-10666]
- core: Change remaining box_client_cert refs to box_download_client_cert [GH-10622]
- core: Move over AddAuthentication middleware and hooks out of deprecated class [GH-10686]
- guest/debian: Properly set DHCP for systemd-networkd ips [GH-10586]
- guest/solaris11: Create interface if required before configuration [GH-10595]
- installers/appimage: Use ld path with appimage libs on suffix [GH-10647]
- providers/docker: Expand paths when comparing synced folders on reload [GH-10645]
- providers/virtualbox: Fix import paths on Windows with VirtualBox 6 [GH-10629]
- synced_folders/rsync: Properly clean up tmp folder created during rsync [GH-10690]
## 2.2.3 (January 9, 2019)
FEATURES:
- host/void: Add host support for void linux [GH-10012]
IMPROVEMENTS:
- command/rsync-auto: Prevent crash on post-rsync command failure [GH-10515]
- command/snapshot: Raise error for bad subcommand [GH-10470]
- command/package: Ensure temp dir for package command is cleaned up [GH-10479]
- command/powershell: Support running elevated commands [GH-10528]
- communicator/ssh: Add `config` and `remote_user` options [GH-10496]
- core: Display version update on stderr instead of stdout [GH-10482]
- core: Add experimental feature flag [GH-10485]
- core: Show box version during box outdated check [GH-10573]
- guest/windows: Modify elevated username only on username failure [GH-10488]
- host/windows: Prevent SMB setup commands from becoming too long [GH-10489]
- host/windows: Automatically answer yes when pruning SMB shares [GH-10524]
- provisioners/file: Show source and destination locations with file provisioner [GH-10570]
- provisioners/salt: Validate that `install_type` is set if `version` is specified [GH-10474]
- provisioners/salt: Update default install version [GH-10537]
- provisioners/shell: Add `reboot` option for rebooting supported guest [GH-10532]
- synced_folders/rsync: Support using rsync `--chown` option [GH-10529]
- util/guest_inspection: Validate hostnamectl command works when detected [GH-10512]
- util/platform: Use wslpath command for customized root on WSL [GH-10574]
BUG FIXES:
- command/cloud publish: Ensure box file exists before path expanding [GH-10468]
- command/cloud publish: Catch InvalidVersion errors from vagrant_cloud client [GH-10513]
- command/snapshot: Retain consistent provisioning behavior across all commands [GH-10490]
- command/validate: Bypass install checks for validating configs with the `--ignore-provider` flag [GH-10467]
- communicator/ssh: Fix garbage output detection [GH-10571]
- guest/alt: Fix network configuration errors [GH-10527]
- guest/coreos: Fix grep command for network interface of CoreOS guest [GH-10554]
- guest/freebsd: Fix defaultrouter rcvar in static network template [GH-10469]
- guest/redhat: Fix network configuration errors [GH-10527]
- providers/virtualbox: Adjust version requirement for NIC warning [GH-10486]
- util/powershell: Use correct Base64 encoding for encoded commands [GH-10487]
## 2.2.2 (November 27, 2018)
BUG FIXES:
- providers/virtualbox: Update default_nic_type implementation and add warning [GH-10450]
## 2.2.1 (November 15, 2018)
FEATURES:
- core/plugins: Add reset! method to communicator [GH-10399]
- providers/virtualbox: Add support for VirtualBox 6.0 [GH-10379]
IMPROVEMENTS:
- command/validate: Allow validation of config while ignoring provider [GH-10351]
- communicators/ssh: Prevent overly verbose output waiting for connection [GH-10321]
- communicators/ssh: Support ed25519 keys [GH-10365]
- communicators/ssh: Add reset! implementation [GH-10399]
- communicators/winrm: Add reset! implementation [GH-10399]
- core: Limit number of automatic box update checks [GH-10359]
- host/windows: Remove PATH check in WSL detection [GH-10313]
- providers/hyperv: Disable automatic checkpoints before deletion [GH-10406]
- providers/virtualbox: Add `automount` flag if specified with synced_folder [GH-10326]
- providers/virtualbox: Refactor host only network settings [GH-7699]
- providers/virtualbox: Support setting default NIC type for network adapters [GH-10383]
- providers/virtualbox: Update ssh_port helper to handle multiple matches [GH-10409]
- provisioners/shell: Add :reset option to allow communicator reset [GH-10399]
- synced_folders/smb: Allow for 'default' smb_username in prompt if set [GH-10319]
- util/network_ip: Simplify `network_address` helper [GH-7693]
- util/platform: Prevent hard failure during hyper-v enabled check [GH-10332]
BUG FIXES:
- command/login: Only show deprecation warning when command is invoked [GH-10374]
- core: Fallback to Vagrantfile defined box information [GH-10368]
- core/bundler: Update source ordering to properly resolve with new RubyGems [GH-10364]
- core/triggers: Only split inline script if host is non-Windows [GH-10405]
- communicator/winrm: Prepend computer name to username when running elevated commands [GH-10387]
- guest/debian: Fix halting issue when setting hostname by restarting networking on guest [GH-10301, GH-10330]
- guest/linux: Fix vagrant user access to docker after install [GH-10399]
- guest/windows: Add reboot capability to fix hostname race condition [GH-10347]
- guest/windows: Allow for reading key paths with spaces [GH-10389]
- host/windows: Fix powershell to properly handle paths with spaces [GH-10390]
- providers/docker: Deterministic host VM synced folder location for Docker VM [GH-10311]
- providers/hyperv: Fix network vlan configuration script [GH-10366]
- providers/hyperv: Properly output error message on failed guest import [GH-10404]
- providers/hyperv: Fix typo in network configuration detection script [GH-10410]
## 2.2.0 (October 16, 2018)
FEATURES:
- command/cloud: Introduce `vagrant cloud` subcommand to Vagrant [GH-10148]
- command/upload: Add command for uploading files to guest [GH-10263]
- command/winrm: Add command for executing guest commands via WinRM [GH-10263]
- command/winrm-config: Add command for providing WinRM configuration [GH-10263]
IMPROVEMENTS:
- core: Ensure file paths are identical when checking for cwd [GH-10220]
- core: Add config option `ignore_box_vagrantfile` for ignoring vagrantfile inside box [GH-10242]
- core/triggers: Add abort option to core triggers [GH-10232]
- core/triggers: Introduce `ruby` option for trigger [GH-10267]
- contrib/bash: Add completion for snapshot names for vagrant snapshot restore|delete [GH-9054]
- providers/docker: Build docker from git repo [GH-10221]
- providers/hyperv: Update Hyper-V admin check and allow override via ENV variable [GH-10275]
- providers/virtualbox: Allow base_mac to be optional [GH-10255]
- provisioners/salt: bootstrap-salt.sh: use -s with curl [GH-9432]
- provisioners/salt: remove leading space with bootstrap_options [GH-9431]
BUG FIXES:
- core/environment: Provide rgloader for local plugin installations [GH-10279]
- contrib/sudoers/osx: Fix missing comma and add remove export alias [GH-10235]
- guest/redhat: Update restart logic in redhat change_host_name cap [GH-10223]
- guest/windows: Allow special characters in SMB password field [GH-10219]
- providers/hyperv: Only use AutomaticCheckpointsEnabled when available [GH-10264]
- providers/hyperv: Only use CheckpointType when available [GH-10265]
- provisioners/ansible: Fix remote directory creation [GH-10259, GH-10258]
- provisioners/puppet: Properly set env variables for puppet provisioner on windows [GH-10218]
- provisioners/salt: Properly set salt pillar variables for windows guests [GH-10215]
- synced_folders/rsync: Ensure unique tmp dirs for ControlPath with rsync [GH-10291]
## 2.1.5 (September 12, 2018)
IMPROVEMENTS:
- core: Add `Vagrant.version?` helper method [GH-10191]
- core: Scrub sensitive values from logger output [GH-10200]
- core: Prevent multiple evaluations of Vagrantfile [GH-10199]
- command/init: Support VAGRANT_DEFAULT_TEMPLATE env var [GH-10171]
- command/powershell: Improve doc help string and fix winrm locales error [GH-10189]
- contrib/bash: autocomplete running VM names for destroy subcommand [GH-10168]
- guest/debian: Use `sudo` to determine if systemd is in use for hardened systems [GH-10198]
- guest/openbsd: Add IPv6 network template for OpenBSD machines [GH-8912]
- provisioners/salt: Allow non-windows hosts to pass along version [GH-10194]
BUG FIXES:
- core: Fix Vagrant.has_plugin? behavior before plugins are initialized [GH-10165]
- core: Check verify_host_key for falsey or :never values when generating ssh config [GH-10182]
- guest/linux: Filter out empty strings and loopback interfaces when constructing list of network interfaces [GH-10092]
- provider/hyper-v: Check for automatic checkpoint support before configuring [GH-10181]
## 2.1.4 (August 30, 2018)
BUG FIXES:
- core: Fix local plugin installation prompt answer parsing [GH-10154]
- core: Reset internal environment after plugin loading [GH-10155]
- host/windows: Fix SMB list parsing when extra fields are included [GH-10156]
- provisioners/ansible_local: Fix umask setting permission bug [GH-10140]
## 2.1.3 (August 29, 2018)
FEATURES:
- core: Support for project specific plugins [GH-10037]
IMPROVEMENTS:
- command/reload: Add `--force` flag to reload command [GH-10123]
- communicator/winrm: Display warning if vagrant-winrm plugin is detected [GH-10076]
- contrib/bash: Replace -VAGRANTSLASH- with literal slash in completion [GH-9987]
- core: Show installed version of Vagrant when displaying version check [GH-9968]
- core: Retain information of original box backing active guest [GH-10083]
- core: Only write box info if provider supports box objects [GH-10126]
- core: Update net-ssh dependency constraint to ~> 5.0.0 [GH-10066]
- core/triggers: Catch and allow for non-standard exit codes with triggers `run` options [GH-10005]
- core/triggers: Allow for spaces in `path` for trigger run option [GH-10118]
- guest/debian: Isolate network interface configuration to individual files for systemd [GH-9889]
- guest/redhat: Use libnfs-utils package if available [GH-9878]
- provider/docker: Support Docker volume consistency for synced folders [GH-9811]
- provider/hyperv: Disable synced folders on non-DrvFs file systems by default [GH-10001]
- util/downloader: Support custom suffix on user agent string [GH-9966]
- util/downloader: Prevent false positive matches on Location header [GH-10041]
- util/subprocess: Force system library paths for executables external to AppImage [GH-10078]
BUG FIXES:
- core: Disable Vagrantfile loading with plugin commands [GH-10030]
- core: Ensure the SecureRandom library is loaded for the trigger class [GH-10063]
- core/triggers: Allow trigger run args option to be a single string [GH-10116]
- util/powershell: Properly `join` commands from passed in array [GH-10115]
- guest/solaris: Add back guest detection check for Solaris derived guests [GH-10081]
- guest/windows: Be more explicit when invoking cmd.exe with mount_volume script [GH-9976]
- host/linux: Fix sudo usage in NFS capability when modifying exports file [GH-10084]
- host/windows: Remove localization dependency from SMB list generation [GH-10043]
- provider/docker: Convert windows paths for volume mounts on docker driver [GH-10100]
- provider/hyperv: Fix checkpoint configuration and properly disable automatic checkpoints by default [GH-9999]
- provider/hyperv: Remove localization dependency from access check [GH-10000]
- provider/hyperv: Enable ExposeVirtualizationExtensions only when available [GH-10079]
- provider/virtualbox: Skip link-local when fixing IPv6 route [GH-9639, GH-10077]
- push/ftp: Custom error when attempting to push too many files [GH-9952]
- util/downloader: Prevent errors when Location header contains relative path [GH-10017]
- util/guest_inspection: Prevent nmcli check from hanging when pty is enabled [GH-9926]
- util/platform: Always force string type conversion on path [GH-9998]
## 2.1.2 (June 26, 2018)
IMPROVEMENTS:
- commands/suspend: Introduce flag for suspending all machines [GH-9829]
- commands/global-status: Improve message about removing stale entries [GH-9856]
- provider/hyperv: Attempt to determine import failure cause [GH-9936]
- provider/hyperv: Update implementation. Include support for modifications on reload [GH-9872]
- provider/hyperv: Validate maxmemory configuration setting [GH-9932]
- provider/hyperv: Enable provider within WSL [GH-9943]
- provider/hyperv: Add Hyper-V accessibility check on data directory path [GH-9944]
- provisioners/ansible_local: Improve installation from PPA on Ubuntu guests.
The compatibility is maintained only for active long-term support (LTS) versions,
i.e. Ubuntu 12.04 (Precise Pangolin) is no longer supported. [GH-9879]
BUG FIXES:
- communicator/ssh: Update ssh private key file permission handling on Windows [GH-9923, GH-9900]
- core: Display plugin commands in help [GH-9808]
- core: Ensure guestpath or name is set with synced_folder option and dont set guestpath if not provided [GH-9692]
- guest/debian: Fix netplan generation when using DHCP [GH-9855]
- guest/debain: Update priority of network configuration file when using networkd [GH-9867]
- guest/ubuntu: Update netplan config generation to detect NetworkManager [GH-9824]
- guest/ubuntu: Fix failing Ansible installation from PPA on Bionic Beaver (18.04 LTS) [GH-9796]
- host/windows: Prevent processing of last SMB line when using net share [GH-9917]
- provisioner/chef: Prevent node_name set on configuration with chef_apply [GH-9916]
- provisioner/salt: Remove usage of masterless? config attribute [GH-9833]
## 2.1.1 (May 7, 2018)
IMPROVEMENTS:
- guest/linux: Support builtin vboxsf module for shared folders [GH-9800]
- host/windows: Update SMB capability to work without Get-SmbShare cmdlet [GH-9785]
BUG FIXES:
- core/triggers: Initialize internal trigger object for machine before initializing provider [GH-9784]
- core/triggers: Ensure internal trigger fire does not get called if plugin installed [GH-9799]
- provider/hyperv: Call import script with switchid instead of switchname [GH-9781]
## 2.1.0 (May 3, 2018)
FEATURES:
- core: Integrate vagrant-triggers plugin functionality into core Vagrant [GH-9713]
IMPROVEMENTS:
- core: Improve messaging around not finding requested provider [GH-9735]
- core: Disable exception reports by default [GH-9738]
- core: Continue on if vagrant fails to parse metadata box for update [GH-9760]
- hosts/linux: Support RDP capability within WSL [GH-9758]
- hosts/windows: Add SMB default mount options capability and set default version to 2.0 [GH-9734]
- provider/hyperv: Include neighbor check for MAC on guest IP detection [GH-9737]
- provider/virtualbox: Do not require VirtualBox availability within WSL [GH-9759]
- provisioner/chef_zero: Support arrays for data_bags_path [GH-9669]
- util/downloader: Don't raise error if response is HTTP 416 [GH-9729]
- util/platform: Update Hyper-V enabled check [GH-9746]
BUG FIXES:
- communicators/ssh: Log error and proceed on Windows private key permissions [GH-9769]
- middleware/authentication: Prevent URL modification when no changes are required [GH-9730]
- middleware/authentication: Ignore URLs which cannot be parsed [GH-9739]
- provider/hyperv: Reference switches by ID instead of name [GH-9747]
- provider/docker: Use Util::SafeExec if docker-exec is run with `-t` option [GH-9761]
- provisioner/chef: Trim drive letter from path on Windows [GH-9766]
- provisioner/puppet: Properly finalize structured_facts config option [GH-9720]
- util/platform: Fix original WSL to Windows path for "root" directory [GH-9696]
## 2.0.4 (April 20, 2018)
FEATURES:
- core: Vagrant aliases [GH-9504]
IMPROVEMENTS:
- communicators/ssh: Update file permissions when generating new key pairs [GH-9676]
- core: Make resolv-replace usage opt-in instead of opt-out [GH-9644]
- core: Suppress error messages from checkpoint runs [GH-9645]
- guests/coreos: Identify operating systems closely related to CoreOS [GH-9600]
@ -13,14 +435,22 @@ IMPROVEMENTS:
- guests/photon: Less specific string grep to fix PhotonOS 2.0 detection [GH-9528]
- guests/windows: Fix slow timeout when updating windows hostname [GH-9578]
- hosts/windows: Make powershell version detection timeout configurable [GH-9506]
- providers/virtualbox: Improve network collision error message [GH-9685]
- provisioner/chef_solo: Improve Windows drive letter removal hack for remote paths[GH-9490]
- provisioner/chef_zero: File path expand all chef_zero config path options [GH-9690]
- provisioner/puppet: Puppet structured facts toyaml on provisioner [GH-9670]
- provisioner/salt: Add master_json_config & minion_json_config options [GH-9420]
- util/platform: Warn on ArgumentError exceptions from encoding [GH-9506]
BUG FIXES:
- commands/package: Fix uninitialized constant error [GH-9654]
- communicators/winrm: Fix command filter to properly parse commands [GH-9673]
- hosts/windows: Properly respect the VAGRANT_PREFER_SYSTEM_BIN environment variable [GH-9503]
- hosts/windows: Fix virtualbox shared folders path for windows guests [GH-8099]
- guests/freebsd: Fix typo in command that manages configuring networks [GH-9705]
- util/checkpoint_client: Respect VAGRANT_CHECKPOINT_DISABLE environment variable [GH-9659]
- util/platform: Use `--version` instead of `version` for WSL validation [GH-9674]
## 2.0.3 (March 15, 2018)
@ -122,7 +552,7 @@ BUG FIXES:
- core: Rescue more exceptions when checking if port is open [GH-8517]
- guests/solaris11: Inherit from Solaris guest and keep solaris11 specific methods [GH-9034]
- guests/windows: Split out cygwin path helper for msys2/cygwin paths and ensure cygpath exists [GH-8972]
- guests/windows: Specify expected shell when executing on guest (fixes winssh communicator usage) [GH-9012]
- guests/windows: Specify expected shell when executing on guest (fixes einssh communicator usage) [GH-9012]
- guests/windows: Include WinSSH Communicator when using insert_public_key [GH-9105]
- hosts/windows: Check for vagrant.exe when validating versions within WSL [GH-9107, GH-8962]
- providers/docker: Isolate windows check within executor to handle running through VM [GH-8921]

View File

@ -1,6 +1,6 @@
The MIT License
Copyright (c) 2010-2018 Mitchell Hashimoto
Copyright (c) 2010-2019 Mitchell Hashimoto
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -19,6 +19,8 @@ between Windows, Mac OS X, and Linux.
## Quick Start
Package dependencies: Vagrant requires `bsdtar` to be available on your system PATH to run successfully.
For the quick-start, we'll bring up a development machine on
[VirtualBox](https://www.virtualbox.org/) because it is free and works
on all major platforms. Vagrant can, however, work with almost any
@ -31,11 +33,11 @@ installed. After this,
To build your first virtual environment:
vagrant init hashicorp/precise32
vagrant init hashicorp/bionic64
vagrant up
Note: The above `vagrant up` command will also trigger Vagrant to download the
`precise32` box via the specified URL. Vagrant only does this if it detects that
`bionic64` box via the specified URL. Vagrant only does this if it detects that
the box doesn't already exist on your system.
## Getting Started Guide
@ -43,25 +45,30 @@ the box doesn't already exist on your system.
To learn how to build a fully functional development environment, follow the
[getting started guide](https://www.vagrantup.com/docs/getting-started/index.html).
## Installing the Gem from Git
## Installing from Source
If you want the bleeding edge version of Vagrant, we try to keep master pretty stable
and you're welcome to give it a shot. Please review the installation page [here](https://www.vagrantup.com/docs/installation/source.html).
## Contributing to Vagrant
To install Vagrant from source, please [follow the guide in the Wiki](https://github.com/hashicorp/vagrant/wiki/Installing-Vagrant-from-Source).
You can run the test suite with:
Once your Vagrant bundle is installed from Git repository, you can run the test suite with:
bundle exec rake
This will run the unit test suite, which should come back all green! Then you're good to go!
This will run the unit test suite, which should come back all green!
If you want to run Vagrant without having to install the gem, you may use `bundle exec`,
like so:
If you are developing Vagrant on a machine that already has a Vagrant package installation present, both will attempt to use the same folder for their configuration (location of this folder depends on system). This can cause errors when Vagrant attempts to load plugins. In this case, override the `VAGRANT_HOME` environment variable for your development version of Vagrant before running any commands, to be some new folder within the project or elsewhere on your machine. For example, in Bash:
bundle exec vagrant help
export VAGRANT_HOME=~/.vagrant-dev
You can now run Vagrant commands against the development version:
bundle exec vagrant
Please take time to read the [HashiCorp Community Guidelines](https://www.hashicorp.com/community-guidelines) and the [Vagrant Contributing Guide](https://github.com/hashicorp/vagrant/blob/master/.github/CONTRIBUTING.md).
Then you're good to go!
### Acceptance Tests

View File

@ -15,34 +15,20 @@ targeted at Vagrant core members who have the ability to cut a release.
$ git push --tags
```
1. Trigger an installer creation run within the HashiCorp Bamboo installation.
This will take around 45 minutes.
1. This will automatically trigger an installer creation, upload the artifacts,
and publish the release.
1. Download all the resulting artifacts into the `pkg/dist` folder relative to
the Vagrant repository on your local machine.
1. After the release has been published update the `website/config.rb` to point
to the latest version, commit, and push.
1. Run `./scripts/sign.sh` with the version that is being created. This must be
run from the Vagrant repo root. This will GPG sign and checksum the files.
1. Publish the webiste by deleting the `stable-website` branch, recreate the branch,
and force push. From the `master` branch, run:
1. Run the following command to upload the binaries to the releases site:
```
$ hc-releases upload pkg/dist
```
1. Publish the new index files to the releases site:
```
$ hc-releases publish
```
1. Update `website/config.rb` to point to the latest version, commit, and push.
1. Tell HashiBot to deploy in ``#deploys`
```
hashibot deploy vagrant
```
```
$ git branch -D stable-website
$ git branch -b stable-website
$ git push -f origin stable-website
```
1. Update `version.txt` to append `.dev` and add a new blank entry in the
CHANGELOG, commit, and push.

39
Vagrantfile vendored
View File

@ -4,13 +4,13 @@
# Ruby, run unit tests, etc.
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
config.vm.box = "hashicorp/bionic64"
config.vm.hostname = "vagrant"
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
["vmware_fusion", "vmware_workstation", "virtualbox"].each do |provider|
["vmware_desktop", "virtualbox", "hyperv"].each do |provider|
config.vm.provider provider do |v, override|
v.memory = "1024"
v.memory = "2048"
end
end
@ -29,32 +29,32 @@ $shell = <<-'CONTENTS'
export DEBIAN_FRONTEND=noninteractive
MARKER_FILE="/usr/local/etc/vagrant_provision_marker"
RUBY_VER_REQ=$(awk '$1 == "s.required_ruby_version" { print $4 }' /vagrant/vagrant.gemspec | tr -d '"')
BUNDLER_VER_REQ=$(awk '/s.add_dependency "bundler"/ { print $4 }' /vagrant/vagrant.gemspec | tr -d '"')
# Only provision once
if [ -f "${MARKER_FILE}" ]; then
exit 0
fi
# Add ubuntu_rvm repo
apt-add-repository -y ppa:rael-gc/rvm
# Update apt
apt-get update --quiet
# Install basic dependencies
apt-get install -qy build-essential bsdtar curl
# Add vagrant user to sudo group:
# ubuntu_rvm only adds users in group sudo to group rvm
usermod -a -G sudo vagrant
# Install basic dependencies and RVM
apt-get install -qy build-essential bsdtar rvm
# Import the mpapis public key to verify downloaded releases
su -l -c 'gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3' vagrant
# Install RVM
su -l -c 'curl -sL https://get.rvm.io | bash -s stable' vagrant
# Add the vagrant user to the RVM group
#usermod -a -G rvm vagrant
# Install latest Ruby that complies with Vagrant's version constraint
RUBY_VER_LATEST=$(su -l -c 'rvm list known' vagrant | tr '[]-' ' ' | awk "/^ ruby ${RUBY_VER_REQ:0:1}\./ { print \$2 }" | sort | tail -n1)
su -l -c "rvm install ${RUBY_VER_LATEST}" vagrant
su -l -c "rvm --default use ${RUBY_VER_LATEST}" vagrant
# Install next-to-last Ruby that complies with Vagrant's version constraint
RUBY_VER=$(su -l -c 'rvm list known' vagrant | tr '[]-' ' ' | awk "/^ ruby ${RUBY_VER_REQ:0:1}\./ { print \$2 }" | sort -r | sed -n '2p')
su -l -c "rvm install ${RUBY_VER}" vagrant
su -l -c "rvm --default use ${RUBY_VER}" vagrant
# Output the Ruby version (for sanity)
su -l -c 'ruby --version' vagrant
@ -63,15 +63,14 @@ su -l -c 'ruby --version' vagrant
apt-get install -qy git
# Upgrade Rubygems
su -l -c "rvm ${RUBY_VER_LATEST} do gem update --system" vagrant
su -l -c "rvm ${RUBY_VER} do gem update --system" vagrant
# Install bundler and prepare to run unit tests
su -l -c "gem install bundler -v ${BUNDLER_VER_REQ}" vagrant
# Prepare to run unit tests
su -l -c 'cd /vagrant; bundle install' vagrant
# Automatically move into the shared folder, but only add the command
# if it's not already there.
grep -q 'cd /vagrant' /home/vagrant/.bash_profile || echo 'cd /vagrant' >> /home/vagrant/.bash_profile
grep -q 'cd /vagrant' /home/vagrant/.bash_profile 2>/dev/null || echo 'cd /vagrant' >> /home/vagrant/.bash_profile
# Touch the marker file so we don't do this again
touch ${MARKER_FILE}

View File

@ -5,6 +5,11 @@
# initializing which have historically resulted in stack traces.
Signal.trap("INT") { abort }
# Disable exception reporting by default if available
if Thread.respond_to?(:report_on_exception=)
Thread.report_on_exception = false
end
# Split arguments by "--" if its there, we'll recombine them later
argv = ARGV.dup
argv_extra = []
@ -32,13 +37,21 @@ argv.each_index do |i|
arg = argv[i]
if !arg.start_with?("-")
if ["plugin", "help"].include?(arg) || (arg == "box" && argv[i+1] == "list")
if arg == "box" && argv[i+1] == "list"
opts[:vagrantfile_name] = ""
ENV['VAGRANT_NO_PLUGINS'] = "1"
end
if arg == "plugin" && argv[i+1] != "list"
ENV['VAGRANT_DISABLE_PLUGIN_INIT'] = "1"
# Do not load plugins when performing plugin operations
if arg == "plugin"
if argv.none?{|a| a == "--local" } && !ENV["VAGRANT_LOCAL_PLUGINS_LOAD"]
opts[:vagrantfile_name] = ""
end
ENV['VAGRANT_NO_PLUGINS'] = "1"
# Only initialize plugins when listing installed plugins
if argv[i+1] != "list"
ENV['VAGRANT_DISABLE_PLUGIN_INIT'] = "1"
end
end
break
@ -76,6 +89,7 @@ begin
require 'vagrant/bundler'
require 'vagrant/cli'
require 'vagrant/util/platform'
require 'vagrant/util/experimental'
# Schedule the cleanup of things
at_exit(&Vagrant::Bundler.instance.method(:deinit))
@ -146,6 +160,23 @@ begin
env.ui.warn(I18n.t("vagrant.general.not_in_installer") + "\n", prefix: false)
end
# Acceptable experimental flag values include:
#
# Unset - Disables experimental features
# 0 - Disables experimental features
# 1 - Enables all features
# String - Enables one or more features, separated by commas
if Vagrant::Util::Experimental.enabled?
experimental = Vagrant::Util::Experimental.features_requested
ui = Vagrant::UI::Prefixed.new(env.ui, "vagrant")
logger.debug("Experimental flag is enabled")
if Vagrant::Util::Experimental.global_enabled?
ui.warn(I18n.t("vagrant.general.experimental.all"), bold: true, prefix: true, channel: :error)
else
ui.warn(I18n.t("vagrant.general.experimental.features", features: experimental.join(", ")), bold: true, prefix: true, channel: :error)
end
end
begin
# Execute the CLI interface, and exit with the proper error code
exit_status = env.cli(argv)

View File

@ -53,7 +53,7 @@ __vagrantinvestigate() {
_vagrant() {
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
commands="box connect destroy docker-exec docker-logs docker-run global-status halt help init list-commands login package plugin provision push rdp reload resume rsync rsync-auto share snapshot ssh ssh-config status suspend up version"
commands="box cloud connect destroy docker-exec docker-logs docker-run global-status halt help init list-commands login package plugin provision push rdp reload resume rsync rsync-auto share snapshot ssh ssh-config status suspend up version"
if [ $COMP_CWORD == 1 ]
then
@ -65,7 +65,7 @@ _vagrant() {
then
case "$prev" in
"init")
local box_list=$(find "${VAGRANT_HOME:-${HOME}/.vagrant.d}/boxes" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
local box_list=$(find "${VAGRANT_HOME:-${HOME}/.vagrant.d}/boxes" -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | sed -e 's/-VAGRANTSLASH-/\//')
COMPREPLY=($(compgen -W "${box_list}" -- ${cur}))
return 0
;;
@ -75,17 +75,29 @@ _vagrant() {
then
local vm_list=$(find "${vagrant_state_file}/machines" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
fi
local up_commands="--no-provision"
local up_commands="\
--provision \
--no-provision \
--provision-with \
--destroy-on-error \
--no-destroy-on-error \
--parallel \
--no-parallel
--provider \
--install-provider \
--no-install-provider \
-h \
--help"
COMPREPLY=($(compgen -W "${up_commands} ${vm_list}" -- ${cur}))
return 0
;;
"ssh"|"provision"|"reload"|"halt"|"suspend"|"resume"|"ssh-config")
"destroy"|"ssh"|"provision"|"reload"|"halt"|"suspend"|"resume"|"ssh-config")
vagrant_state_file=$(__vagrantinvestigate) || return 1
if [[ -f "${vagrant_state_file}" ]]
then
running_vm_list=$(grep 'active' "${vagrant_state_file}" | sed -e 's/"active"://' | tr ',' '\n' | cut -d '"' -f 2 | tr '\n' ' ')
else
running_vm_list=$(find "${vagrant_state_file}" -type f -name "id" | awk -F"/" '{print $(NF-2)}')
running_vm_list=$(find "${vagrant_state_file}/machines" -type f -name "id" | awk -F"/" '{print $(NF-2)}')
fi
COMPREPLY=($(compgen -W "${running_vm_list}" -- ${cur}))
return 0
@ -95,6 +107,11 @@ _vagrant() {
COMPREPLY=($(compgen -W "${box_commands}" -- ${cur}))
return 0
;;
"cloud")
cloud_commands="auth box search provider publish version"
COMPREPLY=($(compgen -W "${cloud_commands}" -- ${cur}))
return 0
;;
"plugin")
plugin_commands="install license list uninstall update"
COMPREPLY=($(compgen -W "${plugin_commands}" -- ${cur}))
@ -132,7 +149,7 @@ _vagrant() {
"box")
case "$prev" in
"remove"|"repackage")
local box_list=$(find "${VAGRANT_HOME:-${HOME}/.vagrant.d}/boxes" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
local box_list=$(find "${VAGRANT_HOME:-${HOME}/.vagrant.d}/boxes" -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | sed -e 's/-VAGRANTSLASH-/\//')
COMPREPLY=($(compgen -W "${box_list}" -- ${cur}))
return 0
;;
@ -140,6 +157,15 @@ _vagrant() {
;;
esac
;;
"snapshot")
case "$prev" in
"restore"|"delete")
local snapshot_list=$(vagrant snapshot list)
COMPREPLY=($(compgen -W "${snapshot_list}" -- ${cur}))
return 0
;;
esac
;;
*)
;;
esac

View File

@ -7,4 +7,4 @@ Cmnd_Alias VAGRANT_SMB_LIST = /usr/sbin/sharing -l
Cmnd_Alias VAGRANT_SMB_PLOAD = /bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.smb.preferences.plist
Cmnd_Alias VAGRANT_SMB_DLOAD = /bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.smbd.plist
Cmnd_Alias VAGRANT_SMB_DSTART = /bin/launchctl start com.apple.smbd
%admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_SMB_ADD, VAGRANT_SMB_REMOVE, VAGRANT_SMB_LIST, VAGRANT_SMB_PLOAD, VAGRANT_SMB_DLOAD VAGRANT_SMB_DSTART
%admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE, VAGRANT_SMB_ADD, VAGRANT_SMB_REMOVE, VAGRANT_SMB_LIST, VAGRANT_SMB_PLOAD, VAGRANT_SMB_DLOAD, VAGRANT_SMB_DSTART

View File

@ -1,8 +1,18 @@
require "vagrant/shared_helpers"
require "rubygems"
require "log4r"
require "vagrant/util/credential_scrubber"
# Update the default formatter within the log4r library to ensure
# sensitive values are being properly scrubbed from logger data
class Log4r::BasicFormatter
alias_method :vagrant_format_object, :format_object
def format_object(obj)
Vagrant::Util::CredentialScrubber.desensitize(vagrant_format_object(obj))
end
end
require "vagrant/shared_helpers"
require "rubygems"
require "vagrant/util"
require "vagrant/plugin/manager"
# Enable logging if it is requested. We do this before
# anything else so that we can setup the output before
@ -39,7 +49,16 @@ if ENV["VAGRANT_LOG"] && ENV["VAGRANT_LOG"] != ""
# Set the logging level on all "vagrant" namespaced
# logs as long as we have a valid level.
if level
logger = Log4r::Logger.new("vagrant")
# NOTE: We must do this little hack to allow
# rest-client to write using the `<<` operator.
# See https://github.com/rest-client/rest-client/issues/34#issuecomment-290858
# for more information
class VagrantLogger < Log4r::Logger
def << (msg)
debug(msg.strip)
end
end
logger = VagrantLogger.new("vagrant")
logger.outputters = Log4r::Outputter.stderr
logger.level = level
base_formatter = Log4r::BasicFormatter.new
@ -49,6 +68,11 @@ if ENV["VAGRANT_LOG"] && ENV["VAGRANT_LOG"] != ""
date_pattern: "%F %T"
)
end
# Vagrant Cloud gem uses RestClient to make HTTP requests, so
# log them if debug is enabled and use Vagrants logger
require 'rest_client'
RestClient.log = logger
Log4r::Outputter.stderr.formatter = Vagrant::Util::LoggingFormatter.new(base_formatter)
logger = nil
end
@ -150,16 +174,9 @@ module Vagrant
return true if plugin("2").manager.registered.any? { |p| p.name == name }
end
# Make the requirement object
version = Gem::Requirement.new([version]) if version
# Now check the plugin gem names
require "vagrant/plugin/manager"
Plugin::Manager.instance.installed_specs.any? do |s|
match = s.name == name
next match if !version
next match && version.satisfied_by?(s.version)
end
Plugin::Manager.instance.plugin_installed?(name, version)
end
# Returns a superclass to use when creating a plugin for Vagrant.
@ -201,6 +218,17 @@ module Vagrant
puts "be removed in the next version of Vagrant."
end
# This checks if Vagrant is installed in a specific version.
#
# Example:
#
# Vagrant.version?(">= 2.1.0")
#
def self.version?(*requirements)
req = Gem::Requirement.new(*requirements)
req.satisfied_by?(Gem::Version.new(VERSION))
end
# This allows a Vagrantfile to specify the version of Vagrant that is
# required. You can specify a list of requirements which will all be checked
# against the running Vagrant version.
@ -217,8 +245,7 @@ module Vagrant
logger = Log4r::Logger.new("vagrant::root")
logger.info("Version requirements from Vagrantfile: #{requirements.inspect}")
req = Gem::Requirement.new(*requirements)
if req.satisfied_by?(Gem::Version.new(VERSION))
if version?(*requirements)
logger.info(" - Version requirements satisfied!")
return
end
@ -262,35 +289,6 @@ else
global_logger.warn("resolv replacement has not been enabled!")
end
# Setup the plugin manager and load any defined plugins
require_relative "vagrant/plugin/manager"
plugins = Vagrant::Plugin::Manager.instance.installed_plugins
global_logger.info("Plugins:")
plugins.each do |plugin_name, plugin_info|
installed_version = plugin_info["installed_gem_version"]
version_constraint = plugin_info["gem_version"]
installed_version = 'undefined' if installed_version.to_s.empty?
version_constraint = '> 0' if version_constraint.to_s.empty?
global_logger.info(
" - #{plugin_name} = [installed: " \
"#{installed_version} constraint: " \
"#{version_constraint}]"
)
end
if Vagrant.plugins_init?
begin
Vagrant::Bundler.instance.init!(plugins)
rescue Exception => e
global_logger.error("Plugin initialization error - #{e.class}: #{e}")
e.backtrace.each do |backtrace_line|
global_logger.debug(backtrace_line)
end
raise Vagrant::Errors::PluginInitError, message: e.to_s
end
end
# A lambda that knows how to load plugins from a single directory.
plugin_load_proc = lambda do |directory|
# We only care about directories
@ -320,45 +318,3 @@ Vagrant.source_root.join("plugins").children(true).each do |directory|
# Otherwise, attempt to load from sub-directories
directory.children(true).each(&plugin_load_proc)
end
# If we have plugins enabled, then load those
if Vagrant.plugins_enabled?
begin
global_logger.info("Loading plugins!")
plugins.each do |plugin_name, plugin_info|
if plugin_info["require"].to_s.empty?
begin
global_logger.debug("Loading plugin `#{plugin_name}` with default require: `#{plugin_name}`")
require plugin_name
rescue LoadError, Gem::LoadError => load_error
if plugin_name.include?("-")
begin
plugin_slash = plugin_name.gsub("-", "/")
global_logger.debug("Failed to load plugin `#{plugin_name}` with default require.")
global_logger.debug("Loading plugin `#{plugin_name}` with slash require: `#{plugin_slash}`")
require plugin_slash
rescue LoadError, Gem::LoadError
global_logger.warn("Failed to load plugin `#{plugin_name}`. Assuming library and moving on.")
end
end
end
else
global_logger.debug("Loading plugin `#{plugin_name}` with custom require: `#{plugin_info["require"]}`")
require plugin_info["require"]
end
global_logger.debug("Successfully loaded plugin `#{plugin_name}`.")
end
if defined?(::Bundler)
global_logger.debug("Bundler detected in use. Loading `:plugins` group.")
::Bundler.require(:plugins)
end
rescue Exception => e
global_logger.error("Plugin loading error: #{e.class} - #{e}")
e.backtrace.each do |backtrace_line|
global_logger.debug(backtrace_line)
end
raise Vagrant::Errors::PluginLoadError, message: e.to_s
end
else
global_logger.debug("Plugin loading is currently disabled.")
end

View File

@ -15,6 +15,7 @@ module Vagrant
autoload :Confirm, "vagrant/action/builtin/confirm"
autoload :ConfigValidate, "vagrant/action/builtin/config_validate"
autoload :DestroyConfirm, "vagrant/action/builtin/destroy_confirm"
autoload :Disk, "vagrant/action/builtin/disk"
autoload :EnvSet, "vagrant/action/builtin/env_set"
autoload :GracefulHalt, "vagrant/action/builtin/graceful_halt"
autoload :HandleBox, "vagrant/action/builtin/handle_box"

View File

@ -0,0 +1,31 @@
module Vagrant
module Action
module Builtin
# This class is intended to be used by the Action::Warden class for executing
# action triggers before any given action.
#
# @param [Symbol] action_name - name to fire trigger on
# @param [Vagrant::Plugin::V2::Triger] triggers - trigger object
class AfterTriggerAction
# @param [Symbol] action_name - The action class name to fire trigger on
# @param [Vagrant::Plugin::V2::Triger] triggers - trigger object
def initialize(app, env, action_name, triggers)
@app = app
@env = env
@triggers = triggers
@action_name = action_name
end
def call(env)
machine = env[:machine]
machine_name = machine.name if machine
@triggers.fire_triggers(@action_name, :after, machine_name, :action) if Vagrant::Util::Experimental.feature_enabled?("typed_triggers");
# Carry on
@app.call(env)
end
end
end
end
end

View File

@ -0,0 +1,28 @@
module Vagrant
module Action
module Builtin
# This class is intended to be used by the Action::Warden class for executing
# action triggers before any given action.
class BeforeTriggerAction
# @param [Symbol] action_name - The action class name to fire trigger on
# @param [Vagrant::Plugin::V2::Triger] triggers - trigger object
def initialize(app, env, action_name, triggers)
@app = app
@env = env
@triggers = triggers
@action_name = action_name
end
def call(env)
machine = env[:machine]
machine_name = machine.name if machine
@triggers.fire_triggers(@action_name, :before, machine_name, :action) if Vagrant::Util::Experimental.feature_enabled?("typed_triggers");
# Carry on
@app.call(env)
end
end
end
end
end

View File

@ -348,9 +348,15 @@ module Vagrant
end
if opts[:checksum] && opts[:checksum_type]
env[:ui].detail(I18n.t("vagrant.actions.box.add.checksumming"))
validate_checksum(
opts[:checksum_type], opts[:checksum], box_url)
if opts[:checksum].to_s.strip.empty?
@logger.warn("Given checksum is empty, cannot validate checksum for box")
elsif opts[:checksum_type].to_s.strip.empty?
@logger.warn("Given checksum type is empty, cannot validate checksum for box")
else
env[:ui].detail(I18n.t("vagrant.actions.box.add.checksumming"))
validate_checksum(
opts[:checksum_type], opts[:checksum], box_url)
end
end
# Add the box!
@ -527,22 +533,11 @@ module Vagrant
end
def validate_checksum(checksum_type, checksum, path)
checksum_klass = case checksum_type.to_sym
when :md5
Digest::MD5
when :sha1
Digest::SHA1
when :sha256
Digest::SHA2
else
raise Errors::BoxChecksumInvalidType,
type: checksum_type.to_s
end
@logger.info("Validating checksum with #{checksum_klass}")
@logger.info("Validating checksum with #{checksum_type}")
@logger.info("Expected checksum: #{checksum}")
actual = FileChecksum.new(path, checksum_klass).checksum
actual = FileChecksum.new(path, checksum_type).checksum
@logger.info("Actual checksum: #{actual}")
if actual.casecmp(checksum) != 0
raise Errors::BoxChecksumMismatch,
actual: actual,

View File

@ -40,6 +40,7 @@ module Vagrant
# Have download options specified in the environment override
# options specified for the machine.
download_options = {
automatic_check: !env[:box_outdated_force],
ca_cert: env[:ca_cert] || machine.config.vm.box_download_ca_cert,
ca_path: env[:ca_path] || machine.config.vm.box_download_ca_path,
client_cert: env[:client_cert] ||
@ -50,7 +51,8 @@ module Vagrant
env[:ui].output(I18n.t(
"vagrant.box_outdated_checking_with_refresh",
name: box.name))
name: box.name,
version: box.version))
update = nil
begin
update = box.has_update?(constraints, download_options: download_options)
@ -58,6 +60,9 @@ module Vagrant
env[:ui].warn(I18n.t(
"vagrant.box_outdated_metadata_download_error",
message: e.extra_data[:message]))
rescue Errors::BoxMetadataMalformed => e
@logger.warn(e.to_s)
env[:ui].warn(I18n.t("vagrant.box_malformed_continue_on_update"))
rescue Errors::VagrantError => e
raise if !env[:box_outdated_ignore_errors]
env[:ui].detail(I18n.t(
@ -65,15 +70,23 @@ module Vagrant
message: e.message))
end
env[:box_outdated] = update != nil
if update
local_update = check_outdated_local(env)
if update && (local_update.nil? || (local_update.version < update[1].version))
env[:ui].warn(I18n.t(
"vagrant.box_outdated_single",
name: update[0].name,
provider: box.provider,
current: box.version,
latest: update[1].version))
elsif local_update
env[:ui].warn(I18n.t(
"vagrant.box_outdated_local",
name: local_update.name,
old: box.version,
new: local_update.version))
env[:box_outdated] = true
else
check_outdated_local(env)
env[:box_outdated] = false
end
@app.call(env)
@ -88,19 +101,8 @@ module Vagrant
version ||= ""
version += "> #{machine.box.version}"
box = env[:box_collection].find(
env[:box_collection].find(
machine.box.name, machine.box.provider, version)
if box
env[:ui].warn(I18n.t(
"vagrant.box_outdated_local",
name: box.name,
old: machine.box.version,
new: box.version))
env[:box_outdated] = true
return
end
env[:box_outdated] = false
end
end
end

View File

@ -99,8 +99,11 @@ module Vagrant
b.use Confirm, message, force_key
end
# Keep used boxes, even if "force" is applied
keep_used_boxes = env[:keep_used_boxes]
result = env[:action_runner].run(stack, env)
if !result[:result]
if !result[:result] || keep_used_boxes
# They said "no", so continue with the next box
next
end

View File

@ -12,7 +12,7 @@ module Vagrant
def call(env)
if !env.key?(:config_validate) || env[:config_validate]
errors = env[:machine].config.validate(env[:machine])
errors = env[:machine].config.validate(env[:machine], env[:ignore_provider])
if errors && !errors.empty?
raise Errors::ConfigInvalid,

View File

@ -0,0 +1,39 @@
module Vagrant
module Action
module Builtin
class Disk
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant::action::builtin::disk")
end
def call(env)
machine = env[:machine]
defined_disks = get_disks(machine, env)
# Call into providers machine implementation for disk management
if !defined_disks.empty?
if machine.provider.capability?(:configure_disks)
machine.provider.capability(:configure_disks, defined_disks)
else
env[:ui].warn(I18n.t("vagrant.actions.disk.provider_unsupported",
provider: machine.provider_name))
end
end
# Continue On
@app.call(env)
end
def get_disks(machine, env)
return @_disks if @_disks
@_disks = []
@_disks = machine.config.vm.disks
@_disks
end
end
end
end
end

View File

@ -25,19 +25,114 @@ module Vagrant
# Store in the type map so that --provision-with works properly
@_provisioner_types[result] = provisioner.type
# Set top level provisioner name to provisioner configs name if top level name not set.
# This is mostly for handling the shell provisioner, if a user has set its name like:
#
# config.vm.provision "shell", name: "my_provisioner"
#
# Where `name` is a shell config option, not a top level provisioner class option
#
# Note: `name` is set to a symbol, since it is converted to one via #Config::VM.provision
provisioner_name = provisioner.name
if !provisioner_name
if provisioner.config.respond_to?(:name) &&
provisioner.config.name
provisioner_name = provisioner.config.name.to_sym
end
else
provisioner_name = provisioner_name.to_sym
end
# Build up the options
options = {
name: provisioner.name,
name: provisioner_name,
run: provisioner.run,
before: provisioner.before,
after: provisioner.after,
}
# Return the result
[result, options]
end
@_provisioner_instances = sort_provisioner_instances(@_provisioner_instances)
return @_provisioner_instances.compact
end
private
# Sorts provisioners based on order specified with before/after options
#
# @return [Array<Provisioner, Hash>]
def sort_provisioner_instances(pvs)
final_provs = []
root_provs = []
# extract root provisioners
root_provs = pvs.find_all { |_, o| o[:before].nil? && o[:after].nil? }
if root_provs.size == pvs.size
# no dependencies found
return pvs
end
# ensure placeholder variables are Arrays
dep_provs = []
each_provs = []
all_provs = []
# extract dependency provisioners
dep_provs = pvs.find_all { |_, o| o[:before].is_a?(String) || o[:after].is_a?(String) }
# extract each provisioners
each_provs = pvs.find_all { |_,o| o[:before] == :each || o[:after] == :each }
# extract all provisioners
all_provs = pvs.find_all { |_,o| o[:before] == :all || o[:after] == :all }
# insert provisioners in order
final_provs = root_provs
dep_provs.each do |p,options|
idx = 0
if options[:before]
idx = final_provs.index { |_, o| o[:name].to_s == options[:before] }
final_provs.insert(idx, [p, options])
elsif options[:after]
idx = final_provs.index { |_, o| o[:name].to_s == options[:after] }
idx += 1
final_provs.insert(idx, [p, options])
end
end
# Add :each and :all provisioners in reverse to preserve order in Vagrantfile
tmp_final_provs = []
final_provs.each_with_index do |(prv,o), i|
tmp_before = []
tmp_after = []
each_provs.reverse_each do |p, options|
if options[:before]
tmp_before << [p,options]
elsif options[:after]
tmp_after << [p,options]
end
end
tmp_final_provs += tmp_before unless tmp_before.empty?
tmp_final_provs += [[prv,o]]
tmp_final_provs += tmp_after unless tmp_after.empty?
end
final_provs = tmp_final_provs
# Add all to final array
all_provs.reverse_each do |p,options|
if options[:before]
final_provs.insert(0, [p,options])
elsif options[:after]
final_provs.push([p,options])
end
end
return final_provs
end
# This will return a mapping of a provisioner instance to its
# type.
def provisioner_type_map(env)
@ -47,6 +142,13 @@ module Vagrant
# Return the type map
@_provisioner_types
end
# @private
# Reset the cached values for platform. This is not considered a public
# API and should only be used for testing.
def self.reset!
instance_variables.each(&method(:remove_instance_variable))
end
end
end
end

View File

@ -97,8 +97,14 @@ module Vagrant
end
end
folder_data = JSON.dump(folders)
# Scrub any register credentials from the synced folders
# configuration data to prevent accidental leakage
folder_data = Util::CredentialScrubber.desensitize(folder_data)
machine.data_dir.join("synced_folders").open("w") do |f|
f.write(JSON.dump(folders))
f.write(folder_data)
end
end

View File

@ -36,17 +36,35 @@ module Vagrant
# Get the command and wrap it in a login shell
command = ShellQuote.escape(env[:ssh_run_command], "'")
command = "#{env[:machine].config.ssh.shell} -c '#{command}'"
if env[:machine].config.vm.communicator == :winssh
shell = env[:machine].config.winssh.shell
else
shell = env[:machine].config.ssh.shell
end
if shell == "cmd"
# Add an extra space to the command so cmd.exe quoting works
# properly
command = "#{shell} /C #{command} "
elsif shell == "powershell"
command = "$ProgressPreference = \"SilentlyContinue\"; #{command}"
command = Base64.strict_encode64(command.encode("UTF-16LE", "UTF-8"))
command = "#{shell} -encodedCommand #{command}"
else
command = "#{shell} -c '#{command}'"
end
# Execute!
opts = env[:ssh_opts] || {}
opts[:extra_args] ||= []
# Allow the user to specify a tty or non-tty manually, but if they
# don't then we default to a TTY
# don't then we default to a TTY unless they are using WinSSH
if !opts[:extra_args].include?("-t") &&
!opts[:extra_args].include?("-T") &&
env[:tty]
env[:tty] &&
env[:machine].config.vm.communicator != :winssh
opts[:extra_args] << "-t"
end

View File

@ -80,8 +80,10 @@ module Vagrant
@app.call(env)
@env[:ui].info I18n.t("vagrant.actions.general.package.compressing", fullpath: fullpath)
copy_include_files
setup_private_key
write_metadata_json
compress
end
@ -151,6 +153,22 @@ module Vagrant
end
end
# Write the metadata file into the box so that the provider
# can be automatically detected when adding the box
def write_metadata_json
meta_path = File.join(@env["package.directory"], "metadata.json")
return if File.exist?(meta_path)
if @env[:machine] && @env[:machine].provider_name
provider_name = @env[:machine].provider_name
elsif @env[:env] && @env[:env].default_provider
provider_name = @env[:env].default_provider
else
return
end
File.write(meta_path, {provider: provider_name}.to_json)
end
# This will copy the generated private key into the box and use
# it for SSH by default. We have to do this because we now generate
# random keypairs on boot, so packaged boxes would stop working

View File

@ -2,6 +2,7 @@ require 'log4r'
require 'vagrant/action/hook'
require 'vagrant/util/busy'
require 'vagrant/util/experimental'
module Vagrant
module Action
@ -33,6 +34,19 @@ module Vagrant
environment.merge!(@lazy_globals.call) if @lazy_globals
environment.merge!(options || {})
if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
# NOTE: Triggers are initialized later in the Action::Runer because of
# how `@lazy_globals` are evaluated. Rather than trying to guess where
# the `env` is coming from, we can wait until they're merged into a single
# hash above.
env = environment[:env]
machine = environment[:machine]
machine_name = machine.name if machine
ui = Vagrant::UI::Prefixed.new(env.ui, "vagrant")
triggers = Vagrant::Plugin::V2::Trigger.new(env, env.vagrantfile.config.trigger, machine, ui)
end
# Setup the action hooks
hooks = Vagrant.plugin("2").manager.action_hooks(environment[:action_name])
if !hooks.empty?
@ -52,19 +66,43 @@ module Vagrant
ui = environment[:ui] if environment.key?(:ui)
int_callback = lambda do
if environment[:interrupted]
ui.error I18n.t("vagrant.actions.runner.exit_immediately") if ui
if ui
begin
ui.error I18n.t("vagrant.actions.runner.exit_immediately")
rescue ThreadError
# We're being called in a trap-context. Wrap in a thread.
Thread.new {
ui.error I18n.t("vagrant.actions.runner.exit_immediately")
}.join(THREAD_MAX_JOIN_TIMEOUT)
end
end
abort
end
ui.warn I18n.t("vagrant.actions.runner.waiting_cleanup") if ui && !@@reported_interrupt
if ui && !@@reported_interrupt
begin
ui.warn I18n.t("vagrant.actions.runner.waiting_cleanup")
rescue ThreadError
# We're being called in a trap-context. Wrap in a thread.
Thread.new {
ui.warn I18n.t("vagrant.actions.runner.waiting_cleanup")
}.join(THREAD_MAX_JOIN_TIMEOUT)
end
end
environment[:interrupted] = true
@@reported_interrupt = true
end
action_name = environment[:action_name]
triggers.fire_triggers(action_name, :before, machine_name, :hook) if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
# We place a process lock around every action that is called
@logger.info("Running action: #{environment[:action_name]} #{callable_id}")
Util::Busy.busy(int_callback) { callable.call(environment) }
triggers.fire_triggers(action_name, :after, machine_name, :hook) if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
# Return the environment in case there are things in there that
# the caller wants to use.
environment

View File

@ -1,4 +1,7 @@
require "log4r"
require 'vagrant/util/experimental'
require 'vagrant/action/builtin/before_trigger'
require 'vagrant/action/builtin/after_trigger'
module Vagrant
module Action
@ -16,8 +19,21 @@ module Vagrant
attr_accessor :actions, :stack
def initialize(actions, env)
if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
if env[:trigger_env]
@env = env[:trigger_env]
else
@env = env[:env]
end
machine = env[:machine]
machine_name = machine.name if machine
ui = Vagrant::UI::Prefixed.new(@env.ui, "vagrant")
@triggers = Vagrant::Plugin::V2::Trigger.new(@env, @env.vagrantfile.config.trigger, machine, ui)
end
@stack = []
@actions = actions.map { |m| finalize_action(m, env) }
@actions = actions.map { |m| finalize_action(m, env) }.flatten
@logger = Log4r::Logger.new("vagrant::action::warden")
@last_error = nil
end
@ -31,7 +47,16 @@ module Vagrant
raise Errors::VagrantInterrupt if env[:interrupted]
action = @actions.shift
@logger.info("Calling IN action: #{action}")
if !action.is_a?(Proc) && env[:hook]
hook_name = action.class.name.split("::").last.
gsub(/([a-z])([A-Z])/, '\1_\2').gsub('-', '_').downcase
end
env[:hook].call("before_#{hook_name}".to_sym) if hook_name
@stack.unshift(action).first.call(env)
env[:hook].call("after_#{hook_name}".to_sym) if hook_name
raise Errors::VagrantInterrupt if env[:interrupted]
@logger.info("Calling OUT action: #{action}")
rescue SystemExit
@ -87,7 +112,17 @@ module Vagrant
if klass.is_a?(Class)
# A action klass which is to be instantiated with the
# app, env, and any arguments given
klass.new(self, env, *args, &block)
# We wrap the action class in two Trigger method calls so that
# action triggers can fire before and after each given action in the stack.
klass_name = klass.name
[Vagrant::Action::Builtin::BeforeTriggerAction.new(self, env,
klass_name,
@triggers),
klass.new(self, env, *args, &block),
Vagrant::Action::Builtin::AfterTriggerAction.new(self, env,
klass_name,
@triggers)]
elsif klass.respond_to?(:call)
# Make it a lambda which calls the item then forwards
# up the chain

View File

@ -71,6 +71,10 @@ module Vagrant
thread = Thread.new do
Thread.current[:error] = nil
# Note that this thread is being used for running
# a batch action
Thread.current[:batch_parallel_action] = par
# Record our pid when we started in order to figure out if
# we've forked...
start_pid = Process.pid
@ -160,6 +164,16 @@ module Vagrant
if !errors.empty?
raise Errors::BatchMultiError, message: errors.join("\n\n")
end
# Check if any threads set an exit code and exit if found. If
# multiple threads have exit code values set, the first encountered
# will be the value used.
threads.each do |thread|
if thread[:exit_code]
@logger.debug("Found exit code set within batch action thread. Exiting")
Process.exit!(thread[:exit_code])
end
end
end
end
end

View File

@ -16,6 +16,9 @@ module Vagrant
class Box
include Comparable
# Number of seconds to wait between checks for box updates
BOX_UPDATE_CHECK_INTERVAL = 3600
# The box name. This is the logical name used when adding the box.
#
# @return [String]
@ -154,6 +157,11 @@ module Vagrant
raise Errors::BoxUpdateNoMetadata, name: @name
end
if download_options.delete(:automatic_check) && !automatic_update_check_allowed?
@logger.info("Skipping box update check")
return
end
version += ", " if version
version ||= ""
version += "> #{@version}"
@ -164,6 +172,25 @@ module Vagrant
[md, newer, newer.provider(@provider)]
end
# Check if a box update check is allowed. Uses a file
# in the box data directory to track when the last auto
# update check was performed and returns true if the
# BOX_UPDATE_CHECK_INTERVAL has passed.
#
# @return [Boolean]
def automatic_update_check_allowed?
check_path = directory.join("box_update_check")
if check_path.exist?
last_check_span = Time.now.to_i - check_path.mtime.to_i
if last_check_span < BOX_UPDATE_CHECK_INTERVAL
@logger.info("box update check is under the interval threshold")
return false
end
end
FileUtils.touch(check_path)
true
end
# This repackages this box and outputs it to the given path.
#
# @param [Pathname] path The full path (filename included) of where

View File

@ -116,7 +116,7 @@ module Vagrant
# Extract the box into a temporary directory.
@logger.debug("Unpacking box into temporary directory: #{temp_dir}")
result = Util::Subprocess.execute(
"bsdtar", "-v", "-x", "-m", "-C", temp_dir.to_s, "-f", path.to_s)
"bsdtar", "--no-same-owner", "--no-same-permissions", "-v", "-x", "-m", "-s", "|\\\\\|/|", "-C", temp_dir.to_s, "-f", path.to_s)
if result.exit_code != 0
raise Errors::BoxUnpackageFailure,
output: result.stderr.to_s
@ -233,14 +233,23 @@ module Vagrant
version = versiondir.basename.to_s
versiondir.children(true).each do |provider|
# Ensure version of box is correct before continuing
if !Gem::Version.correct?(version)
ui = Vagrant::UI::Prefixed.new(Vagrant::UI::Colored.new, "vagrant")
ui.warn(I18n.t("vagrant.box_version_malformed",
version: version, box_name: box_name))
@logger.debug("Invalid version #{version} for box #{box_name}")
next
end
# Verify this is a potentially valid box. If it looks
# correct enough then include it.
if provider.directory? && provider.join("metadata.json").file?
provider_name = provider.basename.to_s.to_sym
@logger.debug("Box: #{box_name} (#{provider_name})")
@logger.debug("Box: #{box_name} (#{provider_name}, #{version})")
results << [box_name, version, provider_name]
else
@logger.debug("Invalid box, ignoring: #{provider}")
@logger.debug("Invalid box #{box_name}, ignoring: #{provider}")
end
end
end

View File

@ -68,11 +68,25 @@ module Vagrant
# Returns all the versions supported by this metadata. These
# versions are sorted so the last element of the list is the
# latest version.
# latest version. Optionally filter versions by a matching
# provider.
#
# @return[Array<String>]
def versions
@version_map.keys.sort.map(&:to_s)
def versions(**opts)
provider = nil
provider = opts[:provider].to_sym if opts[:provider]
if provider
@version_map.select do |version, raw|
if raw["providers"]
raw["providers"].detect do |p|
p["name"].to_sym == provider
end
end
end.keys.sort.map(&:to_s)
else
@version_map.keys.sort.map(&:to_s)
end
end
# Represents a single version within the metadata.

View File

@ -24,30 +24,65 @@ module Vagrant
# Default gem repositories
DEFAULT_GEM_SOURCES = [
"https://rubygems.org/".freeze,
HASHICORP_GEMSTORE
HASHICORP_GEMSTORE,
"https://rubygems.org/".freeze
].freeze
def self.instance
@bundler ||= self.new
end
# @return [Pathname] Global plugin path
attr_reader :plugin_gem_path
# @return [Pathname] Vagrant environment specific plugin path
attr_reader :env_plugin_gem_path
def initialize
@plugin_gem_path = Vagrant.user_data_path.join("gems", RUBY_VERSION).freeze
@logger = Log4r::Logger.new("vagrant::bundler")
# TODO: Remove fix when https://github.com/rubygems/rubygems/pull/2735
# gets merged and released
#
# Because of a rubygems bug, we need to set the gemrc file path
# through this method rather than relying on the environment varible
# GEMRC. On windows, that path gets split on `:`: and `;`, which means
# the drive letter gets treated as its own path. If that path exists locally,
# (like having a random folder called `c` where the library was invoked),
# it fails thinking the folder `c` is a gemrc file.
gemrc_val = ENV["GEMRC"]
ENV["GEMRC"] = ""
Gem.configuration = Gem::ConfigFile.new(["--config-file", gemrc_val])
ENV["GEMRC"] = gemrc_val
end
# Enable Vagrant environment specific plugins at given data path
#
# @param [Pathname] Path to Vagrant::Environment data directory
# @return [Pathname] Path to environment specific gem directory
def environment_path=(env_data_path)
@env_plugin_gem_path = env_data_path.join("plugins", "gems", RUBY_VERSION).freeze
end
# Initializes Bundler and the various gem paths so that we can begin
# loading gems. This must only be called once.
# loading gems.
def init!(plugins, repair=false)
if !@initial_specifications
@initial_specifications = Gem::Specification.find_all{true}
else
Gem::Specification.all = @initial_specifications
Gem::Specification.reset
end
# Add HashiCorp RubyGems source
Gem.sources << HASHICORP_GEMSTORE
if !Gem.sources.include?(HASHICORP_GEMSTORE)
sources = [HASHICORP_GEMSTORE] + Gem.sources.sources
Gem.sources.replace(sources)
end
# Generate dependencies for all registered plugins
plugin_deps = plugins.map do |name, info|
Gem::Dependency.new(name, info['gem_version'].to_s.empty? ? '> 0' : info['gem_version'])
Gem::Dependency.new(name, info['installed_gem_version'].to_s.empty? ? '> 0' : info['installed_gem_version'])
end
@logger.debug("Current generated plugin dependency list: #{plugin_deps}")
@ -78,7 +113,7 @@ module Vagrant
# Activate the gems
activate_solution(solution)
full_vagrant_spec_list = Gem::Specification.find_all{true} +
full_vagrant_spec_list = @initial_specifications +
solution.map(&:full_spec)
if(defined?(::Bundler))
@ -91,6 +126,7 @@ module Vagrant
end
Gem::Specification.reset
nil
end
# Removes any temporary files created by init
@ -101,9 +137,10 @@ module Vagrant
# Installs the list of plugins.
#
# @param [Hash] plugins
# @param [Boolean] env_local Environment local plugin install
# @return [Array<Gem::Specification>]
def install(plugins, local=false)
internal_install(plugins, nil, local: local)
def install(plugins, env_local=false)
internal_install(plugins, nil, env_local: env_local)
end
# Installs a local '*.gem' file so that Bundler can find it.
@ -120,7 +157,7 @@ module Vagrant
}
}
@logger.debug("Installing local plugin - #{plugin_info}")
internal_install(plugin_info, {})
internal_install(plugin_info, nil, env_local: opts[:env_local])
plugin_source.spec
end
@ -129,14 +166,14 @@ module Vagrant
# @param [Hash] plugins
# @param [Array<String>] specific Specific plugin names to update. If
# empty or nil, all plugins will be updated.
def update(plugins, specific)
def update(plugins, specific, **opts)
specific ||= []
update = {gems: specific.empty? ? true : specific}
update = opts.merge({gems: specific.empty? ? true : specific})
internal_install(plugins, update)
end
# Clean removes any unused gems.
def clean(plugins)
def clean(plugins, **opts)
@logger.debug("Cleaning Vagrant plugins of stale gems.")
# Generate dependencies for all registered plugins
plugin_deps = plugins.map do |name, info|
@ -163,6 +200,13 @@ module Vagrant
Gem::Specification.load(spec_path)
end
# Include environment specific specification if enabled
if env_plugin_gem_path
plugin_specs += Dir.glob(env_plugin_gem_path.join('specifications/*.gemspec').to_s).map do |spec_path|
Gem::Specification.load(spec_path)
end
end
@logger.debug("Generating current plugin state solution set.")
# Resolve the request set to ensure proper activation order
@ -171,11 +215,27 @@ module Vagrant
solution_full_names = solution_specs.map(&:full_name)
# Find all specs installed to plugins directory that are not
# found within the solution set
# found within the solution set.
plugin_specs.delete_if do |spec|
solution_full_names.include?(spec.full_name)
end
if env_plugin_gem_path
# If we are cleaning locally, remove any global specs. If
# not, remove any local specs
if opts[:env_local]
@logger.debug("Removing specifications that are not environment local")
plugin_specs.delete_if do |spec|
spec.full_gem_path.to_s.include?(plugin_gem_path.realpath.to_s)
end
else
@logger.debug("Removing specifications that are environment local")
plugin_specs.delete_if do |spec|
spec.full_gem_path.to_s.include?(env_plugin_gem_path.realpath.to_s)
end
end
end
@logger.debug("Specifications to be removed - #{plugin_specs.map(&:full_name)}")
# Now delete all unused specs
@ -242,13 +302,19 @@ module Vagrant
end
source_list[name] << source
end
Gem::Dependency.new(name, gem_version)
Gem::Dependency.new(name, *gem_version.split(","))
end
if Vagrant.strict_dependency_enforcement
@logger.debug("Enabling strict dependency enforcement")
plugin_deps += vagrant_internal_specs.map do |spec|
next if system_plugins.include?(spec.name)
# If we are not running within the installer and
# we are not within a bundler environment then we
# only want activated specs
if !Vagrant.in_installer? && !Vagrant.in_bundler?
next if !spec.activated?
end
Gem::Dependency.new(spec.name, spec.version)
end.compact
else
@ -303,28 +369,61 @@ module Vagrant
solution = request_set.resolve(installer_set)
activate_solution(solution)
# Remove gems which are already installed
request_set.sorted_requests.delete_if do |activation_req|
rs_spec = activation_req.spec
if vagrant_internal_specs.detect{|ispec| ispec.name == rs_spec.name && ispec.version == rs_spec.version }
@logger.debug("Removing activation request from install. Already installed. (#{rs_spec.spec.full_name})")
true
end
end
@logger.debug("Installing required gems.")
# Install all remote gems into plugin path. Set the installer to ignore dependencies
# as we know the dependencies are satisfied and it will attempt to validate a gem's
# dependencies are satisfied by gems in the install directory (which will likely not
# be true)
result = request_set.install_into(plugin_gem_path.to_s, true,
install_path = extra[:env_local] ? env_plugin_gem_path : plugin_gem_path
result = request_set.install_into(install_path.to_s, true,
ignore_dependencies: true,
prerelease: Vagrant.prerelease?,
wrappers: true
)
result = result.map(&:full_spec)
result.each do |spec|
existing_paths = $LOAD_PATH.find_all{|s| s.include?(spec.full_name) }
if !existing_paths.empty?
@logger.debug("Removing existing LOAD_PATHs for #{spec.full_name} - " +
existing_paths.join(", "))
existing_paths.each{|s| $LOAD_PATH.delete(s) }
end
spec.full_require_paths.each do |r_path|
if !$LOAD_PATH.include?(r_path)
@logger.debug("Adding path to LOAD_PATH - #{r_path}")
$LOAD_PATH.unshift(r_path)
end
end
end
result
end
# Generate the composite resolver set totally all of vagrant (builtin + plugin set)
def generate_vagrant_set
Gem::Resolver.compose_sets(generate_builtin_set, generate_plugin_set)
sets = [generate_builtin_set, generate_plugin_set]
if env_plugin_gem_path && env_plugin_gem_path.exist?
sets << generate_plugin_set(env_plugin_gem_path)
end
Gem::Resolver.compose_sets(*sets)
end
# @return [Array<[Gem::Specification, String]>] spec and directory pairs
# @return [Array<[Gem::Specification]>] spec list
def vagrant_internal_specs
# activate any dependencies up front so we can always
# pin them when resolving
Gem::Specification.find { |s| s.name == "vagrant" && s.activated? }.
runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list }
# discover all the gems we have available
list = {}
directories = [Gem::Specification.default_specifications_dir]
Gem::Specification.find_all{true}.each do |spec|
@ -378,10 +477,16 @@ module Vagrant
# Generate the plugin resolver set. Optionally provide specification names (short or
# full) that should be ignored
def generate_plugin_set(skip=[])
#
# @param [Pathname] path to plugins
# @param [Array<String>] gems to skip
# @return [PluginSet]
def generate_plugin_set(*args)
plugin_path = args.detect{|i| i.is_a?(Pathname) } || plugin_gem_path
skip = args.detect{|i| i.is_a?(Array) } || []
plugin_set = PluginSet.new
@logger.debug("Generating new plugin set instance. Skip gems - #{skip}")
Dir.glob(plugin_gem_path.join('specifications/*.gemspec').to_s).each do |spec_path|
Dir.glob(plugin_path.join('specifications/*.gemspec').to_s).each do |spec_path|
spec = Gem::Specification.load(spec_path)
desired_spec_path = File.join(spec.gem_dir, "#{spec.name}.gemspec")
# Vendor set requires the spec to be within the gem directory. Some gems will package their

View File

@ -1,6 +1,8 @@
require 'log4r'
require 'optparse'
require 'vagrant/util/experimental'
module Vagrant
# Manages the command line interface to Vagrant.
class CLI < Vagrant.plugin("2", :command)
@ -11,6 +13,11 @@ module Vagrant
@logger = Log4r::Logger.new("vagrant::cli")
@main_args, @sub_command, @sub_args = split_main_and_subcommand(argv)
if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
ui = Vagrant::UI::Prefixed.new(env.ui, "vagrant")
@triggers = Vagrant::Plugin::V2::Trigger.new(env, env.vagrantfile.config.trigger, nil, ui)
end
Util::CheckpointClient.instance.setup(env).check
@logger.info("CLI: #{@main_args.inspect} #{@sub_command.inspect} #{@sub_args.inspect}")
end
@ -23,6 +30,10 @@ module Vagrant
return 0
end
if @sub_command == "login"
$stderr.puts "WARNING: This command has been deprecated and aliased to `vagrant cloud auth login`"
end
# If we reached this far then we must have a subcommand. If not,
# then we also just print the help and exit.
command_plugin = nil
@ -51,7 +62,9 @@ module Vagrant
# Initialize and execute the command class, returning the exit status.
result = 0
begin
@triggers.fire_triggers(@sub_command.to_sym, :before, nil, :command) if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
result = command_class.new(@sub_args, @env).execute
@triggers.fire_triggers(@sub_command.to_sym, :after, nil, :command) if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
rescue Interrupt
@env.ui.info(I18n.t("vagrant.cli_interrupt"))
result = 1

View File

@ -129,7 +129,7 @@ module Vagrant
path = "(unknown)"
if e.backtrace && e.backtrace[0]
backtrace_tokens = e.backtrace[0].split(":")
path = backtrace_tokens[0]
path = e.backtrace.first.slice(0, e.backtrace.first.rindex(':')).rpartition(':').first
backtrace_tokens.each do |part|
if part =~ /\d+/
line = part.to_i

View File

@ -60,14 +60,18 @@ module Vagrant
#
# @param [Environment] env
# @return [Hash]
def validate(machine)
def validate(machine, ignore_provider=nil)
# Go through each of the configuration keys and validate
errors = {}
@keys.each do |_key, instance|
if instance.respond_to?(:validate)
# Validate this single item, and if we have errors then
# we merge them into our total errors list.
result = instance.validate(machine)
if _key == :vm
result = instance.validate(machine, ignore_provider)
else
result = instance.validate(machine)
end
if result && !result.empty?
errors = Util.merge_errors(errors, result)
end

View File

@ -8,6 +8,7 @@ require 'log4r'
require 'vagrant/util/file_mode'
require 'vagrant/util/platform'
require 'vagrant/util/hash_with_indifferent_access'
require "vagrant/util/silence_warnings"
require "vagrant/vagrantfile"
require "vagrant/version"
@ -146,6 +147,7 @@ module Vagrant
if opts[:local_data_path]
@local_data_path = Pathname.new(File.expand_path(opts[:local_data_path], @cwd))
end
@logger.debug("Effective local data path: #{@local_data_path}")
# If we have a root path, load the ".vagrantplugins" file.
@ -163,6 +165,18 @@ module Vagrant
@default_private_key_path = @home_path.join("insecure_private_key")
copy_insecure_private_key
# Initialize localized plugins
plugins = Vagrant::Plugin::Manager.instance.localize!(self)
# Load any environment local plugins
Vagrant::Plugin::Manager.instance.load_plugins(plugins)
# Initialize globalize plugins
plugins = Vagrant::Plugin::Manager.instance.globalize!
# Load any global plugins
Vagrant::Plugin::Manager.instance.load_plugins(plugins)
plugins = process_configured_plugins
# Call the hooks that does not require configurations to be loaded
# by using a "clean" action runner
hook(:environment_plugins_loaded, runner: Action::Runner.new(env: self))
@ -194,7 +208,8 @@ module Vagrant
home_path: home_path,
root_path: root_path,
tmp_path: tmp_path,
ui: @ui
ui: @ui,
env: self
}
end
end
@ -319,7 +334,7 @@ module Vagrant
# then look there.
root_config = vagrantfile.config
if opts[:machine]
machine_info = vagrantfile.machine_config(opts[:machine], nil, nil)
machine_info = vagrantfile.machine_config(opts[:machine], nil, nil, nil)
root_config = machine_info[:config]
end
@ -890,6 +905,13 @@ module Vagrant
begin
@logger.debug("Creating: #{@local_data_path}")
FileUtils.mkdir_p(@local_data_path)
# Create the rgloader/loader file so we can use encoded files.
loader_file = @local_data_path.join("rgloader", "loader.rb")
if !loader_file.file?
source_loader = Vagrant.source_root.join("templates/rgloader.rb")
FileUtils.mkdir_p(@local_data_path.join("rgloader").to_s)
FileUtils.cp(source_loader.to_s, loader_file.to_s)
end
rescue Errno::EACCES
raise Errors::LocalDataDirectoryNotAccessible,
local_data_path: @local_data_path.to_s
@ -898,6 +920,114 @@ module Vagrant
protected
# Attempt to guess the configured provider in use. Will fallback
# to the default provider if an explicit provider name is not
# provided. This can be pretty error prone, but is used during
# initial environment setup to allow loading plugins so it doesn't
# need to be perfect
#
# @return [String]
def guess_provider
gp = nil
ARGV.each_with_index do |val, idx|
if val.start_with?("--provider=")
gp = val.split("=", 2).last
break
elsif val == "--provider"
gp = ARGV[idx+1]
break
end
end
return gp.to_sym if gp
begin
default_provider
rescue Errors::NoDefaultProvider
# if a provider cannot be determined just return nil
nil
end
end
# Load any configuration provided by guests defined within
# the Vagrantfile to pull plugin information they may have
# defined.
def find_configured_plugins
plugins = []
provider = guess_provider
vagrantfile.machine_names.each do |mname|
ldp = @local_data_path.join("machines/#{mname}/#{provider}") if @local_data_path
plugins << vagrantfile.machine_config(mname, guess_provider, boxes, ldp, false)[:config]
end
result = plugins.reverse.inject(Vagrant::Util::HashWithIndifferentAccess.new) do |memo, val|
Vagrant::Util::DeepMerge.deep_merge(memo, val.vagrant.plugins)
end
Vagrant::Util::DeepMerge.deep_merge(result, vagrantfile.config.vagrant.plugins)
end
# Check for any local plugins defined within the Vagrantfile. If
# found, validate they are available. If they are not available,
# request to install them, or raise an exception
#
# @return [Hash] plugin list for loading
def process_configured_plugins
return if !Vagrant.plugins_enabled?
errors = vagrantfile.config.vagrant.validate(nil)
if !errors["vagrant"].empty?
raise Errors::ConfigInvalid,
errors: Util::TemplateRenderer.render(
"config/validation_failed",
errors: errors)
end
# Check if defined plugins are installed
installed = Plugin::Manager.instance.installed_plugins
needs_install = []
config_plugins = find_configured_plugins
config_plugins.each do |name, info|
if !installed[name]
needs_install << name
end
end
if !needs_install.empty?
ui.warn(I18n.t("vagrant.plugins.local.uninstalled_plugins",
plugins: needs_install.sort.join(", ")))
if !Vagrant.auto_install_local_plugins?
answer = nil
until ["y", "n"].include?(answer)
answer = ui.ask(I18n.t("vagrant.plugins.local.request_plugin_install") + " [N]: ")
answer = answer.strip.downcase
answer = "n" if answer.to_s.empty?
end
if answer == "n"
raise Errors::PluginMissingLocalError,
plugins: needs_install.sort.join(", ")
end
end
needs_install.each do |name|
pconfig = Util::HashWithIndifferentAccess.new(config_plugins[name])
ui.info(I18n.t("vagrant.commands.plugin.installing", name: name))
options = {sources: Vagrant::Bundler::DEFAULT_GEM_SOURCES.dup, env_local: true}
options[:sources] = pconfig[:sources] if pconfig[:sources]
options[:require] = pconfig[:entry_point] if pconfig[:entry_point]
options[:version] = pconfig[:version] if pconfig[:version]
spec = Plugin::Manager.instance.install_plugin(name, options)
ui.info(I18n.t("vagrant.commands.plugin.installed",
name: spec.name, version: spec.version.to_s))
end
ui.info("\n")
# Force halt after installation and require command to be run again. This
# will proper load any new locally installed plugins which are now available.
ui.warn(I18n.t("vagrant.plugins.local.install_rerun_command"))
exit(-1)
end
if Vagrant::Plugin::Manager.instance.local_file
Vagrant::Plugin::Manager.instance.local_file.installed_plugins
else
{}
end
end
# This method copies the private key into the home directory if it
# doesn't already exist.
#

View File

@ -160,6 +160,10 @@ module Vagrant
error_key(:box_config_changing_box)
end
class BoxFileNotExist < VagrantError
error_key(:box_file_not_exist)
end
class BoxMetadataCorrupted < VagrantError
error_key(:box_metadata_corrupted)
end
@ -300,6 +304,10 @@ module Vagrant
error_key(:command_deprecated)
end
class CommandSuspendAllArgs < VagrantError
error_key(:command_suspend_all_arguments)
end
class CommandUnavailable < VagrantError
error_key(:command_unavailable)
end
@ -428,6 +436,10 @@ module Vagrant
error_key(:machine_action_locked)
end
class MachineFolderNotAccessible < VagrantError
error_key(:machine_folder_not_accessible)
end
class MachineGuestNotReady < VagrantError
error_key(:machine_guest_not_ready)
end
@ -580,6 +592,10 @@ module Vagrant
error_key(:provider_not_found)
end
class ProviderNotFoundSuggestion < VagrantError
error_key(:provider_not_found_suggestion)
end
class ProviderNotUsable < VagrantError
error_key(:provider_not_usable)
end
@ -632,6 +648,14 @@ module Vagrant
error_key(:plugin_source_error)
end
class PluginNoLocalError < VagrantError
error_key(:plugin_no_local_error)
end
class PluginMissingLocalError < VagrantError
error_key(:plugin_missing_local_error)
end
class PushesNotDefined < VagrantError
error_key(:pushes_not_defined)
end
@ -648,6 +672,10 @@ module Vagrant
error_key(:push_strategy_not_provided)
end
class RSyncPostCommandError < VagrantError
error_key(:rsync_post_command_error)
end
class RSyncError < VagrantError
error_key(:rsync_error)
end
@ -776,6 +804,26 @@ module Vagrant
error_key(:synced_folder_unusable)
end
class TriggersBadExitCodes < VagrantError
error_key(:triggers_bad_exit_codes)
end
class TriggersGuestNotExist < VagrantError
error_key(:triggers_guest_not_exist)
end
class TriggersGuestNotRunning < VagrantError
error_key(:triggers_guest_not_running)
end
class TriggersNoBlockGiven < VagrantError
error_key(:triggers_no_block_given)
end
class TriggersNoStageGiven < VagrantError
error_key(:triggers_no_stage_given)
end
class UIExpectsTTY < VagrantError
error_key(:ui_expects_tty)
end
@ -784,6 +832,30 @@ module Vagrant
error_key(:unimplemented_provider_action)
end
class UploadInvalidCompressionType < VagrantError
error_key(:upload_invalid_compression_type)
end
class UploadMissingExtractCapability < VagrantError
error_key(:upload_missing_extract_capability)
end
class UploadMissingTempCapability < VagrantError
error_key(:upload_missing_temp_capability)
end
class UploadSourceMissing < VagrantError
error_key(:upload_source_missing)
end
class UploaderError < VagrantError
error_key(:uploader_error)
end
class UploaderInterrupted < UploaderError
error_key(:uploader_interrupted)
end
class VagrantInterrupt < VagrantError
error_key(:interrupted)
end
@ -828,10 +900,6 @@ module Vagrant
error_key(:vboxmanage_not_found_error)
end
class VBoxManageNotFoundWSLError < VagrantError
error_key(:vboxmanage_not_found_wsl_error)
end
class VirtualBoxBrokenVersion040214 < VagrantError
error_key(:virtualbox_broken_version_040214)
end
@ -940,6 +1008,10 @@ module Vagrant
error_key(:power_off, "vagrant.actions.vm.export")
end
class WinRMInvalidCommunicator < VagrantError
error_key(:winrm_invalid_communicator)
end
class WSLVagrantVersionMismatch < VagrantError
error_key(:wsl_vagrant_version_mismatch)
end

View File

@ -110,6 +110,7 @@ module Vagrant
@ui = Vagrant::UI::Prefixed.new(@env.ui, @name)
@ui_mutex = Mutex.new
@state_mutex = Mutex.new
@triggers = Vagrant::Plugin::V2::Trigger.new(@env, @config.trigger, self, @ui)
# Read the ID, which is usually in local storage
@id = nil
@ -159,6 +160,8 @@ module Vagrant
# as extra data set on the environment hash for the middleware
# runner.
def action(name, opts=nil)
@triggers.fire_triggers(name, :before, @name.to_s, :action)
@logger.info("Calling action: #{name} on provider #{@provider}")
opts ||= {}
@ -169,6 +172,10 @@ module Vagrant
# Extra env keys are the remaining opts
extra_env = opts.dup
# An environment is required for triggers to function properly. This is
# passed in specifically for the `#Action::Warden` class triggers. We call it
# `:trigger_env` instead of `env` in case it collides with an existing environment
extra_env[:trigger_env] = @env
check_cwd # Warns the UI if the machine was last used on a different dir
@ -185,7 +192,7 @@ module Vagrant
locker = @env.method(:lock) if lock && !name.to_s.start_with?("ssh")
# Lock this machine for the duration of this action
locker.call("machine-action-#{id}") do
return_env = locker.call("machine-action-#{id}") do
# Get the callable from the provider.
callable = @provider.action(name)
@ -203,6 +210,10 @@ module Vagrant
ui.machine("action", name.to_s, "end")
action_result
end
@triggers.fire_triggers(name, :after, @name.to_s, :action)
# preserve returning environment after machine action runs
return return_env
rescue Errors::EnvironmentLockedError
raise Errors::MachineActionLockedError,
action: name,
@ -388,7 +399,10 @@ module Vagrant
# Read the id file from the data directory if it exists as the
# ID for the pre-existing physical representation of this machine.
id_file = @data_dir.join("id")
@id = id_file.read.chomp if id_file.file?
id_content = id_file.read.strip if id_file.file?
if !id_content.to_s.empty?
@id = id_content
end
end
if @id != old_id && @provider
@ -440,9 +454,11 @@ module Vagrant
info[:keys_only] ||= @config.ssh.default.keys_only
info[:verify_host_key] ||= @config.ssh.default.verify_host_key
info[:username] ||= @config.ssh.default.username
info[:remote_user] ||= @config.ssh.default.remote_user
info[:compression] ||= @config.ssh.default.compression
info[:dsa_authentication] ||= @config.ssh.default.dsa_authentication
info[:extra_args] ||= @config.ssh.default.extra_args
info[:config] ||= @config.ssh.default.config
# We set overrides if they are set. These take precedence over
# provider-returned data.
@ -454,7 +470,9 @@ module Vagrant
info[:dsa_authentication] = @config.ssh.dsa_authentication
info[:username] = @config.ssh.username if @config.ssh.username
info[:password] = @config.ssh.password if @config.ssh.password
info[:remote_user] = @config.ssh.remote_user if @config.ssh.remote_user
info[:extra_args] = @config.ssh.extra_args if @config.ssh.extra_args
info[:config] = @config.ssh.config if @config.ssh.config
# We also set some fields that are purely controlled by Vagrant
info[:forward_agent] = @config.ssh.forward_agent
@ -581,7 +599,7 @@ module Vagrant
).chomp
end
if vagrant_cwd != @env.root_path.to_s
if !File.identical?(vagrant_cwd.to_s, @env.root_path.to_s)
if vagrant_cwd
ui.warn(I18n.t(
'vagrant.moved_cwd',

View File

@ -27,13 +27,86 @@ module Vagrant
@instance ||= self.new(user_plugins_file)
end
attr_reader :user_file
attr_reader :system_file
attr_reader :local_file
# @param [Pathname] user_file
def initialize(user_file)
@logger = Log4r::Logger.new("vagrant::plugin::manager")
@user_file = StateFile.new(user_file)
system_path = self.class.system_plugins_file
@system_file = nil
@system_file = StateFile.new(system_path) if system_path && system_path.file?
@local_file = nil
@globalized = @localized = false
end
# Enable global plugins
#
# @return [Hash] list of plugins
def globalize!
@globalized = true
@logger.debug("Enabling globalized plugins")
plugins = installed_plugins
bundler_init(plugins)
plugins
end
# Enable environment local plugins
#
# @param [Environment] env Vagrant environment
# @return [Hash, nil] list of plugins
def localize!(env)
@localized = true
if env.local_data_path
@logger.debug("Enabling localized plugins")
@local_file = StateFile.new(env.local_data_path.join("plugins.json"))
Vagrant::Bundler.instance.environment_path = env.local_data_path
plugins = local_file.installed_plugins
bundler_init(plugins)
plugins
end
end
# @return [Boolean] local and global plugins are loaded
def ready?
@globalized && @localized
end
# Initialize bundler with given plugins
#
# @param [Hash] plugins List of plugins
# @return [nil]
def bundler_init(plugins)
if !Vagrant.plugins_init?
@logger.warn("Plugin initialization is disabled")
return nil
end
@logger.info("Plugins:")
plugins.each do |plugin_name, plugin_info|
installed_version = plugin_info["installed_gem_version"]
version_constraint = plugin_info["gem_version"]
installed_version = 'undefined' if installed_version.to_s.empty?
version_constraint = '> 0' if version_constraint.to_s.empty?
@logger.info(
" - #{plugin_name} = [installed: " \
"#{installed_version} constraint: " \
"#{version_constraint}]"
)
end
begin
Vagrant::Bundler.instance.init!(plugins)
rescue StandardError, ScriptError => err
@logger.error("Plugin initialization error - #{err.class}: #{err}")
err.backtrace.each do |backtrace_line|
@logger.debug(backtrace_line)
end
raise Vagrant::Errors::PluginInitError, message: err.to_s
end
end
# Installs another plugin into our gem directory.
@ -41,7 +114,10 @@ module Vagrant
# @param [String] name Name of the plugin (gem)
# @return [Gem::Specification]
def install_plugin(name, **opts)
local = false
if opts[:env_local] && @local_file.nil?
raise Errors::PluginNoLocalError
end
if name =~ /\.gem$/
# If this is a gem file, then we install that gem locally.
local_spec = Vagrant::Bundler.instance.install_local(name, opts)
@ -59,7 +135,7 @@ module Vagrant
if local_spec.nil?
result = nil
install_lambda = lambda do
Vagrant::Bundler.instance.install(plugins, local).each do |spec|
Vagrant::Bundler.instance.install(plugins, opts[:env_local]).each do |spec|
next if spec.name != name
next if result && result.version >= spec.version
result = spec
@ -75,18 +151,20 @@ module Vagrant
result = local_spec
end
# Add the plugin to the state file
@user_file.add_plugin(
plugin_file = opts[:env_local] ? @local_file : @user_file
plugin_file.add_plugin(
result.name,
version: opts[:version],
require: opts[:require],
sources: opts[:sources],
env_local: !!opts[:env_local],
installed_gem_version: result.version.to_s
)
# After install clean plugin gems to remove any cruft. This is useful
# for removing outdated dependencies or other versions of an installed
# plugin if the plugin is upgraded/downgraded
Vagrant::Bundler.instance.clean(installed_plugins)
Vagrant::Bundler.instance.clean(installed_plugins, local: !!opts[:local])
result
rescue Gem::GemNotFoundException
raise Errors::PluginGemNotFound, name: name
@ -97,7 +175,7 @@ module Vagrant
# Uninstalls the plugin with the given name.
#
# @param [String] name
def uninstall_plugin(name)
def uninstall_plugin(name, **opts)
if @system_file
if !@user_file.has_plugin?(name) && @system_file.has_plugin?(name)
raise Errors::PluginUninstallSystem,
@ -105,7 +183,18 @@ module Vagrant
end
end
@user_file.remove_plugin(name)
if opts[:env_local] && @local_file.nil?
raise Errors::PluginNoLocalError
end
plugin_file = opts[:env_local] ? @local_file : @user_file
if !plugin_file.has_plugin?(name)
raise Errors::PluginNotInstalled,
name: name
end
plugin_file.remove_plugin(name)
# Clean the environment, removing any old plugins
Vagrant::Bundler.instance.clean(installed_plugins)
@ -114,9 +203,15 @@ module Vagrant
end
# Updates all or a specific set of plugins.
def update_plugins(specific)
result = Vagrant::Bundler.instance.update(installed_plugins, specific)
installed_plugins.each do |name, info|
def update_plugins(specific, **opts)
if opts[:env_local] && @local_file.nil?
raise Errors::PluginNoLocalError
end
plugin_file = opts[:env_local] ? @local_file : @user_file
result = Vagrant::Bundler.instance.update(plugin_file.installed_plugins, specific)
plugin_file.installed_plugins.each do |name, info|
matching_spec = result.detect{|s| s.name == name}
info = Hash[
info.map do |key, value|
@ -124,7 +219,7 @@ module Vagrant
end
]
if matching_spec
@user_file.add_plugin(name, **info.merge(
plugin_file.add_plugin(name, **info.merge(
version: "> 0",
installed_gem_version: matching_spec.version.to_s
))
@ -148,6 +243,11 @@ module Vagrant
end
plugin_list = Util::DeepMerge.deep_merge(system, @user_file.installed_plugins)
if @local_file
plugin_list = Util::DeepMerge.deep_merge(plugin_list,
@local_file.installed_plugins)
end
# Sort plugins by name
Hash[
plugin_list.map{|plugin_name, plugin_info|
@ -191,6 +291,84 @@ module Vagrant
installed_map.values
end
# Loads the requested plugins into the Vagrant runtime
#
# @param [Hash] plugins List of plugins to load
# @return [nil]
def load_plugins(plugins)
if !Vagrant.plugins_enabled?
@logger.warn("Plugin loading is disabled")
return
end
if plugins.nil?
@logger.debug("No plugins provided for loading")
return
end
begin
@logger.info("Loading plugins...")
plugins.each do |plugin_name, plugin_info|
if plugin_info["require"].to_s.empty?
begin
@logger.info("Loading plugin `#{plugin_name}` with default require: `#{plugin_name}`")
require plugin_name
rescue LoadError => err
if plugin_name.include?("-")
plugin_slash = plugin_name.gsub("-", "/")
@logger.error("Failed to load plugin `#{plugin_name}` with default require. - #{err.class}: #{err}")
@logger.info("Loading plugin `#{plugin_name}` with slash require: `#{plugin_slash}`")
require plugin_slash
else
raise
end
end
else
@logger.debug("Loading plugin `#{plugin_name}` with custom require: `#{plugin_info["require"]}`")
require plugin_info["require"]
end
@logger.debug("Successfully loaded plugin `#{plugin_name}`.")
end
if defined?(::Bundler)
@logger.debug("Bundler detected in use. Loading `:plugins` group.")
::Bundler.require(:plugins)
end
rescue ScriptError, StandardError => err
@logger.error("Plugin loading error: #{err.class} - #{err}")
err.backtrace.each do |backtrace_line|
@logger.debug(backtrace_line)
end
raise Vagrant::Errors::PluginLoadError, message: err.to_s
end
nil
end
# Check if the requested plugin is installed
#
# @param [String] name Name of plugin
# @param [String] version Specific version of the plugin
# @return [Boolean]
def plugin_installed?(name, version=nil)
# Make the requirement object
version = Gem::Requirement.new([version.to_s]) if version
# If plugins are loaded, check for match in loaded specs
if ready?
return installed_specs.any? do |s|
match = s.name == name
next match if !version
next match && version.satisfied_by?(s.version)
end
end
# Plugins are not loaded yet so check installed plugin data
plugin_info = installed_plugins[name]
return false if !plugin_info
return !!plugin_info if version.nil? || plugin_info["installed_gem_version"].nil?
installed_version = Gem::Version.new(plugin_info["installed_gem_version"])
version.satisfied_by?(installed_version)
end
end
end
end

View File

@ -7,6 +7,10 @@ module Vagrant
# This is a helper to deal with the plugin state file that Vagrant
# uses to track what plugins are installed and activated and such.
class StateFile
# @return [Pathname] path to file
attr_reader :path
def initialize(path)
@path = path
@ -36,7 +40,8 @@ module Vagrant
"gem_version" => opts[:version] || "",
"require" => opts[:require] || "",
"sources" => opts[:sources] || [],
"installed_gem_version" => opts[:installed_gem_version]
"installed_gem_version" => opts[:installed_gem_version],
"env_local" => !!opts[:env_local]
}
save!

View File

@ -19,6 +19,7 @@ module Vagrant
autoload :Push, "vagrant/plugin/v2/push"
autoload :Provisioner, "vagrant/plugin/v2/provisioner"
autoload :SyncedFolder, "vagrant/plugin/v2/synced_folder"
autoload :Trigger, "vagrant/plugin/v2/trigger"
end
end
end

View File

@ -45,7 +45,7 @@ module Vagrant
def parse_options(opts=nil)
# make sure optparse doesn't use POSIXLY_CORRECT parsing
ENV["POSIXLY_CORRECT"] = nil
# Creating a shallow copy of the arguments so the OptionParser
# doesn't destroy the originals.
argv = @argv.dup

View File

@ -117,6 +117,13 @@ module Vagrant
# @see #execute
def test(command, opts=nil)
end
# Reset the communicator. For communicators which establish
# a persistent connection to the remote machine, this connection
# should be terminated and re-established. The communicator
# instance should be in a "fresh" state after calling this method.
def reset!
end
end
end
end

View File

@ -0,0 +1,325 @@
require 'fileutils'
require 'log4r'
require 'shellwords'
require Vagrant.source_root.join("plugins/provisioners/shell/provisioner")
require "vagrant/util/subprocess"
require "vagrant/util/platform"
require "vagrant/util/powershell"
module Vagrant
module Plugin
module V2
class Trigger
# @return [Kernel_V2::Config::Trigger]
attr_reader :config
# This class is responsible for setting up basic triggers that were
# defined inside a Vagrantfile.
#
# @param [Vagrant::Environment] env Vagrant environment
# @param [Kernel_V2::TriggerConfig] config Trigger configuration
# @param [Vagrant::Machine] machine Active Machine
# @param [Vagrant::UI] ui Class for printing messages to user
def initialize(env, config, machine, ui)
@env = env
@config = config
@machine = machine
@ui = ui
@logger = Log4r::Logger.new("vagrant::trigger::#{self.class.to_s.downcase}")
end
# Fires all triggers, if any are defined for the action and guest. Returns early
# and logs a warning if the community plugin `vagrant-triggers` is installed
#
# @param [Symbol] action Vagrant command to fire trigger on
# @param [Symbol] stage :before or :after
# @param [String] guest_name The guest that invoked firing the triggers
def fire_triggers(action, stage, guest_name, type)
if community_plugin_detected?
@logger.warn("Community plugin `vagrant-triggers detected, so core triggers will not fire")
return
end
if !action
@logger.warn("Action given is nil, no triggers will fire")
return
else
action = action.to_sym
end
# get all triggers matching action
triggers = []
if stage == :before
triggers = config.before_triggers.select do |t|
t.command == action || (t.command == :all && !t.ignore.include?(action))
end
elsif stage == :after
triggers = config.after_triggers.select do |t|
t.command == action || (t.command == :all && !t.ignore.include?(action))
end
else
raise Errors::TriggersNoStageGiven,
action: action,
stage: stage,
guest_name: guest_name
end
triggers = filter_triggers(triggers, guest_name, type)
if !triggers.empty?
@logger.info("Firing trigger for action #{action} on guest #{guest_name}")
@ui.info(I18n.t("vagrant.trigger.start", type: type, stage: stage, action: action))
fire(triggers, guest_name)
end
end
protected
#-------------------------------------------------------------------
# Internal methods, don't call these.
#-------------------------------------------------------------------
# Looks up if the community plugin `vagrant-triggers` is installed
# and also caches the result
#
# @return [Boolean]
def community_plugin_detected?
if !defined?(@_triggers_enabled)
plugins = Vagrant::Plugin::Manager.instance.installed_plugins
@_triggers_enabled = plugins.keys.include?("vagrant-triggers")
end
@_triggers_enabled
end
# Filters triggers to be fired based on configured restraints
#
# @param [Array] triggers An array of triggers to be filtered
# @param [String] guest_name The name of the current guest
# @param [Symbol] type The type of trigger (:command or :type)
# @return [Array] The filtered array of triggers
def filter_triggers(triggers, guest_name, type)
# look for only_on trigger constraint and if it doesn't match guest
# name, throw it away also be sure to preserve order
filter = triggers.dup
filter.each do |trigger|
index = nil
match = false
if trigger.only_on
trigger.only_on.each do |o|
if o.match(guest_name.to_s)
# trigger matches on current guest, so we're fine to use it
match = true
break
end
end
# no matches found, so don't use trigger for guest
index = triggers.index(trigger) unless match == true
end
if trigger.type != type
index = triggers.index(trigger)
end
if index
@logger.debug("Trigger #{trigger.id} will be ignored for #{guest_name}")
triggers.delete_at(index)
end
end
return triggers
end
# Fires off all triggers in the given array
#
# @param [Array] triggers An array of triggers to be fired
def fire(triggers, guest_name)
# ensure on_error is respected by exiting or continuing
triggers.each do |trigger|
@logger.debug("Running trigger #{trigger.id}...")
if trigger.name
@ui.info(I18n.t("vagrant.trigger.fire_with_name",
name: trigger.name))
else
@ui.info(I18n.t("vagrant.trigger.fire"))
end
if trigger.info
info(trigger.info)
end
if trigger.warn
warn(trigger.warn)
end
if trigger.abort
trigger_abort(trigger.abort)
end
if trigger.run
run(trigger.run, trigger.on_error, trigger.exit_codes)
end
if trigger.run_remote
run_remote(trigger.run_remote, trigger.on_error, trigger.exit_codes)
end
if trigger.ruby_block
execute_ruby(trigger.ruby_block)
end
end
end
# Prints the given message at info level for a trigger
#
# @param [String] message The string to be printed
def info(message)
@ui.info(message)
end
# Prints the given message at warn level for a trigger
#
# @param [String] message The string to be printed
def warn(message)
@ui.warn(message)
end
# Runs a script on a guest
#
# @param [Provisioners::Shell::Config] config A Shell provisioner config
def run(config, on_error, exit_codes)
if config.inline
if Vagrant::Util::Platform.windows?
cmd = config.inline
else
cmd = Shellwords.split(config.inline)
end
@ui.detail(I18n.t("vagrant.trigger.run.inline", command: config.inline))
else
cmd = File.expand_path(config.path, @env.root_path).shellescape
args = Array(config.args)
cmd << " #{args.join(' ')}" if !args.empty?
cmd = Shellwords.split(cmd)
@ui.detail(I18n.t("vagrant.trigger.run.script", path: config.path))
end
# Pick an execution method to run the script or inline string with
# Default to Subprocess::Execute
exec_method = Vagrant::Util::Subprocess.method(:execute)
if Vagrant::Util::Platform.windows?
if config.inline
exec_method = Vagrant::Util::PowerShell.method(:execute_inline)
else
exec_method = Vagrant::Util::PowerShell.method(:execute)
end
end
begin
result = exec_method.call(*cmd, :notify => [:stdout, :stderr]) do |type,data|
options = {}
case type
when :stdout
options[:color] = :green if !config.keep_color
when :stderr
options[:color] = :red if !config.keep_color
end
@ui.detail(data, options)
end
if !exit_codes.include?(result.exit_code)
raise Errors::TriggersBadExitCodes,
code: result.exit_code
end
rescue => e
@ui.error(I18n.t("vagrant.errors.triggers_run_fail"))
@ui.error(e.message)
if on_error == :halt
@logger.debug("Trigger run encountered an error. Halting on error...")
raise e
else
@logger.debug("Trigger run encountered an error. Continuing on anyway...")
@ui.warn(I18n.t("vagrant.trigger.on_error_continue"))
end
end
end
# Runs a script on the guest
#
# @param [ShellProvisioner/Config] config A Shell provisioner config
def run_remote(config, on_error, exit_codes)
if !@machine
# machine doesn't even exist.
if on_error == :halt
raise Errors::TriggersGuestNotExist
else
@ui.warn(I18n.t("vagrant.errors.triggers_guest_not_exist"))
@ui.warn(I18n.t("vagrant.trigger.on_error_continue"))
return
end
elsif @machine.state.id != :running
if on_error == :halt
raise Errors::TriggersGuestNotRunning,
machine_name: @machine.name,
state: @machine.state.id
else
@machine.ui.error(I18n.t("vagrant.errors.triggers_guest_not_running",
machine_name: @machine.name,
state: @machine.state.id))
@machine.ui.warn(I18n.t("vagrant.trigger.on_error_continue"))
return
end
end
prov = VagrantPlugins::Shell::Provisioner.new(@machine, config)
begin
prov.provision
rescue => e
@machine.ui.error(I18n.t("vagrant.errors.triggers_run_fail"))
if on_error == :halt
@logger.debug("Trigger run encountered an error. Halting on error...")
raise e
else
@logger.debug("Trigger run encountered an error. Continuing on anyway...")
@machine.ui.error(e.message)
end
end
end
# Exits Vagrant immediately
#
# @param [Integer] code Code to exit Vagrant on
def trigger_abort(exit_code)
if Thread.current[:batch_parallel_action]
@ui.warn(I18n.t("vagrant.trigger.abort_threaded"))
@logger.debug("Trigger abort within parallel batch action. " \
"Setting exit code and terminating.")
Thread.current[:exit_code] = exit_code
Thread.current.terminate
else
@ui.warn(I18n.t("vagrant.trigger.abort"))
@logger.debug("Trigger abort within non-parallel action, exiting directly")
Process.exit!(exit_code)
end
end
# Calls the given ruby block for execution
#
# @param [Proc] ruby_block
def execute_ruby(ruby_block)
ruby_block.call(@env, @machine)
end
end
end
end
end

View File

@ -35,6 +35,14 @@ module Vagrant
!!ENV["VAGRANT_INSTALLER_ENV"]
end
# This returns a true/false if we are running within a bundler environment
#
# @return [Boolean]
def self.in_bundler?
!!ENV["BUNDLE_GEMFILE"] &&
!defined?(::Bundler).nil?
end
# Returns the path to the embedded directory of the Vagrant installer,
# if there is one (if we're running in an installer).
#
@ -130,6 +138,18 @@ module Vagrant
end
end
# Automatically install locally defined plugins instead of
# waiting for user confirmation.
#
# @return [Boolean]
def self.auto_install_local_plugins?
if ENV["VAGRANT_INSTALL_LOCAL_PLUGINS"]
true
else
false
end
end
# Use Ruby Resolv in place of libc
#
# @return [boolean] enabled or not

View File

@ -329,10 +329,15 @@ module Vagrant
target = opts[:target] if opts.key?(:target)
target = "#{target}:" if target != ""
# Get the lines. The first default is because if the message
# is an empty string, then we want to still use the empty string.
lines = [message]
lines = message.split("\n") if message != ""
if message != ""
lines = [].tap do |l|
message.scan(/(.*?)(\n|$)/).each do |m|
l << m.first if m.first != "" || (m.first == "" && m.last == "\n")
end
end
lines << "" if message.end_with?("\n")
end
# Otherwise, make sure to prefix every line properly
lines.map do |line|

View File

@ -162,8 +162,8 @@ module Vagrant
ui = Vagrant::UI::Prefixed.new(env.ui, "vagrant")
if latest_version > installed_version
@logger.info("new version of Vagrant available - #{latest_version}")
ui.info(I18n.t("vagrant.version_upgrade_available", latest_version: latest_version))
env.ui.info("")
ui.info(I18n.t("vagrant.version_upgrade_available", latest_version: latest_version, installed_version: installed_version), channel: :error)
env.ui.info("", channel: :error)
else
@logger.debug("vagrant is currently up to date")
end

View File

@ -0,0 +1,96 @@
module Vagrant
module Util
class CurlHelper
# Hosts that do not require notification on redirect
SILENCED_HOSTS = [
"vagrantcloud.com".freeze,
"vagrantup.com".freeze
].freeze
def self.capture_output_proc(logger, ui, source=nil)
progress_data = ""
progress_regexp = /^\r\s*(\d.+?)\r/m
# Setup the proc that'll receive the real-time data from
# the downloader.
data_proc = Proc.new do |type, data|
# Type will always be "stderr" because that is the only
# type of data we're subscribed for notifications.
# Accumulate progress_data
progress_data << data
while true
# If the download has been redirected and we are no longer downloading
# from the original host, notify the user that the target host has
# changed from the source.
if progress_data.include?("Location")
location = progress_data.scan(/(^|[^\w-])Location: (.+?)$/m).flatten.compact.last.to_s.strip
if !location.empty?
location_uri = URI.parse(location)
unless location_uri.host.nil?
redirect_notify = false
logger.info("download redirected to #{location}")
source_uri = URI.parse(source)
source_host = source_uri.host.to_s.split(".", 2).last
location_host = location_uri.host.to_s.split(".", 2).last
if !redirect_notify && location_host != source_host && !SILENCED_HOSTS.include?(location_host)
ui.clear_line
ui.detail "Download redirected to host: #{location_uri.host}"
end
redirect_notify = true
end
end
progress_data.replace("")
break
end
# If we have a full amount of column data (two "\r") then
# we report new progress reports. Otherwise, just keep
# accumulating.
match = nil
check_match = true
while check_match
check_match = progress_regexp.match(progress_data)
if check_match
data = check_match[1].to_s
stop = progress_data.index(data) + data.length
progress_data.slice!(0, stop)
match = check_match
end
end
break if !match
# Ignore the first \r and split by whitespace to grab the columns
columns = data.strip.split(/\s+/)
# COLUMN DATA:
#
# 0 - % total
# 1 - Total size
# 2 - % received
# 3 - Received size
# 4 - % transferred
# 5 - Transferred size
# 6 - Average download speed
# 7 - Average upload speed
# 9 - Total time
# 9 - Time spent
# 10 - Time left
# 11 - Current speed
output = "Progress: #{columns[0]}% (Rate: #{columns[11]}/s, Estimated time remaining: #{columns[10]})"
ui.clear_line
ui.detail(output, new_line: false)
end
end
return data_proc
end
end
end
end

View File

@ -1,11 +1,14 @@
require "uri"
require "log4r"
require "digest"
require "digest/md5"
require "digest/sha1"
require "vagrant/util/busy"
require "vagrant/util/platform"
require "vagrant/util/subprocess"
require "vagrant/util/curl_helper"
require "vagrant/util/file_checksum"
module Vagrant
module Util
@ -17,13 +20,7 @@ module Vagrant
# are properly tracked.
#
# Vagrant/1.7.4 (+https://www.vagrantup.com; ruby2.1.0)
USER_AGENT = "Vagrant/#{VERSION} (+https://www.vagrantup.com; #{RUBY_ENGINE}#{RUBY_VERSION})".freeze
# Supported file checksum
CHECKSUM_MAP = {
:md5 => Digest::MD5,
:sha1 => Digest::SHA1
}.freeze
USER_AGENT = "Vagrant/#{VERSION} (+https://www.vagrantup.com; #{RUBY_ENGINE}#{RUBY_VERSION}) #{ENV['VAGRANT_USER_AGENT_PROVISIONAL_STRING']}".freeze
# Hosts that do not require notification on redirect
SILENCED_HOSTS = [
@ -67,8 +64,11 @@ module Vagrant
@location_trusted = options[:location_trusted]
@checksums = {
:md5 => options[:md5],
:sha1 => options[:sha1]
}
:sha1 => options[:sha1],
:sha256 => options[:sha256],
:sha384 => options[:sha384],
:sha512 => options[:sha512]
}.compact
end
# This executes the actual download, downloading the source file
@ -88,82 +88,7 @@ module Vagrant
# tell us output so we can parse it out.
extra_subprocess_opts[:notify] = :stderr
progress_data = ""
progress_regexp = /^\r\s*(\d.+?)\r/m
# Setup the proc that'll receive the real-time data from
# the downloader.
data_proc = Proc.new do |type, data|
# Type will always be "stderr" because that is the only
# type of data we're subscribed for notifications.
# Accumulate progress_data
progress_data << data
while true
# If the download has been redirected and we are no longer downloading
# from the original host, notify the user that the target host has
# changed from the source.
if progress_data.include?("Location")
location = progress_data.scan(/Location: (.+?)$/m).flatten.compact.first.to_s.strip
if !location.empty?
@logger.info("download redirected to #{location}")
location_uri = URI.parse(location)
source_uri = URI.parse(source)
source_host = source_uri.host.split(".", 2).last
location_host = location_uri.host.split(".", 2).last
if !@redirect_notify && location_host != source_host && !SILENCED_HOSTS.include?(location_host)
@ui.clear_line
@ui.detail "Download redirected to host: #{location_uri.host}"
end
@redirect_notify = true
end
progress_data.replace("")
break
end
# If we have a full amount of column data (two "\r") then
# we report new progress reports. Otherwise, just keep
# accumulating.
match = nil
check_match = true
while check_match
check_match = progress_regexp.match(progress_data)
if check_match
data = check_match[1].to_s
stop = progress_data.index(data) + data.length
progress_data.slice!(0, stop)
match = check_match
end
end
break if !match
# Ignore the first \r and split by whitespace to grab the columns
columns = data.strip.split(/\s+/)
# COLUMN DATA:
#
# 0 - % total
# 1 - Total size
# 2 - % received
# 3 - Received size
# 4 - % transferred
# 5 - Transferred size
# 6 - Average download speed
# 7 - Average upload speed
# 9 - Total time
# 9 - Time spent
# 10 - Time left
# 11 - Current speed
output = "Progress: #{columns[0]}% (Rate: #{columns[11]}/s, Estimated time remaining: #{columns[10]})"
@ui.clear_line
@ui.detail(output, new_line: false)
end
end
data_proc = Vagrant::Util::CurlHelper.capture_output_proc(@logger, @ui, @source)
end
@logger.info("Downloader starting download: ")
@ -239,36 +164,23 @@ module Vagrant
# @option checksums [String] :sha1 Compare SHA1 checksum
# @return [Boolean]
def validate_download!(source, path, checksums)
CHECKSUM_MAP.each do |type, klass|
if checksums[type]
result = checksum_file(klass, path)
@logger.debug("Validating checksum (#{type}) for #{source}. " \
"expected: #{checksums[type]} actual: #{result}")
if checksums[type] != result
raise Errors::DownloaderChecksumError.new(
source: source,
path: path,
type: type,
expected_checksum: checksums[type],
actual_checksum: result
)
end
checksums.each do |type, expected|
actual = FileChecksum.new(path, type).checksum
@logger.debug("Validating checksum (#{type}) for #{source}. " \
"expected: #{expected} actual: #{actual}")
if actual.casecmp(expected) != 0
raise Errors::DownloaderChecksumError.new(
source: source,
path: path,
type: type,
expected_checksum: expected,
actual_checksum: actual
)
end
end
true
end
# Generate checksum on given file
#
# @param digest_class [Class] Digest class to use for generating checksum
# @param path [String, Pathname] Path to file
# @return [String] hexdigest result
def checksum_file(digest_class, path)
digester = digest_class.new
digester.file(path)
digester.hexdigest
end
def execute_curl(options, subprocess_options, &data_proc)
options = options.dup
options << subprocess_options
@ -292,11 +204,21 @@ module Vagrant
# show an error message.
if result.exit_code != 0
@logger.warn("Downloader exit code: #{result.exit_code}")
parts = result.stderr.split(/\n*curl:\s+\(\d+\)\s*/, 2)
parts[1] ||= ""
raise Errors::DownloaderError,
code: result.exit_code,
message: parts[1].chomp
check = result.stderr.match(/\n*curl:\s+\((?<code>\d+)\)\s*(?<error>.*)$/)
if check && check[:code] == "416"
# All good actually. 416 means there is no more bytes to download
@logger.warn("Downloader got a 416, but is likely fine. Continuing on...")
else
if !check
err_msg = result.stderr
else
err_msg = check[:error]
end
raise Errors::DownloaderError,
code: result.exit_code,
message: err_msg
end
end
result

View File

@ -0,0 +1,76 @@
module Vagrant
module Util
class Experimental
class << self
# A method for determining if the experimental flag has been enabled with
# any features
#
# @return [Boolean]
def enabled?
if !defined?(@_experimental)
experimental = features_requested
if experimental.size >= 1 && experimental.first != "0"
@_experimental = true
else
@_experimental = false
end
end
@_experimental
end
# A method for determining if all experimental features have been enabled
# by either a global enabled value "1" or all features explicitly enabled.
#
# @return [Boolean]
def global_enabled?
if !defined?(@_global_enabled)
experimental = features_requested
if experimental.size == 1 && experimental.first == "1"
@_global_enabled = true
else
@_global_enabled = false
end
end
@_global_enabled
end
# A method for Vagrant internals to determine if a given feature
# has been abled by the user, is a valid feature flag and can be used.
#
# @param [String] feature
# @return [Boolean] - A hash containing the original array and if it is valid
def feature_enabled?(feature)
experimental = features_requested
feature = feature.to_s
return global_enabled? || experimental.include?(feature)
end
# Returns the features requested for the experimental flag
#
# @return [Array] - Returns an array of requested experimental features
def features_requested
if !defined?(@_requested_features)
@_requested_features = ENV["VAGRANT_EXPERIMENTAL"].to_s.downcase.split(',')
end
@_requested_features
end
# A function to guard experimental blocks of code from being executed
#
# @param [Array] features - Array of features to guard a method with
# @param [Block] block - Block of ruby code to be guarded against
def guard_with(*features, &block)
yield if block_given? && features.any? {|f| feature_enabled?(f)}
end
# @private
# Reset the cached values for platform. This is not considered a public
# API and should only be used for testing.
def reset!
instance_variables.each(&method(:remove_instance_variable))
end
end
end
end
end

View File

@ -2,6 +2,9 @@
# passed into FileChecksum. Note that this isn't strictly enforced at
# the moment, and this class isn't directly used. It is merely here for
# documentation of structure of the class.
require "vagrant/errors"
class DigestClass
def update(string); end
def hexdigest; end
@ -10,13 +13,27 @@ end
class FileChecksum
BUFFER_SIZE = 1024 * 8
# Supported file checksum
CHECKSUM_MAP = {
:md5 => Digest::MD5,
:sha1 => Digest::SHA1,
:sha256 => Digest::SHA256,
:sha384 => Digest::SHA384,
:sha512 => Digest::SHA512
}.freeze
# Initializes an object to calculate the checksum of a file. The given
# ``digest_klass`` should implement the ``DigestClass`` interface. Note
# that the built-in Ruby digest classes duck type this properly:
# Digest::MD5, Digest::SHA1, etc.
def initialize(path, digest_klass)
@digest_klass = digest_klass
@path = path
if digest_klass.is_a?(Class)
@digest_klass = digest_klass
else
@digest_klass = load_digest(digest_klass)
end
@path = path
end
# This calculates the checksum of the file and returns it as a
@ -40,6 +57,18 @@ class FileChecksum
end
end
return digest.hexdigest
digest.hexdigest
end
private
def load_digest(type)
digest = CHECKSUM_MAP[type.to_s.to_sym]
if digest.nil?
raise Vagrant::Errors::BoxChecksumInvalidType,
type: type.to_s,
types: CHECKSUM_MAP.keys.join(', ')
end
digest
end
end

View File

@ -17,44 +17,80 @@ module Vagrant
# systemd-networkd.service is in use
#
# @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator
# @return [Boolean]
def systemd_networkd?(comm)
comm.test("sudo systemctl status systemd-networkd.service")
comm.test("systemctl -q is-active systemd-networkd.service", sudo: true)
end
# Check if a unit file with the given name is defined. Name can
# be a pattern or explicit name.
#
# @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator
# @param [String] name Name or pattern to search
# @return [Boolean]
def systemd_unit_file?(comm, name)
comm.test("systemctl -q list-unit-files | grep \"#{name}\"")
end
# Check if a unit is currently active within systemd
#
# @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator
# @param [String] name Name or pattern to search
# @return [Boolean]
def systemd_unit?(comm, name)
comm.test("systemctl -q list-units | grep \"#{name}\"")
end
# Check if given service is controlled by systemd
#
# @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator
# @param [String] service_name Name of the service to check
# @return [Boolean]
def systemd_controlled?(comm, service_name)
comm.test("systemctl -q is-active #{service_name}", sudo: true)
end
# systemd hostname set is via hostnamectl
#
# @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator
# @return [Boolean]
# NOTE: This test includes actually calling `hostnamectl` to verify
# that it is in working order. This prevents attempts to use the
# hostnamectl command when it is available, but dbus is not which
# renders the command useless
def hostnamectl?(comm)
comm.test("hostnamectl")
comm.test("command -v hostnamectl && hostnamectl")
end
## netplan helpers
# netplan is installed
#
# @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator
# @return [Boolean]
def netplan?(comm)
comm.test("netplan -h")
comm.test("command -v netplan")
end
## nmcli helpers
# nmcli is installed
#
# @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator
# @return [Boolean]
def nmcli?(comm)
comm.test("nmcli")
comm.test("command -v nmcli")
end
# NetworkManager currently controls device
#
# @param comm [Communicator]
# @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator
# @param device_name [String]
# @return [Boolean]
def nm_controlled?(comm, device_name)
comm.test("nmcli d show #{device_name}") &&
!comm.test("nmcli d show #{device_name} | grep unmanaged")
comm.test("nmcli -t d show #{device_name}") &&
!comm.test("nmcli -t d show #{device_name} | grep unmanaged")
end
end

View File

@ -30,8 +30,7 @@ module Vagrant
return true
end
rescue Timeout::Error, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, \
Errno::ENETUNREACH, Errno::EACCES, Errno::ENOTCONN, \
Errno::EADDRNOTAVAIL
Errno::ENETUNREACH, Errno::EACCES, Errno::ENOTCONN
# Any of the above exceptions signal that the port is closed.
return false
end

View File

@ -5,34 +5,9 @@ module Vagrant
module NetworkIP
# Returns the network address of the given IP and subnet.
#
# If the IP address is an IPv6 address, subnet should be a prefix
# length such as "64".
#
# @return [String]
def network_address(ip, subnet)
# If this is an IPv6 address, then just mask it
if subnet.to_s =~ /^\d+$/
ip = IPAddr.new(ip)
return ip.mask(subnet.to_i).to_s
end
ip = ip_parts(ip)
netmask = ip_parts(subnet)
# Bitwise-AND each octet to get the network address
# in octets and join each part with a period to get
# the resulting network address.
ip.map { |part| part & netmask.shift }.join(".")
end
protected
# Splits an IP into the four octets and returns each as an
# integer in an array.
#
# @return [Array<Integer>]
def ip_parts(ip)
ip.split(".").map { |i| i.to_i }
IPAddr.new(ip).mask(subnet).to_s
end
end
end

View File

@ -0,0 +1,61 @@
require "log4r"
module Vagrant
module Util
class Numeric
# Authors Note: This conversion has been borrowed from the ActiveSupport Numeric class
# Conversion helper constants
KILOBYTE = 1024
MEGABYTE = KILOBYTE * 1024
GIGABYTE = MEGABYTE * 1024
TERABYTE = GIGABYTE * 1024
PETABYTE = TERABYTE * 1024
EXABYTE = PETABYTE * 1024
BYTES_CONVERSION_MAP = {KB: KILOBYTE, MB: MEGABYTE, GB: GIGABYTE, TB: TERABYTE,
PB: PETABYTE, EB: EXABYTE}
# Regex borrowed from the vagrant-disksize config class
SHORTHAND_MATCH_REGEX = /^(?<number>[0-9]+)\s?(?<unit>KB|MB|GB|TB)?$/
class << self
LOGGER = Log4r::Logger.new("vagrant::util::numeric")
# A helper that converts a shortcut string to its bytes representation.
# The expected format of `str` is essentially: "<Number>XX"
# Where `XX` is shorthand for KB, MB, GB, TB, PB, or EB. For example, 50 megabytes:
#
# str = "50MB"
#
# @param [String] - str
# @return [Integer,nil] - bytes - returns nil if method fails to convert to bytes
def string_to_bytes(str)
bytes = nil
str = str.to_s.strip
matches = SHORTHAND_MATCH_REGEX.match(str)
if matches
number = matches[:number].to_i
unit = matches[:unit].to_sym
if BYTES_CONVERSION_MAP.key?(unit)
bytes = number * BYTES_CONVERSION_MAP[unit]
else
LOGGER.error("An invalid unit or format was given, string_to_bytes cannot convert #{str}")
end
end
bytes
end
# @private
# Reset the cached values for platform. This is not considered a public
# API and should only be used for testing.
def reset!
instance_variables.each(&method(:remove_instance_variable))
end
end
end
end
end

View File

@ -13,6 +13,14 @@ module Vagrant
# This class just contains some platform checking code.
class Platform
class << self
def logger
if !defined?(@_logger)
@_logger = Log4r::Logger.new("vagrant::util::platform")
end
@_logger
end
def cygwin?
if !defined?(@_cygwin)
@_cygwin = ENV["VAGRANT_DETECTED_OS"].to_s.downcase.include?("cygwin") ||
@ -35,11 +43,10 @@ module Vagrant
if !defined?(@_wsl)
@_wsl = false
SilenceWarnings.silence! do
# Use PATH values to check for `/mnt/c` path indicative of WSL
if ENV.fetch("PATH", "").downcase.include?("/mnt/c")
# Validate WSL via uname output
uname = Subprocess.execute("uname", "-r")
if uname.exit_code == 0 && uname.stdout.downcase.include?("microsoft")
# Find 'microsoft' in /proc/version indicative of WSL
if File.file?('/proc/version')
osversion = File.open('/proc/version', &:gets)
if osversion.downcase.include?("microsoft")
@_wsl = true
end
end
@ -79,24 +86,49 @@ module Vagrant
return @_windows_admin
end
# Checks if the user running Vagrant on Windows is a member of the
# "Hyper-V Administrators" group.
# Checks if Hyper-V is accessible to the local user. It will check
# if user is in the "Hyper-V Administrators" group, is a Domain
# administrator, and finally will run a manual interaction with
# Hyper-V to determine if Hyper-V is usable for the current user.
#
# From: https://support.microsoft.com/en-us/kb/243330
# SID: S-1-5-32-578
# Name: BUILTIN\Hyper-V Administrators
# SID: S-1-5-21DOMAIN-512
# Name: Domain Admins
#
# @return [Boolean]
def windows_hyperv_admin?
return @_windows_hyperv_admin if defined?(@_windows_hyperv_admin)
@_windows_hyperv_admin = -> {
ps_cmd = "[System.Security.Principal.WindowsIdentity]::GetCurrent().Groups | ForEach-Object { if ($_.Value -eq 'S-1-5-32-578'){ Write-Host 'true'; break }}"
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
return output == 'true'
}.call
if ENV["VAGRANT_IS_HYPERV_ADMIN"]
return @_windows_hyperv_admin = true
end
return @_windows_hyperv_admin
ps_cmd = "Write-Output ([System.Security.Principal.WindowsIdentity]::GetCurrent().Groups | " \
"Select-Object Value | ConvertTo-JSON)"
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
if output
groups = begin
JSON.load(output)
rescue JSON::ParserError
[]
end
admin_group = groups.detect do |g|
g["Value"].to_s == "S-1-5-32-578" ||
(g["Value"].start_with?("S-1-5-21") && g["Value"].to_s.end_with?("-512"))
end
if admin_group
return @_windows_hyperv_admin = true
end
end
ps_cmd = "$x = (Get-VMHost).Name; if($x -eq [System.Net.Dns]::GetHostName()){ Write-Output 'true'}"
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
result = output == "true"
return @_windows_hyperv_admin = result
end
# Checks if Hyper-V is enabled on the host system and returns true
@ -107,9 +139,17 @@ module Vagrant
return @_windows_hyperv_enabled if defined?(@_windows_hyperv_enabled)
@_windows_hyperv_enabled = -> {
ps_cmd = "$(Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online).State"
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
return output == 'Enabled'
["Get-WindowsOptionalFeature", "Get-WindowsFeature"].each do |cmd_name|
ps_cmd = "$(#{cmd_name} -FeatureName Microsoft-Hyper-V-Hypervisor).State"
begin
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
return true if output == "Enabled"
rescue Errors::PowerShellInvalidVersion
logger.warn("Invalid PowerShell version detected during Hyper-V enable check")
return false
end
end
return false
}.call
return @_windows_hyperv_enabled
@ -326,6 +366,12 @@ module Vagrant
# Lowercase the drive letter, skip the next symbol (which is a
# colon from a Windows path) and convert path to UNIX style.
check_path = "/mnt/#{path[0, 1].downcase}#{path[2..-1].tr('\\', '/')}/rootfs"
begin
process = Subprocess.execute("wslpath", "-u", "-a", path)
check_path = "#{process.stdout.chomp}/rootfs" if process.exit_code == 0
rescue Errors::CommandUnavailable => e
# pass
end
logger.debug("checking `#{path}` for current WSL instance")
begin
@ -389,27 +435,33 @@ module Vagrant
# @param [String, Pathname] path Path to convert
# @return [String]
def wsl_to_windows_path(path)
path = path.to_s
if wsl? && wsl_windows_access? && !path.match(/^[a-zA-Z]:/)
path = File.expand_path(path)
begin
process = Subprocess.execute("wslpath", "-w", "-a", path)
return process.stdout.chomp if process.exit_code == 0
rescue Errors::CommandUnavailable => e
# pass
end
if wsl_path?(path)
parts = path.split("/")
parts.delete_if(&:empty?)
root_path = wsl_rootfs
# lxrun splits home separate so we need to account
# for it's specialness here when we build the path
if root_path.end_with?("lxss") && parts.first != "home"
if root_path.end_with?("lxss") && !(["root", "home"].include?(parts.first))
root_path = "#{root_path}\\rootfs"
end
[root_path, *parts].join("\\")
path = [root_path, *parts].join("\\")
else
path = path.to_s.sub("/mnt/", "")
path = path.sub("/mnt/", "")
parts = path.split("/")
parts.first << ":"
path = parts.join("\\")
path
end
else
path
end
path
end
# Takes a windows path and formats it to the
@ -462,6 +514,14 @@ module Vagrant
def wsl_windows_accessible_path
if !defined?(@_wsl_windows_accessible_path)
access_path = ENV["VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH"]
if access_path.to_s.empty?
begin
process = Subprocess.execute("wslpath", "-u", "-a", wsl_windows_home)
access_path = process.stdout.chomp if process.exit_code == 0
rescue Errors::CommandUnavailable => e
# pass
end
end
if access_path.to_s.empty?
access_path = wsl_windows_home.gsub("\\", "/").sub(":", "")
access_path[0] = access_path[0].downcase
@ -481,6 +541,41 @@ module Vagrant
path.to_s.start_with?(wsl_windows_accessible_path.to_s)
end
# Mount pattern for extracting local mount information
MOUNT_PATTERN = /^(?<device>.+?) on (?<mount>.+?) type (?<type>.+?) \((?<options>.+)\)/.freeze
# Get list of local mount paths that are DrvFs file systems
#
# @return [Array<String>]
def wsl_drvfs_mounts
if !defined?(@_wsl_drvfs_mounts)
@_wsl_drvfs_mounts = []
if wsl?
result = Util::Subprocess.execute("mount")
result.stdout.each_line do |line|
info = line.match(MOUNT_PATTERN)
if info && info[:type] == "drvfs"
@_wsl_drvfs_mounts << info[:mount]
end
end
end
end
@_wsl_drvfs_mounts
end
# Check if given path is located on DrvFs file system
#
# @param [String, Pathname] path Path to check
# @return [Boolean]
def wsl_drvfs_path?(path)
if wsl?
wsl_drvfs_mounts.each do |mount_path|
return true if path.to_s.start_with?(mount_path)
end
end
false
end
# If running within the Windows Subsystem for Linux, this will provide
# simple setup to allow sharing of the user's VAGRANT_HOME directory
# within the subsystem
@ -561,9 +656,9 @@ module Vagrant
def wsl_validate_matching_vagrant_versions!
valid = false
if Util::Which.which("vagrant.exe")
result = Util::Subprocess.execute("vagrant.exe", "version")
result = Util::Subprocess.execute("vagrant.exe", "--version")
if result.exit_code == 0
windows_version = result.stdout.match(/Installed Version: (?<version>[\w.-]+)/)
windows_version = result.stdout.match(/Vagrant (?<version>[\w.-]+)/)
if windows_version
windows_version = windows_version[:version].strip
valid = windows_version == Vagrant::VERSION

View File

@ -1,3 +1,4 @@
require "base64"
require "tmpdir"
require_relative "subprocess"
require_relative "which"
@ -20,12 +21,20 @@ module Vagrant
if !defined?(@_powershell_executable)
@_powershell_executable = "powershell"
# Try to use WSL interoperability if PowerShell is not symlinked to
# the container.
if Which.which(@_powershell_executable).nil? && Platform.wsl?
@_powershell_executable += ".exe"
if Which.which(@_powershell_executable).nil?
# Try to use WSL interoperability if PowerShell is not symlinked to
# the container.
if Platform.wsl?
@_powershell_executable += ".exe"
if Which.which(@_powershell_executable).nil?
if Which.which(@_powershell_executable).nil?
@_powershell_executable = "/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe"
if Which.which(@_powershell_executable).nil?
@_powershell_executable = nil
end
end
else
@_powershell_executable = nil
end
end
@ -41,19 +50,30 @@ module Vagrant
# Execute a powershell script.
#
# @param [String] path Path to the PowerShell script to execute.
# @param [Array<String>] args Command arguments
# @param [Hash] opts Options passed to execute
# @option opts [Hash] :env Custom environment variables
# @return [Subprocess::Result]
def self.execute(path, *args, **opts, &block)
validate_install!
if opts.delete(:sudo) || opts.delete(:runas)
powerup_command(path, args, opts)
else
if mpath = opts.delete(:module_path)
m_env = opts.fetch(:env, {})
m_env["PSModulePath"] = "$env:PSModulePath+';#{mpath}'"
opts[:env] = m_env
end
if env = opts.delete(:env)
env = env.map{|k,v| "$env:#{k}=#{v}"}.join(";") + "; "
end
command = [
executable,
"-NoLogo",
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy", "Bypass",
"&('#{path}')",
"#{env}&('#{path}')",
args
].flatten
@ -68,10 +88,20 @@ module Vagrant
# Execute a powershell command.
#
# @param [String] command PowerShell command to execute.
# @param [Hash] opts Extra options
# @option opts [Hash] :env Custom environment variables
# @return [nil, String] Returns nil if exit code is non-zero.
# Returns stdout string if exit code is zero.
def self.execute_cmd(command)
def self.execute_cmd(command, **opts)
validate_install!
if mpath = opts.delete(:module_path)
m_env = opts.fetch(:env, {})
m_env["PSModulePath"] = "$env:PSModulePath+';#{mpath}'"
opts[:env] = m_env
end
if env = opts.delete(:env)
env = env.map{|k,v| "$env:#{k}=#{v}"}.join(";") + "; "
end
c = [
executable,
"-NoLogo",
@ -79,7 +109,7 @@ module Vagrant
"-NonInteractive",
"-ExecutionPolicy", "Bypass",
"-Command",
command
"#{env}#{command}"
].flatten.compact
r = Subprocess.execute(*c)
@ -87,6 +117,39 @@ module Vagrant
return r.stdout.chomp
end
# Execute a powershell command and return a result
#
# @param [String] command PowerShell command to execute.
# @param [Hash] opts A collection of options for subprocess::execute
# @option opts [Hash] :env Custom environment variables
# @param [Block] block Ruby block
def self.execute_inline(*command, **opts, &block)
validate_install!
if mpath = opts.delete(:module_path)
m_env = opts.fetch(:env, {})
m_env["PSModulePath"] = "$env:PSModulePath+';#{mpath}'"
opts[:env] = m_env
end
if env = opts.delete(:env)
env = env.map{|k,v| "$env:#{k}=#{v}"}.join(";") + "; "
end
command = command.join(' ')
c = [
executable,
"-NoLogo",
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy", "Bypass",
"-Command",
"#{env}#{command}"
].flatten.compact
c << opts
Subprocess.execute(*c, &block)
end
# Returns the version of PowerShell that is installed.
#
# @return [String]
@ -146,18 +209,26 @@ module Vagrant
# @return [Array<String>]
def self.powerup_command(path, args, opts)
Dir.mktmpdir("vagrant") do |dpath|
all_args = ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", path] + args
arg_list = "@('" + all_args.join("', '") + "')"
all_args = [path] + args.flatten.map{ |a|
a.gsub(/^['"](.+)['"]$/, "\\1")
}
arg_list = "\"" + all_args.join("\" \"") + "\""
stdout = File.join(dpath, "stdout.txt")
stderr = File.join(dpath, "stderr.txt")
exitcode = File.join(dpath, "exitcode.txt")
script = "$sp = Start-Process -FilePath powershell -ArgumentList #{arg_list} " \
"-PassThru -Wait -RedirectStandardOutput '#{stdout}' -RedirectStandardError '#{stderr}' -WindowStyle Hidden; " \
"if($sp){ Set-Content -Path '#{exitcode}' -Value $sp.ExitCode;exit $sp.ExitCode; }else{ exit 1 }"
script = "& #{arg_list} ; exit $LASTEXITCODE;"
script_content = Base64.strict_encode64(script.encode("UTF-16LE", "UTF-8"))
# escape quotes so we can nest our script within a start-process
script.gsub!("'", "''")
# Wrap so we can redirect output to read later
wrapper = "$p = Start-Process -FilePath powershell -ArgumentList @('-NoLogo', '-NoProfile', " \
"'-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand', '#{script_content}') " \
"-PassThru -WindowStyle Hidden -Wait -RedirectStandardOutput '#{stdout}' -RedirectStandardError '#{stderr}'; " \
"if($p){ exit $p.ExitCode; }else{ exit 1 }"
wrapper_content = Base64.strict_encode64(wrapper.encode("UTF-16LE", "UTF-8"))
powerup = "$p = Start-Process -FilePath powershell -ArgumentList @('-NoLogo', '-NoProfile', " \
"'-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand', '#{wrapper_content}') " \
"-PassThru -WindowStyle Hidden -Wait -Verb RunAs; if($p){ exit $p.ExitCode; }else{ exit 1 }"
cmd = [
"powershell",
@ -165,31 +236,20 @@ module Vagrant
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy", "Bypass",
"-Command", "$p = Start-Process -FilePath powershell -ArgumentList " \
"@('-NoLogo', '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', '#{script}') " \
"-PassThru -Wait -WindowStyle Hidden -Verb RunAs; if($p){ exit $p.ExitCode; }else{ exit 1 }"
"-Command", powerup
]
result = Subprocess.execute(*cmd.push(opts))
r_stdout = result.stdout
if File.exist?(stdout)
r_stdout = File.read(stdout)
else
r_stdout = result.stdout
r_stdout += File.read(stdout)
end
r_stderr = result.stderr
if File.exist?(stderr)
r_stderr = File.read(stderr)
else
r_stderr = result.stderr
r_stderr += File.read(stderr)
end
code = 1
if File.exist?(exitcode)
code_txt = File.read(exitcode).strip
if code_txt.match(/^\d+$/)
code = code_txt.to_i
end
end
Subprocess::Result.new(code, r_stdout, r_stderr)
Subprocess::Result.new(result.exit_code, r_stdout, r_stderr)
end
end

View File

@ -140,7 +140,7 @@ module Vagrant
end
# no strict hostkey checking unless paranoid
if ! ssh_info[:verify_host_key]
if ssh_info[:verify_host_key] == :never || !ssh_info[:verify_host_key]
command_options += [
"-o", "StrictHostKeyChecking=no",
"-o", "UserKnownHostsFile=/dev/null"]
@ -150,11 +150,24 @@ module Vagrant
if !plain_mode && options[:private_key_path]
options[:private_key_path].each do |path|
# Use '-o' instead of '-i' because '-i' does not call
# percent_expand in misc.c, but '-o' does. when passing the path,
# replace '%' in the path with '%%' to escape the '%'
path = path.to_s.gsub('%', '%%')
command_options += ["-o", "IdentityFile=\"#{path}\""]
private_key_arr = []
if path.include?('%')
if path.include?(' ') && Platform.windows?
LOGGER.warn("Paths with spaces and % on windows is not supported and will fail to read the file")
end
# Use '-o' instead of '-i' because '-i' does not call
# percent_expand in misc.c, but '-o' does. when passing the path,
# replace '%' in the path with '%%' to escape the '%'
path = path.to_s.gsub('%', '%%')
private_key_arr = ["-o", "IdentityFile=\"#{path}\""]
else
# Pass private key file directly with '-i', which properly supports
# paths with spaces on Windows guests
private_key_arr = ["-i", path]
end
command_options += private_key_arr
end
end
@ -165,6 +178,10 @@ module Vagrant
"-o", "ForwardX11Trusted=yes"]
end
if ssh_info[:config]
command_options += ["-F", ssh_info[:config]]
end
if ssh_info[:proxy_command]
command_options += ["-o", "ProxyCommand=#{ssh_info[:proxy_command]}"]
end

View File

@ -93,7 +93,7 @@ module Vagrant
# Special installer-related things
if Vagrant.in_installer?
installer_dir = ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"].to_s.downcase
installer_dir = Vagrant.installer_embedded_dir.to_s.downcase
# If we're in an installer on Mac and we're executing a command
# in the installer context, then force DYLD_LIBRARY_PATH to look
@ -123,6 +123,18 @@ module Vagrant
@logger.info("Command not in installer, restoring original environment...")
jailbreak(process.environment)
end
# If running within an AppImage and calling external executable. When
# executable is external set the LD_LIBRARY_PATH to host values.
if ENV["VAGRANT_APPIMAGE"]
embed_path = Pathname.new(Vagrant.installer_embedded_dir).expand_path.to_s
exec_path = Pathname.new(@command[0]).expand_path.to_s
if !exec_path.start_with?(embed_path) && ENV["VAGRANT_APPIMAGE_HOST_LD_LIBRARY_PATH"]
@logger.info("Detected AppImage environment and request to external binary. Updating library path.")
@logger.debug("Setting LD_LIBRARY_PATH to #{ENV["VAGRANT_APPIMAGE_HOST_LD_LIBRARY_PATH"]}")
process.environment["LD_LIBRARY_PATH"] = ENV["VAGRANT_APPIMAGE_HOST_LD_LIBRARY_PATH"].to_s
end
end
else
@logger.info("Vagrant not running in installer, restoring original environment...")
jailbreak(process.environment)

View File

@ -0,0 +1,103 @@
require "uri"
require "log4r"
require "vagrant/util/busy"
require "vagrant/util/platform"
require "vagrant/util/subprocess"
require "vagrant/util/curl_helper"
module Vagrant
module Util
# This class uploads files using various protocols by subprocessing
# to cURL. cURL is a much more capable and complete download tool than
# a hand-rolled Ruby library, so we defer to its expertise.
class Uploader
# @param [String] destination - valid URL to upload file to
# @param [String] file - location of file to upload on disk
# @param [Hash] options
def initialize(destination, file, options=nil)
options ||= {}
@logger = Log4r::Logger.new("vagrant::util::uploader")
@destination = destination.to_s
@file = file.to_s
@ui = options[:ui]
@request_method = options[:method]
if !@request_method
@request_method = "PUT"
end
end
def upload!
data_proc = Vagrant::Util::CurlHelper.capture_output_proc(@logger, @ui)
@logger.info("Uploader starting upload: ")
@logger.info(" -- Source: #{@file}")
@logger.info(" -- Destination: #{@destination}")
options = build_options
subprocess_options = {notify: :stderr}
begin
execute_curl(options, subprocess_options, &data_proc)
rescue Errors::UploaderError => e
raise
ensure
@ui.clear_line if @ui
end
end
protected
def build_options
options = [@destination, "--request", @request_method, "--upload-file", @file]
return options
end
def execute_curl(options, subprocess_options, &data_proc)
options = options.dup
options << subprocess_options
# Create the callback that is called if we are interrupted
interrupted = false
int_callback = Proc.new do
@logger.info("Uploader interrupted!")
interrupted = true
end
# Execute!
result = Busy.busy(int_callback) do
Subprocess.execute("curl", *options, &data_proc)
end
# If the upload was interrupted, then raise a specific error
raise Errors::UploaderInterrupted if interrupted
# If it didn't exit successfully, we need to parse the data and
# show an error message.
if result.exit_code != 0
@logger.warn("Uploader exit code: #{result.exit_code}")
check = result.stderr.match(/\n*curl:\s+\((?<code>\d+)\)\s*(?<error>.*)$/)
if !check
err_msg = result.stderr
else
err_msg = check[:error]
end
raise Errors::UploaderError,
exit_code: result.exit_code,
message: err_msg
end
if @ui
@ui.clear_line
# Windows doesn't clear properly for some reason, so we just
# output one more newline.
@ui.detail("") if Platform.windows?
end
result
end
end
end
end

View File

@ -1,4 +1,5 @@
require "vagrant/util/template_renderer"
require "log4r"
module Vagrant
# This class provides a way to load and access the contents
@ -26,6 +27,7 @@ module Vagrant
@keys = keys
@loader = loader
@config, _ = loader.load(keys)
@logger = Log4r::Logger.new("vagrant::vagrantfile")
end
# Returns a {Machine} for the given name and provider that
@ -42,7 +44,7 @@ module Vagrant
# @return [Machine]
def machine(name, provider, boxes, data_path, env)
# Load the configuration for the machine
results = machine_config(name, provider, boxes)
results = machine_config(name, provider, boxes, data_path)
box = results[:box]
config = results[:config]
config_errors = results[:config_errors]
@ -107,9 +109,10 @@ module Vagrant
# be backed by (required for provider overrides).
# @param [BoxCollection] boxes BoxCollection to look up the
# box Vagrantfile.
# @param [Pathname] data_path Machine data path
# @return [Hash<Symbol, Object>] Various configuration parameters for a
# machine. See the main documentation body for more info.
def machine_config(name, provider, boxes)
def machine_config(name, provider, boxes, data_path=nil, validate_provider=true)
keys = @keys.dup
sub_machine = @config.vm.defined_vms[name]
@ -124,23 +127,40 @@ module Vagrant
box_formats = nil
if provider != nil
provider_plugin = Vagrant.plugin("2").manager.providers[provider]
if !provider_plugin
if !provider_plugin && validate_provider
providers = Vagrant.plugin("2").manager.providers.to_hash.keys
if providers
providers_str = providers.join(', ')
else
providers_str = "N/A"
end
if providers.include? provider.downcase
raise Errors::ProviderNotFoundSuggestion,
machine: name, provider: provider,
suggestion: provider.downcase, providers: providers_str
end
raise Errors::ProviderNotFound,
machine: name, provider: provider
machine: name, provider: provider, providers: providers_str
end
provider_cls = provider_plugin[0]
provider_options = provider_plugin[1]
box_formats = provider_options[:box_format] || provider
if validate_provider
provider_cls = provider_plugin[0]
provider_options = provider_plugin[1]
box_formats = provider_options[:box_format] || provider
# Test if the provider is usable or not
begin
provider_cls.usable?(true)
rescue Errors::VagrantError => e
raise Errors::ProviderNotUsable,
machine: name.to_s,
provider: provider.to_s,
message: e.to_s
# Test if the provider is usable or not
begin
provider_cls.usable?(true)
rescue Errors::VagrantError => e
raise Errors::ProviderNotUsable,
machine: name.to_s,
provider: provider.to_s,
message: e.to_s
end
else
box_formats = provider
end
end
@ -154,8 +174,21 @@ module Vagrant
# Track the original box so we know if we changed
box = nil
original_box = config.vm.box
original_version = config.vm.box_version
initial_box = original_box = config.vm.box
initial_version = original_version = config.vm.box_version
# Check if this machine has a local box metadata file
# describing the existing guest. If so, load it and
# set the box name and version to allow the actual
# box in use to be discovered.
if data_path
meta_file = data_path.join("box_meta")
if meta_file.file?
box_meta = JSON.parse(meta_file.read)
config.vm.box = box_meta["name"]
config.vm.box_version = box_meta["version"]
end
end
# The proc below loads the box and provider overrides. This is
# in a proc because it may have to recurse if the provider override
@ -168,12 +201,14 @@ module Vagrant
box = boxes.find(config.vm.box, box_formats, config.vm.box_version)
if box
box_vagrantfile = find_vagrantfile(box.directory)
if box_vagrantfile
if box_vagrantfile && !config.vm.ignore_box_vagrantfile
box_config_key =
"#{boxes.object_id}_#{box.name}_#{box.provider}".to_sym
@loader.set(box_config_key, box_vagrantfile)
local_keys.unshift(box_config_key)
config, config_warnings, config_errors = @loader.load(local_keys)
elsif box_vagrantfile && config.vm.ignore_box_vagrantfile
@logger.warn("Ignoring #{box.name} provided Vagrantfile inside box")
end
end
end
@ -201,6 +236,22 @@ module Vagrant
# Load the box and provider overrides
load_box_proc.call
# NOTE: In cases where the box_meta file contains stale information
# and the reference box no longer exists, fall back to initial
# configuration and attempt to load that
if box.nil?
@logger.warn("Failed to locate #{config.vm.box} with version #{config.vm.box_version}")
@logger.warn("Performing lookup with inital values #{initial_box} with version #{initial_version}")
config.vm.box = original_box = initial_box
config.vm.box_version = original_box = initial_version
load_box_proc.call
end
# Ensure box attributes are set to original values in
# case they were modified by the local box metadata
config.vm.box = original_box
config.vm.box_version = original_version
return {
box: box,
provider_cls: provider_cls,

View File

@ -86,7 +86,7 @@ module VagrantPlugins
box_force: options[:force],
box_download_ca_cert: options[:ca_cert],
box_download_ca_path: options[:ca_path],
box_client_cert: options[:client_cert],
box_download_client_cert: options[:client_cert],
box_download_insecure: options[:insecure],
box_download_location_trusted: options[:location_trusted],
ui: Vagrant::UI::Prefixed.new(@env.ui, "box"),

View File

@ -26,6 +26,10 @@ module VagrantPlugins
options[:global] = g
end
o.on("-f", "--force", "Force checks for latest box updates") do |f|
options[:force] = f
end
build_download_options(o, download_options)
end
@ -40,7 +44,7 @@ module VagrantPlugins
with_target_vms(argv) do |machine|
@env.action_runner.run(Vagrant::Action.action_box_outdated, {
box_outdated_force: true,
box_outdated_force: options[:force],
box_outdated_refresh: true,
box_outdated_success_ui: true,
machine: machine,
@ -73,7 +77,15 @@ module VagrantPlugins
end
current = Gem::Version.new(box.version)
latest = Gem::Version.new(md.versions.last)
box_versions = md.versions(provider: box.provider)
if box_versions.empty?
latest_box_version = box_versions.last.to_i
else
latest_box_version = box_versions.last
end
latest = Gem::Version.new(latest_box_version)
if latest <= current
@env.ui.success(I18n.t(
"vagrant.box_up_to_date",

View File

@ -30,6 +30,10 @@ module VagrantPlugins
o.on("-f", "--force", "Destroy without confirmation even when box is in use.") do |f|
options[:force] = f
end
o.on("-k", "--keep-active-boxes", "When combined with `--force`, will keep boxes still actively in use.") do |k|
options[:keep] = k
end
end
# Parse the options
@ -41,7 +45,7 @@ module VagrantPlugins
return @env.ui.warn(I18n.t("vagrant.commands.box.no_installed_boxes"), prefix: false)
end
delete_oldest_boxes(boxes, options[:provider], options[:force], options[:name], options[:dry_run])
delete_oldest_boxes(boxes, options[:provider], options[:force], options[:name], options[:dry_run], options[:keep])
# Success, exit status 0
0
@ -49,7 +53,7 @@ module VagrantPlugins
private
def delete_oldest_boxes(boxes, only_provider, skip_confirm, only_name, dry_run)
def delete_oldest_boxes(boxes, only_provider, skip_confirm, only_name, dry_run, keep_used_boxes)
# Find the longest box name
longest_box = boxes.max_by { |x| x[0].length }
longest_box_length = longest_box[0].length
@ -112,6 +116,7 @@ module VagrantPlugins
box_provider: provider,
box_version: version,
force_confirm_box_remove: skip_confirm,
keep_used_boxes: keep_used_boxes,
box_remove_all_versions: false,
})
end

View File

@ -80,7 +80,7 @@ module VagrantPlugins
end
to_update = [
[name, provider, boxes[name][provider].sort.last],
[name, provider, boxes[name][provider].sort_by{|n| Gem::Version.new(n)}.last],
]
to_update.each do |n, p, v|
@ -100,10 +100,14 @@ module VagrantPlugins
end
if !machine.box
machine.ui.output(I18n.t(
"vagrant.errors.box_update_no_box",
name: machine.config.vm.box))
next
collection = Vagrant::BoxCollection.new(@env.boxes_path)
machine.box = collection.find(machine.config.vm.box, provider || machine.provider_name || @env.default_provider, "> 0")
if !machine.box
machine.ui.output(I18n.t(
"vagrant.errors.box_update_no_box",
name: machine.config.vm.box))
next
end
end
name = machine.box.name
@ -124,7 +128,13 @@ module VagrantPlugins
if download_options[:insecure].nil?
download_options[:insecure] = machine.config.vm.box_download_insecure
end
box_update(box, version, machine.ui, download_options, force)
begin
box_update(box, version, machine.ui, download_options, force)
rescue Vagrant::Errors::BoxUpdateNoMetadata => e
machine.ui.warn(e)
next
end
end
end
@ -154,7 +164,7 @@ module VagrantPlugins
box_version: update[1].version,
ui: ui,
box_force: force,
box_client_cert: download_options[:client_cert],
box_download_client_cert: download_options[:client_cert],
box_download_ca_cert: download_options[:ca_cert],
box_download_ca_path: download_options[:ca_path],
box_download_insecure: download_options[:insecure]

View File

@ -0,0 +1,90 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module AuthCommand
module Command
class Login < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud auth login [options]"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-c", "--check", "Checks if currently logged in") do |c|
options[:check] = c
end
o.on("-d", "--description DESCRIPTION", String, "Set description for the Vagrant Cloud token") do |d|
options[:description] = d
end
o.on("-k", "--logout", "Logout from Vagrant Cloud") do |k|
options[:logout] = k
end
o.on("-t", "--token TOKEN", String, "Set the Vagrant Cloud token") do |t|
options[:token] = t
end
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |l|
options[:login] = l
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
@client = Client.new(@env)
@client.username_or_email = options[:login]
# Determine what task we're actually taking based on flags
if options[:check]
return execute_check
elsif options[:logout]
return execute_logout
elsif options[:token]
return execute_token(options[:token])
else
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options)
end
0
end
def execute_check
if @client.logged_in?
@env.ui.success(I18n.t("cloud_command.check_logged_in"))
return 0
else
@env.ui.error(I18n.t("cloud_command.check_not_logged_in"))
return 1
end
end
def execute_logout
@client.clear_token
@env.ui.success(I18n.t("cloud_command.logged_out"))
return 0
end
def execute_token(token)
@client.store_token(token)
@env.ui.success(I18n.t("cloud_command.token_saved"))
if @client.logged_in?
@env.ui.success(I18n.t("cloud_command.check_logged_in"))
return 0
else
@env.ui.error(I18n.t("cloud_command.invalid_token"))
return 1
end
end
end
end
end
end
end

View File

@ -0,0 +1,42 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module AuthCommand
module Command
class Logout < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud auth logout [options]"
o.separator ""
o.separator "Log out of Vagrant Cloud"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |l|
options[:login] = l
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if !argv.empty?
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
# Initializes client and deletes token on disk
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
@client.clear_token
@env.ui.success(I18n.t("cloud_command.logged_out"))
return 0
end
end
end
end
end
end

View File

@ -1,10 +1,10 @@
require "cgi"
require "uri"
require_relative "../client"
require Vagrant.source_root.join("plugins/commands/cloud/client/client")
module VagrantPlugins
module LoginCommand
module CloudCommand
class AddAuthentication
REPLACEMENT_HOSTS = [
"app.vagrantup.com".freeze,
@ -27,7 +27,7 @@ module VagrantPlugins
def initialize(app, env)
@app = app
LoginCommand::Plugin.init!
CloudCommand::Plugin.init!
end
def call(env)
@ -35,11 +35,17 @@ module VagrantPlugins
token = client.token
env[:box_urls].map! do |url|
u = URI.parse(url)
if u.host != TARGET_HOST && REPLACEMENT_HOSTS.include?(u.host)
u.host = TARGET_HOST
begin
u = URI.parse(url)
if u.host != TARGET_HOST && REPLACEMENT_HOSTS.include?(u.host)
u.host = TARGET_HOST
u.to_s
else
url
end
rescue URI::Error
url
end
u.to_s
end
server_uri = URI.parse(Vagrant.server_url.to_s)
@ -50,7 +56,7 @@ module VagrantPlugins
if u.host == server_uri.host
if server_uri.host != TARGET_HOST && !self.class.custom_host_notified?
env[:ui].warn(I18n.t("login_command.middleware.authentication.different_target",
env[:ui].warn(I18n.t("cloud_command.middleware.authentication.different_target",
custom_host: server_uri.host, known_host: TARGET_HOST) + "\n")
sleep CUSTOM_HOST_NOTIFY_WAIT
self.class.custom_host_notified!

View File

@ -0,0 +1,20 @@
require "vagrant"
module VagrantPlugins
module CloudCommand
module AuthCommand
class Plugin < Vagrant.plugin("2")
name "vagrant cloud auth"
description <<-DESC
Authorization commands for Vagrant Cloud
DESC
command(:auth) do
require_relative "root"
Command::Root
end
end
end
end
end

View File

@ -0,0 +1,73 @@
module VagrantPlugins
module CloudCommand
module AuthCommand
module Command
class Root < Vagrant.plugin("2", :command)
def self.synopsis
"Manages Vagrant Cloud authorization related to Vagrant Cloud"
end
def initialize(argv, env)
super
@main_args, @sub_command, @sub_args = split_main_and_subcommand(argv)
@subcommands = Vagrant::Registry.new
@subcommands.register(:login) do
require File.expand_path("../login", __FILE__)
Command::Login
end
@subcommands.register(:logout) do
require File.expand_path("../logout", __FILE__)
Command::Logout
end
@subcommands.register(:whoami) do
require File.expand_path("../whoami", __FILE__)
Command::Whoami
end
end
def execute
if @main_args.include?("-h") || @main_args.include?("--help")
# Print the help for all the box commands.
return help
end
# If we reached this far then we must have a subcommand. If not,
# then we also just print the help and exit.
command_class = @subcommands.get(@sub_command.to_sym) if @sub_command
return help if !command_class || !@sub_command
@logger.debug("Invoking command class: #{command_class} #{@sub_args.inspect}")
# Initialize and execute the command class
command_class.new(@sub_args, @env).execute
end
# Prints the help out for this command
def help
opts = OptionParser.new do |opts|
opts.banner = "Usage: vagrant cloud auth <subcommand> [<args>]"
opts.separator ""
opts.separator "Authorization with Vagrant Cloud"
opts.separator ""
opts.separator "Available subcommands:"
# Add the available subcommands as separators in order to print them
# out as well.
keys = []
@subcommands.each { |key, value| keys << key.to_s }
keys.sort.each do |key|
opts.separator " #{key}"
end
opts.separator ""
opts.separator "For help on any individual subcommand run `vagrant cloud auth <subcommand> -h`"
end
@env.ui.info(opts.help, prefix: false)
end
end
end
end
end
end

View File

@ -0,0 +1,62 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module AuthCommand
module Command
class Whoami < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud auth whoami [options] [token]"
o.separator ""
o.separator "Display currently logged in user"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |l|
options[:login] = l
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.size > 1
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:login])
if argv.first
token = argv.first
else
token = @client.token
end
whoami(token, options[:username])
end
def whoami(access_token, username)
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
account = VagrantPlugins::CloudCommand::Util.account(username, access_token, server_url)
begin
success = account.validate_token
user = success["user"]["username"]
@env.ui.success("Currently logged in as #{user}")
return 0
rescue VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.whoami.read_error", org: username))
@env.ui.error(e)
return 1
end
return 1
end
end
end
end
end
end

View File

@ -0,0 +1,75 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module BoxCommand
module Command
class Create < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud box create [options] organization/box-name"
o.separator ""
o.separator "Creates an empty box entry on Vagrant Cloud"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-d", "--description DESCRIPTION", String, "Full description of the box") do |d|
options[:description] = d
end
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |u|
options[:username] = u
end
o.on("-s", "--short-description DESCRIPTION", String, "Short description of the box") do |s|
options[:short] = s
end
o.on("-p", "--private", "Makes box private") do |p|
options[:private] = p
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 1
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
box = argv.first.split('/', 2)
org = box[0]
box_name = box[1]
create_box(org, box_name, options, @client.token)
end
# @param [String] - org
# @param [String] - box_name
# @param [Hash] - options
def create_box(org, box_name, options, access_token)
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
account = VagrantPlugins::CloudCommand::Util.account(org, access_token, server_url)
box = VagrantCloud::Box.new(account, box_name, nil, options[:short], options[:description], access_token)
begin
success = box.create
@env.ui.success(I18n.t("cloud_command.box.create_success", org: org, box_name: box_name))
success = success.delete_if { |_, v| v.nil? }
VagrantPlugins::CloudCommand::Util.format_box_results(success, @env)
return 0
rescue VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.box.create_fail", org: org, box_name: box_name))
@env.ui.error(e)
return 1
end
return 1
end
end
end
end
end
end

View File

@ -0,0 +1,65 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module BoxCommand
module Command
class Delete < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud box delete [options] organization/box-name"
o.separator ""
o.separator "Deletes box entry on Vagrant Cloud"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |u|
options[:username] = u
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 1
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@env.ui.warn(I18n.t("cloud_command.box.delete_warn", box: argv.first))
cont = @env.ui.ask(I18n.t("cloud_command.continue"))
return 1 if cont.strip.downcase != "y"
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
box = argv.first.split('/', 2)
org = box[0]
box_name = box[1]
delete_box(org, box_name, options[:username], @client.token)
end
def delete_box(org, box_name, username, access_token)
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
account = VagrantPlugins::CloudCommand::Util.account(username, access_token, server_url)
box = VagrantCloud::Box.new(account, box_name, nil, nil, nil, access_token)
begin
success = box.delete(org, box_name)
@env.ui.success(I18n.t("cloud_command.box.delete_success", org: org, box_name: box_name))
return 0
rescue VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.box.delete_fail", org: org, box_name: box_name))
@env.ui.error(e)
return 1
end
return 1
end
end
end
end
end
end

View File

@ -0,0 +1,19 @@
require "vagrant"
module VagrantPlugins
module CloudCommand
module BoxCommand
class Plugin < Vagrant.plugin("2")
name "vagrant cloud box"
description <<-DESC
Box life cycle commands for Vagrant Cloud
DESC
command(:box) do
require_relative "root"
Command::Root
end
end
end
end
end

View File

@ -0,0 +1,77 @@
module VagrantPlugins
module CloudCommand
module BoxCommand
module Command
class Root < Vagrant.plugin("2", :command)
def self.synopsis
"Commands to manage boxes on Vagrant Cloud"
end
def initialize(argv, env)
super
@main_args, @sub_command, @sub_args = split_main_and_subcommand(argv)
@subcommands = Vagrant::Registry.new
@subcommands.register(:create) do
require File.expand_path("../create", __FILE__)
Command::Create
end
@subcommands.register(:delete) do
require File.expand_path("../delete", __FILE__)
Command::Delete
end
@subcommands.register(:show) do
require File.expand_path("../show", __FILE__)
Command::Show
end
@subcommands.register(:update) do
require File.expand_path("../update", __FILE__)
Command::Update
end
end
def execute
if @main_args.include?("-h") || @main_args.include?("--help")
# Print the help for all the box commands.
return help
end
# If we reached this far then we must have a subcommand. If not,
# then we also just print the help and exit.
command_class = @subcommands.get(@sub_command.to_sym) if @sub_command
return help if !command_class || !@sub_command
@logger.debug("Invoking command class: #{command_class} #{@sub_args.inspect}")
# Initialize and execute the command class
command_class.new(@sub_args, @env).execute
end
# Prints the help out for this command
def help
opts = OptionParser.new do |opts|
opts.banner = "Usage: vagrant cloud box <subcommand> [<args>]"
opts.separator ""
opts.separator "Commands to manage boxes on Vagrant Cloud"
opts.separator ""
opts.separator "Available subcommands:"
# Add the available subcommands as separators in order to print them
# out as well.
keys = []
@subcommands.each { |key, value| keys << key.to_s }
keys.sort.each do |key|
opts.separator " #{key}"
end
opts.separator ""
opts.separator "For help on any individual subcommand run `vagrant cloud box <subcommand> -h`"
end
@env.ui.info(opts.help, prefix: false)
end
end
end
end
end
end

View File

@ -0,0 +1,74 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module BoxCommand
module Command
class Show < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud box show [options] organization/box-name"
o.separator ""
o.separator "Displays a boxes attributes on Vagrant Cloud"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |u|
options[:username] = u
end
o.on("--versions VERSION", String, "Display box information for a specific version") do |v|
options[:version] = v
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 1
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
box = argv.first.split('/', 2)
show_box(box[0], box[1], options, @client.token)
end
def show_box(org, box_name, options, access_token)
username = options[:username]
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
account = VagrantPlugins::CloudCommand::Util.account(username, access_token, server_url)
box = VagrantCloud::Box.new(account, box_name, nil, nil, nil, access_token)
begin
success = box.read(org, box_name)
if options[:version]
# show *this* version only
results = success["versions"].select{ |v| v if v["version"] == options[:version] }.first
if !results
@env.ui.warn(I18n.t("cloud_command.box.show_filter_empty", version: options[:version], org: org, box_name: box_name))
return 0
end
else
results = success
end
results = results.delete_if { |_, v| v.nil? }
VagrantPlugins::CloudCommand::Util.format_box_results(results, @env)
return 0
rescue VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.box.show_fail", org: org,box_name:box_name))
@env.ui.error(e)
return 1
end
end
end
end
end
end
end

View File

@ -0,0 +1,71 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module BoxCommand
module Command
class Update < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud box update [options] organization/box-name"
o.separator ""
o.separator "Updates a box entry on Vagrant Cloud"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-d", "--description DESCRIPTION", "Full description of the box") do |d|
options[:description] = d
end
o.on("-u", "--username", "The username of the organization that will own the box") do |u|
options[:username] = u
end
o.on("-s", "--short-description DESCRIPTION", "Short description of the box") do |s|
options[:short_description] = s
end
o.on("-p", "--private", "Makes box private") do |p|
options[:private] = p
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 1 || options.length == 0
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
box = argv.first.split('/', 2)
update_box(box[0], box[1], options, @client.token)
end
def update_box(org, box_name, options, access_token)
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
account = VagrantPlugins::CloudCommand::Util.account(options[:username], access_token, server_url)
box = VagrantCloud::Box.new(account, box_name, nil, nil, nil, access_token)
options[:organization] = org
options[:name] = box_name
begin
success = box.update(options)
@env.ui.success(I18n.t("cloud_command.box.update_success", org: org, box_name: box_name))
success = success.delete_if{|_, v|v.nil?}
VagrantPlugins::CloudCommand::Util.format_box_results(success, @env)
return 0
rescue VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.box.update_fail", org: org, box_name: box_name))
@env.ui.error(e)
return 1
end
return 1
end
end
end
end
end
end

View File

@ -0,0 +1,264 @@
require "rest_client"
require "vagrant_cloud"
require "vagrant/util/downloader"
require "vagrant/util/presence"
require Vagrant.source_root.join("plugins/commands/cloud/errors")
module VagrantPlugins
module CloudCommand
class Client
######################################################################
# Class that deals with managing users 'local' token for Vagrant Cloud
######################################################################
APP = "app".freeze
include Vagrant::Util::Presence
attr_accessor :username_or_email
attr_accessor :password
attr_reader :two_factor_default_delivery_method
attr_reader :two_factor_delivery_methods
# Initializes a login client with the given Vagrant::Environment.
#
# @param [Vagrant::Environment] env
def initialize(env)
@logger = Log4r::Logger.new("vagrant::cloud::client")
@env = env
end
# Removes the token, effectively logging the user out.
def clear_token
@logger.info("Clearing token")
token_path.delete if token_path.file?
end
# Checks if the user is logged in by verifying their authentication
# token.
#
# @return [Boolean]
def logged_in?
token = self.token
return false if !token
Vagrant::Util::CredentialScrubber.sensitive(token)
with_error_handling do
url = "#{Vagrant.server_url}/api/v1/authenticate" +
"?access_token=#{token}"
RestClient.get(url, content_type: :json)
true
end
rescue Errors::Unauthorized
false
end
# Login logs a user in and returns the token for that user. The token
# is _not_ stored unless {#store_token} is called.
#
# @param [String] description
# @param [String] code
# @return [String] token The access token, or nil if auth failed.
def login(description: nil, code: nil)
@logger.info("Logging in '#{username_or_email}'")
Vagrant::Util::CredentialScrubber.sensitive(password)
response = post(
"/api/v1/authenticate", {
user: {
login: username_or_email,
password: password
},
token: {
description: description
},
two_factor: {
code: code
}
}
)
Vagrant::Util::CredentialScrubber.sensitive(response["token"])
response["token"]
end
# Requests a 2FA code
# @param [String] delivery_method
def request_code(delivery_method)
@env.ui.warn("Requesting 2FA code via #{delivery_method.upcase}...")
Vagrant::Util::CredentialScrubber.sensitive(password)
response = post(
"/api/v1/two-factor/request-code", {
user: {
login: username_or_email,
password: password
},
two_factor: {
delivery_method: delivery_method.downcase
}
}
)
two_factor = response['two_factor']
obfuscated_destination = two_factor['obfuscated_destination']
@env.ui.success("2FA code sent to #{obfuscated_destination}.")
end
# Issues a post to a Vagrant Cloud path with the given payload.
# @param [String] path
# @param [Hash] payload
# @return [Hash] response data
def post(path, payload)
with_error_handling do
url = File.join(Vagrant.server_url, path)
proxy = nil
proxy ||= ENV["HTTPS_PROXY"] || ENV["https_proxy"]
proxy ||= ENV["HTTP_PROXY"] || ENV["http_proxy"]
RestClient.proxy = proxy
response = RestClient::Request.execute(
method: :post,
url: url,
payload: JSON.dump(payload),
proxy: proxy,
headers: {
accept: :json,
content_type: :json,
user_agent: Vagrant::Util::Downloader::USER_AGENT,
},
)
JSON.load(response.to_s)
end
end
# Stores the given token locally, removing any previous tokens.
#
# @param [String] token
def store_token(token)
@logger.info("Storing token in #{token_path}")
token_path.open("w") do |f|
f.write(token)
end
nil
end
# Reads the access token if there is one. This will first read the
# `VAGRANT_CLOUD_TOKEN` environment variable and then fallback to the stored
# access token on disk.
#
# @return [String]
def token
if present?(ENV["VAGRANT_CLOUD_TOKEN"]) && token_path.exist?
@env.ui.warn <<-EOH.strip
Vagrant detected both the VAGRANT_CLOUD_TOKEN environment variable and a Vagrant login
token are present on this system. The VAGRANT_CLOUD_TOKEN environment variable takes
precedence over the locally stored token. To remove this error, either unset
the VAGRANT_CLOUD_TOKEN environment variable or remove the login token stored on disk:
~/.vagrant.d/data/vagrant_login_token
EOH
end
if present?(ENV["VAGRANT_CLOUD_TOKEN"])
@logger.debug("Using authentication token from environment variable")
return ENV["VAGRANT_CLOUD_TOKEN"]
end
if token_path.exist?
@logger.debug("Using authentication token from disk at #{token_path}")
return token_path.read.strip
end
if present?(ENV["ATLAS_TOKEN"])
@logger.warn("ATLAS_TOKEN detected within environment. Using ATLAS_TOKEN in place of VAGRANT_CLOUD_TOKEN.")
return ENV["ATLAS_TOKEN"]
end
@logger.debug("No authentication token in environment or #{token_path}")
nil
end
protected
def with_error_handling(&block)
yield
rescue RestClient::Unauthorized
@logger.debug("Unauthorized!")
raise Errors::Unauthorized
rescue RestClient::BadRequest => e
@logger.debug("Bad request:")
@logger.debug(e.message)
@logger.debug(e.backtrace.join("\n"))
parsed_response = JSON.parse(e.response)
errors = parsed_response["errors"].join("\n")
raise Errors::ServerError, errors: errors
rescue RestClient::NotAcceptable => e
@logger.debug("Got unacceptable response:")
@logger.debug(e.message)
@logger.debug(e.backtrace.join("\n"))
parsed_response = JSON.parse(e.response)
if two_factor = parsed_response['two_factor']
store_two_factor_information two_factor
if two_factor_default_delivery_method != APP
request_code two_factor_default_delivery_method
end
raise Errors::TwoFactorRequired
end
begin
errors = parsed_response["errors"].join("\n")
raise Errors::ServerError, errors: errors
rescue JSON::ParserError; end
@logger.debug("Got an unexpected error:")
@logger.debug(e.inspect)
raise Errors::Unexpected, error: e.inspect
rescue SocketError
@logger.info("Socket error")
raise Errors::ServerUnreachable, url: Vagrant.server_url.to_s
end
def token_path
@env.data_dir.join("vagrant_login_token")
end
def store_two_factor_information(two_factor)
@two_factor_default_delivery_method =
two_factor['default_delivery_method']
@two_factor_delivery_methods =
two_factor['delivery_methods']
@env.ui.warn "2FA is enabled for your account."
if two_factor_default_delivery_method == APP
@env.ui.info "Enter the code from your authenticator."
else
@env.ui.info "Default method is " \
"'#{two_factor_default_delivery_method}'."
end
other_delivery_methods =
two_factor_delivery_methods - [APP]
if other_delivery_methods.any?
other_delivery_methods_sentence = other_delivery_methods
.map { |word| "'#{word}'" }
.join(' or ')
@env.ui.info "You can also type #{other_delivery_methods_sentence} " \
"to request a new code."
end
end
end
end
end

View File

@ -0,0 +1,28 @@
module VagrantPlugins
module CloudCommand
module Errors
class Error < Vagrant::Errors::VagrantError
error_namespace("cloud_command.errors")
end
class ServerError < Error
error_key(:server_error)
end
class ServerUnreachable < Error
error_key(:server_unreachable)
end
class Unauthorized < Error
error_key(:unauthorized)
end
class Unexpected < Error
error_key(:unexpected_error)
end
class TwoFactorRequired < Error
end
end
end
end

View File

@ -0,0 +1,52 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module Command
class List < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud list [options] organization"
o.separator ""
o.separator "Search for boxes managed by a specific user/organization"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-j", "--json", "Formats results in JSON") do |j|
options[:check] = j
end
o.on("-l", "--limit", Integer, "Max number of search results (default is 25)") do |l|
options[:check] = l
end
o.on("-p", "--provider", "Comma separated list of providers to filter search. Defaults to all.") do |p|
options[:check] = p
end
o.on("-s", "--sort-by", "Column to sort list (created, downloads, updated)") do |s|
options[:check] = s
end
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |t|
options[:username] = u
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.length > 1
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
# TODO: This endpoint is not implemented yet
0
end
end
end
end
end

View File

@ -0,0 +1,171 @@
en:
cloud_command:
middleware:
authentication:
different_target: |-
Vagrant has detected a custom Vagrant server in use for downloading
box files. An authentication token is currently set which will be
added to the box request. If the custom Vagrant server should not
be receiving the authentication token, please unset it.
Known Vagrant server: %{known_host}
Custom Vagrant server: %{custom_host}
Press ctrl-c to cancel...
publish:
update_continue: |-
%{obj} already exists, updating instead...
box_create:
Creating a box entry...
version_create:
Creating a version entry...
provider_create:
Creating a provider entry...
upload_provider:
Uploading provider with file %{file}
release:
Releasing box...
complete:
Complete! Published %{org}/%{box_name}
confirm:
warn: |-
You are about to publish a box on Vagrant Cloud with the following options:
box: |-
%{org}/%{box_name}: (v%{version}) for provider '%{provider_name}'
private: |-
Private: true
release: |-
Automatic Release: true
box_url: |-
Remote Box file: %{url}
box_description: |-
Box Description: %{description}
box_short_desc: |-
Box Short Description: %{short_description}
version_desc: |-
Version Description: %{version_description}
continue: |-
Do you wish to continue? [y/N]
box:
show_filter_empty: |-
No version matched %{version} for %{org}/%{box_name}
create_success: |-
Created box %{org}/%{box_name}
delete_success: |-
Deleted box %{org}/%{box_name}
delete_warn: |-
This will completely remove %{box} from Vagrant Cloud. This cannot be undone.
update_success: |-
Updated box %{org}/%{box_name}
search:
no_results: |-
No results found for `%{query}`
upload:
no_url: |-
No URL was provided to upload the provider
You will need to run the `vagrant cloud provider upload` command to provide a box
provider:
upload: |-
Uploading box file for '%{org}/%{box_name}' (v%{version}) for provider: '%{provider}'
upload_success: |-
Uploaded provider %{provider} on %{org}/%{box_name} for version %{version}
delete_warn: |-
This will completely remove provider %{provider} on version %{version} from %{box} on Vagrant Cloud. This cannot be undone.
create_success: |-
Created provider %{provider} on %{org}/%{box_name} for version %{version}
delete_success: |-
Deleted provider %{provider} on %{org}/%{box_name} for version %{version}
update_success: |-
Updated provider %{provider} on %{org}/%{box_name} for version %{version}
version:
create_success: |-
Created version %{version} on %{org}/%{box_name} for version %{version}
delete_success: |-
Deleted version %{version} on %{org}/%{box_name}
release_success: |-
Released version %{version} on %{org}/%{box_name}
revoke_success: |-
Revoked version %{version} on %{org}/%{box_name}
update_success: |-
Updated version %{version} on %{org}/%{box_name}
revoke_warn: |-
This will revoke version %{version} from %{box} from Vagrant Cloud. This cannot be undone.
release_warn: |-
This will release version %{version} from %{box} to Vagrant Cloud and be available to download.
delete_warn: |-
This will completely remove version %{version} from %{box} from Vagrant Cloud. This cannot be undone.
errors:
search:
fail: |-
Could not complete search request
publish:
fail: |-
Failed to create box %{org}/%{box_name}
box:
create_fail: |-
Failed to create box %{org}/%{box_name}
delete_fail: |-
Failed to delete box %{org}/%{box_name}
show_fail: |-
Could not get information about box %{org}/%{box_name}
update_fail: |-
Failed to update box %{org}/%{box_name}
whoami:
read_error: |-
Failed to read organization %{org}
provider:
create_fail: |-
Failed to create provider %{provider} on box %{org}/%{box_name} for version %{version}
update_fail: |-
Failed to update provider %{provider} on box %{org}/%{box_name} for version %{version}
delete_fail: |-
Failed to delete provider %{provider} on box %{org}/%{box_name} for version %{version}
upload_fail: |-
Failed to upload provider %{provider} on box %{org}/%{box_name} for version %{version}
version:
create_fail: |-
Failed to create version %{version} on box %{org}/%{box_name}
delete_fail: |-
Failed to delete version %{version} on box %{org}/%{box_name}
release_fail: |-
Failed to release version %{version} on box %{org}/%{box_name}
revoke_fail: |-
Failed to revoke version %{version} on box %{org}/%{box_name}
update_fail: |-
Failed to update version %{version} on box %{org}/%{box_name}
server_error: |-
The Vagrant Cloud server responded with a not-OK response:
%{errors}
server_unreachable: |-
The Vagrant Cloud server is not currently accepting connections. Please check
your network connection and try again later.
unauthorized: |-
Invalid username or password. Please try again.
unexpected_error: |-
An unexpected error occurred: %{error}
check_logged_in: |-
You are already logged in.
check_not_logged_in: |-
You are not currently logged in. Please run `vagrant login` and provide
your login information to authenticate.
command_header: |-
In a moment we will ask for your username and password to HashiCorp's
Vagrant Cloud. After authenticating, we will store an access token locally on
disk. Your login details will be transmitted over a secure connection, and
are never stored on disk locally.
If you do not have an Vagrant Cloud account, sign up at
https://www.vagrantcloud.com
invalid_login: |-
Invalid username or password. Please try again.
invalid_token: |-
Invalid token. Please try again.
logged_in: |-
You are now logged in.
logged_out: |-
You are logged out.
token_saved: |-
The token was successfully saved.

View File

@ -0,0 +1,35 @@
require "vagrant"
require 'vagrant_cloud'
require Vagrant.source_root.join("plugins/commands/cloud/util")
require Vagrant.source_root.join("plugins/commands/cloud/client/client")
module VagrantPlugins
module CloudCommand
class Plugin < Vagrant.plugin("2")
name "vagrant-cloud"
description <<-DESC
Provides the cloud command and internal API access to Vagrant Cloud.
DESC
command(:cloud) do
require_relative "root"
init!
Command::Root
end
action_hook(:cloud_authenticated_boxes, :authenticate_box_url) do |hook|
require_relative "auth/middleware/add_authentication"
hook.prepend(AddAuthentication)
end
protected
def self.init!
return if defined?(@_init)
I18n.load_path << File.expand_path("../locales/en.yml", __FILE__)
I18n.reload!
@_init = true
end
end
end
end

View File

@ -0,0 +1,80 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module ProviderCommand
module Command
class Create < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud provider create [options] organization/box-name provider-name version [url]"
o.separator ""
o.separator "Creates a provider entry on Vagrant Cloud"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |u|
options[:username] = u
end
o.on("-c", "--checksum CHECKSUM_VALUE", String, "Checksum of the box for this provider. --checksum-type option is required.") do |c|
options[:checksum] = c
end
o.on("-C", "--checksum-type TYPE", String, "Type of checksum used (md5, sha1, sha256, sha384, sha512). --checksum option is required.") do |c|
options[:checksum_type] = c
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 4
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
box = argv.first.split('/', 2)
org = box[0]
box_name = box[1]
provider_name = argv[1]
version = argv[2]
url = argv[3]
upload_provider(org, box_name, provider_name, version, url, @client.token, options)
end
def upload_provider(org, box_name, provider_name, version, url, access_token, options)
if !url
@env.ui.warn(I18n.t("cloud_command.upload.no_url"))
end
org = options[:username] if options[:username]
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
account = VagrantPlugins::CloudCommand::Util.account(org, access_token, server_url)
box = VagrantCloud::Box.new(account, box_name, nil, nil, nil, access_token)
cloud_version = VagrantCloud::Version.new(box, version, nil, nil, access_token)
provider = VagrantCloud::Provider.new(cloud_version, provider_name, nil, url, org, box_name,
access_token, nil, options[:checksum], options[:checksum_type])
begin
success = provider.create_provider
@env.ui.success(I18n.t("cloud_command.provider.create_success", provider: provider_name, org: org, box_name: box_name, version: version))
success = success.compact
VagrantPlugins::CloudCommand::Util.format_box_results(success, @env)
return 0
rescue VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.provider.create_fail", provider: provider_name, org: org, box_name: box_name, version: version))
@env.ui.error(e)
return 1
end
end
end
end
end
end
end

View File

@ -0,0 +1,70 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module ProviderCommand
module Command
class Delete < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud provider delete [options] organization/box-name provider-name version"
o.separator ""
o.separator "Deletes a provider entry on Vagrant Cloud"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |u|
options[:username] = u
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 3
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
box = argv.first.split('/', 2)
org = box[0]
box_name = box[1]
provider_name = argv[1]
version = argv[2]
@env.ui.warn(I18n.t("cloud_command.provider.delete_warn", provider: provider_name, version:version, box: argv.first))
cont = @env.ui.ask(I18n.t("cloud_command.continue"))
return 1 if cont.strip.downcase != "y"
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
delete_provider(org, box_name, provider_name, version, @client.token, options)
end
def delete_provider(org, box_name, provider_name, version, access_token, options)
org = options[:username] if options[:username]
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
account = VagrantPlugins::CloudCommand::Util.account(org, access_token, server_url)
box = VagrantCloud::Box.new(account, box_name, nil, nil, nil, access_token)
cloud_version = VagrantCloud::Version.new(box, version, nil, nil, access_token)
provider = VagrantCloud::Provider.new(cloud_version, provider_name, nil, nil, nil, nil, access_token)
begin
success = provider.delete
@env.ui.error(I18n.t("cloud_command.provider.delete_success", provider: provider_name, org: org, box_name: box_name, version: version))
return 0
rescue VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.provider.delete_fail", provider: provider_name, org: org, box_name: box_name, version: version))
@env.ui.error(e)
return 1
end
end
end
end
end
end
end

View File

@ -0,0 +1,19 @@
require "vagrant"
module VagrantPlugins
module CloudCommand
module ProviderCommand
class Plugin < Vagrant.plugin("2")
name "vagrant cloud box"
description <<-DESC
Provider life cycle commands for Vagrant Cloud
DESC
command(:provider) do
require_relative "root"
Command::Root
end
end
end
end
end

View File

@ -0,0 +1,77 @@
module VagrantPlugins
module CloudCommand
module ProviderCommand
module Command
class Root < Vagrant.plugin("2", :command)
def self.synopsis
"Provider commands"
end
def initialize(argv, env)
super
@main_args, @sub_command, @sub_args = split_main_and_subcommand(argv)
@subcommands = Vagrant::Registry.new
@subcommands.register(:create) do
require File.expand_path("../create", __FILE__)
Command::Create
end
@subcommands.register(:delete) do
require File.expand_path("../delete", __FILE__)
Command::Delete
end
@subcommands.register(:update) do
require File.expand_path("../update", __FILE__)
Command::Update
end
@subcommands.register(:upload) do
require File.expand_path("../upload", __FILE__)
Command::Upload
end
end
def execute
if @main_args.include?("-h") || @main_args.include?("--help")
# Print the help for all the provider commands.
return help
end
# If we reached this far then we must have a subcommand. If not,
# then we also just print the help and exit.
command_class = @subcommands.get(@sub_command.to_sym) if @sub_command
return help if !command_class || !@sub_command
@logger.debug("Invoking command class: #{command_class} #{@sub_args.inspect}")
# Initialize and execute the command class
command_class.new(@sub_args, @env).execute
end
# Prints the help out for this command
def help
opts = OptionParser.new do |opts|
opts.banner = "Usage: vagrant cloud provider <subcommand> [<args>]"
opts.separator ""
opts.separator "For various provider actions with Vagrant Cloud"
opts.separator ""
opts.separator "Available subcommands:"
# Add the available subcommands as separators in order to print them
# out as well.
keys = []
@subcommands.each { |key, value| keys << key.to_s }
keys.sort.each do |key|
opts.separator " #{key}"
end
opts.separator ""
opts.separator "For help on any individual subcommand run `vagrant cloud provider <subcommand> -h`"
end
@env.ui.info(opts.help, prefix: false)
end
end
end
end
end
end

View File

@ -0,0 +1,80 @@
require 'optparse'
module VagrantPlugins
module CloudCommand
module ProviderCommand
module Command
class Update < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud provider update [options] organization/box-name provider-name version url"
o.separator ""
o.separator "Updates a provider entry on Vagrant Cloud"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |u|
options[:username] = u
end
o.on("-c", "--checksum CHECKSUM_VALUE", String, "Checksum of the box for this provider. --checksum-type option is required.") do |c|
options[:checksum] = c
end
o.on("-C", "--checksum-type TYPE", String, "Type of checksum used (md5, sha1, sha256, sha384, sha512). --checksum option is required.") do |c|
options[:checksum_type] = c
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 4
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
box = argv.first.split('/', 2)
org = box[0]
box_name = box[1]
provider_name = argv[1]
version = argv[2]
url = argv[3]
update_provider(org, box_name, provider_name, version, url, @client.token, options)
end
def update_provider(org, box_name, provider_name, version, url, access_token, options)
if !url
@env.ui.warn(I18n.t("cloud_command.upload.no_url"))
end
org = options[:username] if options[:username]
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
account = VagrantPlugins::CloudCommand::Util.account(org, access_token, server_url)
box = VagrantCloud::Box.new(account, box_name, nil, nil, nil, access_token)
cloud_version = VagrantCloud::Version.new(box, version, nil, nil, access_token)
provider = VagrantCloud::Provider.new(cloud_version, provider_name, nil, url, org, box_name,
access_token, nil, options[:checksum], options[:checksum_type])
begin
success = provider.update
@env.ui.success(I18n.t("cloud_command.provider.update_success", provider:provider_name, org: org, box_name: box_name, version: version))
success = success.delete_if{|_, v|v.nil?}
VagrantPlugins::CloudCommand::Util.format_box_results(success, @env)
return 0
rescue VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.provider.update_fail", provider:provider_name, org: org, box_name: box_name, version: version))
@env.ui.error(e)
return 1
end
end
end
end
end
end
end

View File

@ -0,0 +1,75 @@
require 'optparse'
require "vagrant/util/uploader"
module VagrantPlugins
module CloudCommand
module ProviderCommand
module Command
class Upload < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud provider upload [options] organization/box-name provider-name version box-file"
o.separator ""
o.separator "Uploads a box file to Vagrant Cloud for a specific provider"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |u|
options[:username] = u
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 4
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
box = argv.first.split('/', 2)
org = box[0]
box_name = box[1]
provider_name = argv[1]
version = argv[2]
file = argv[3] # path expand
upload_provider(org, box_name, provider_name, version, file, @client.token, options)
end
def upload_provider(org, box_name, provider_name, version, file, access_token, options)
org = options[:username] if options[:username]
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
account = VagrantPlugins::CloudCommand::Util.account(org, access_token, server_url)
box = VagrantCloud::Box.new(account, box_name, nil, nil, nil, access_token)
cloud_version = VagrantCloud::Version.new(box, version, nil, nil, access_token)
provider = VagrantCloud::Provider.new(cloud_version, provider_name, nil, nil, org, box_name, access_token)
ul = Vagrant::Util::Uploader.new(provider.upload_url, file, ui: @env.ui)
ui = Vagrant::UI::Prefixed.new(@env.ui, "cloud")
begin
ui.output(I18n.t("cloud_command.provider.upload", org: org, box_name: box_name, version: version, provider: provider_name))
ui.info("Upload File: #{file}")
ul.upload!
ui.success("Successfully uploaded box '#{org}/#{box_name}' (v#{version}) for '#{provider_name}'")
return 0
rescue Vagrant::Errors::UploaderError, VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.provider.upload_fail", provider: provider_name, org: org, box_name: box_name, version: version))
@env.ui.error(e)
return 1
end
end
end
end
end
end
end

View File

@ -0,0 +1,183 @@
require 'optparse'
require "vagrant/util/uploader"
module VagrantPlugins
module CloudCommand
module Command
class Publish < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant cloud publish [options] organization/box-name version provider-name provider-file"
o.separator ""
o.separator "Create and release a new Vagrant Box on Vagrant Cloud"
o.separator ""
o.separator "Options:"
o.separator ""
o.on("--box-version VERSION", String, "Version of box to create") do |v|
options[:box_version] = v
end
o.on("--url URL", String, "Remote URL to download this provider") do |u|
options[:url] = u
end
o.on("-d", "--description DESCRIPTION", String, "Full description of box") do |d|
options[:description] = d
end
o.on("--version-description DESCRIPTION", String, "Description of the version to create") do |v|
options[:version_description] = v
end
o.on("-f", "--force", "Disables confirmation to create or update box") do |f|
options[:force] = f
end
o.on("-p", "--private", "Makes box private") do |p|
options[:private] = p
end
o.on("-r", "--release", "Releases box") do |p|
options[:release] = p
end
o.on("-s", "--short-description DESCRIPTION", String, "Short description of the box") do |s|
options[:short_description] = s
end
o.on("-u", "--username USERNAME_OR_EMAIL", String, "Vagrant Cloud username or email address") do |u|
options[:username] = u
end
o.on("-c", "--checksum CHECKSUM_VALUE", String, "Checksum of the box for this provider. --checksum-type option is required.") do |c|
options[:checksum] = c
end
o.on("-C", "--checksum-type TYPE", String, "Type of checksum used (md5, sha1, sha256, sha384, sha512). --checksum option is required.") do |c|
options[:checksum_type] = c
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 4 || argv.length < 3 || (argv.length == 3 && !options[:url])
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
box = argv.first.split('/', 2)
org = box[0]
box_name = box[1]
version = argv[1]
provider_name = argv[2]
box_file = argv[3]
if !options[:url] && !File.file?(box_file)
raise Vagrant::Errors::BoxFileNotExist,
file: box_file
end
@client = VagrantPlugins::CloudCommand::Util.client_login(@env, options[:username])
publish_box(org, box_name, version, provider_name, box_file, options, @client.token)
end
def publish_box(org, box_name, version, provider_name, box_file, options, access_token)
server_url = VagrantPlugins::CloudCommand::Util.api_server_url
@env.ui.warn(I18n.t("cloud_command.publish.confirm.warn"))
@env.ui.info(I18n.t("cloud_command.publish.confirm.box", org: org,
box_name: box_name, version: version, provider_name: provider_name))
@env.ui.info(I18n.t("cloud_command.publish.confirm.private")) if options[:private]
@env.ui.info(I18n.t("cloud_command.publish.confirm.release")) if options[:release]
@env.ui.info(I18n.t("cloud_command.publish.confirm.box_url",
url: options[:url])) if options[:url]
@env.ui.info(I18n.t("cloud_command.publish.confirm.box_description",
description: options[:description])) if options[:description]
@env.ui.info(I18n.t("cloud_command.publish.confirm.box_short_desc",
short_description: options[:short_description])) if options[:short_description]
@env.ui.info(I18n.t("cloud_command.publish.confirm.version_desc",
version_description: options[:version_description])) if options[:version_description]
if !options[:force]
cont = @env.ui.ask(I18n.t("cloud_command.continue"))
return 1 if cont.strip.downcase != "y"
end
account = VagrantPlugins::CloudCommand::Util.account(org, access_token, server_url)
box = VagrantCloud::Box.new(account, box_name, nil, options[:short_description], options[:description], access_token)
cloud_version = VagrantCloud::Version.new(box, version, nil, options[:version_description], access_token)
provider = VagrantCloud::Provider.new(cloud_version, provider_name, nil, options[:url], org, box_name,
access_token, nil, options[:checksum], options[:checksum_type])
ui = Vagrant::UI::Prefixed.new(@env.ui, "cloud")
begin
ui.info(I18n.t("cloud_command.publish.box_create"))
box.create
rescue VagrantCloud::ClientError => e
if e.error_code == 422
ui.warn(I18n.t("cloud_command.publish.update_continue", obj: "Box"))
box.update(options)
else
@env.ui.error(I18n.t("cloud_command.errors.publish.fail", org: org, box_name: box_name))
@env.ui.error(e)
return 1
end
end
begin
ui.info(I18n.t("cloud_command.publish.version_create"))
cloud_version.create_version
rescue VagrantCloud::ClientError => e
if e.error_code == 422
ui.warn(I18n.t("cloud_command.publish.update_continue", obj: "Version"))
cloud_version.update
else
@env.ui.error(I18n.t("cloud_command.errors.publish.fail", org: org, box_name: box_name))
@env.ui.error(e)
return 1
end
rescue VagrantCloud::InvalidVersion => e
@env.ui.error(I18n.t("cloud_command.errors.publish.fail", org: org, box_name: box_name))
@env.ui.error(e)
return 1
end
begin
ui.info(I18n.t("cloud_command.publish.provider_create"))
provider.create_provider
rescue VagrantCloud::ClientError => e
if e.error_code == 422
ui.warn(I18n.t("cloud_command.publish.update_continue", obj: "Provider"))
provider.update
else
@env.ui.error(I18n.t("cloud_command.errors.publish.fail", org: org, box_name: box_name))
@env.ui.error(e)
return 1
end
end
begin
if !options[:url]
box_file = File.absolute_path(box_file)
ui.info(I18n.t("cloud_command.publish.upload_provider", file: box_file))
ul = Vagrant::Util::Uploader.new(provider.upload_url, box_file, ui: @env.ui)
ul.upload!
end
if options[:release]
ui.info(I18n.t("cloud_command.publish.release"))
cloud_version.release
end
@env.ui.success(I18n.t("cloud_command.publish.complete", org: org, box_name: box_name))
success = box.read(org, box_name)
success = success.delete_if{|_, v|v.nil?}
VagrantPlugins::CloudCommand::Util.format_box_results(success, @env)
return 0
rescue Vagrant::Errors::UploaderError, VagrantCloud::ClientError => e
@env.ui.error(I18n.t("cloud_command.errors.publish.fail", org: org, box_name: box_name))
@env.ui.error(e)
return 1
end
return 1
end
end
end
end
end

Some files were not shown because too many files have changed in this diff Show More