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.
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.
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.
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.
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.
- 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.