Adds an override for the #read_network_interfaces when hostonlynetworks
are in use to properly identify the hostonly network information from
the guest. This also adjusts the IP provided for the network to be
the first in the subnet.
If the value of the machine folder can not be found in the
system properties, report a user friendly error message and
include relevant information in the logs for debugging.
The error details message should just be one string without spacing
so the terminal can set a output length. This will allow messages
from Ruby and Go errors to have similar formating.
Instead of having to update these flavor.rb files every time a
new version of CentOS/RHEL come out let's dynamically pick up
the version (7,8,9) from the machine.
This was inspired slightly by the Rocky Linux guest flavor.rb.
This migrates the CentOS guest plugin to identify machines by
what is in os-release rather than based on if the /etc/centos-release
file exists.
It just so happens that the Rocky Linux plugin is set up to inherit
directly from :redhat (not :centos) and thus the CentOS flavor is
attempted before Rocky in the depth first search. For some reason
the rockylinux/8 vagrant box still has the /etc/centos-release file
in it even though it's only supposed to inherit from RHEL.
The almalinux/9 box does not have /etc/centos-release.
find_types works fine until you have a module which has the same name but different case. For example, the VagrantVmware package is HashiCorp::VagrantVMwareDesktop. All the protos are at Hashicorp::Vagrant::… So, you end up with this fun
Object.constants.select { |n| n.to_s.downcase == "hashicorp" }
=> [:HashiCorp, :Hashicorp]
So, when trying to walk down the modules to find the right type to unany to, Vagrant sometimes takes the wrong path (eg. Down the HashiCorp module instead of the Hashicorp module).
This change will keep a list of the parent modules when walking down the module list. This way if a dead end is reached then Vagrant can go a level back and keep searching for the correct class.
Turns out I misinterpreted the behavior of a ruby method with a default
being passed nil so I assumed :parallel was effectively defaulting to
true when it is the opposite.
Starting a rocky 9 box (having nfs shares) fails with: `No match for argument: nfs-utils-lib`.
Apparently Rocky 9 does not have a `nfs-utils-lib` but mounting nfs shares without nfs-utils-lib works fine.
So updating the nfs client install to only install `nfs-utils-lib` if the package is available. That way older rhel clones
should continue to work as well.
This removes the need for the validation workaround for Docker, because
box_updated is once again available in that context.
We don't technically need the SyncedFolder priorities back on the Ruby
side, but wiring them through for symmetry.
Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/183
By pruning machines that are in "unknown" status after each operation,
the Go code path exposed the fact that the Docker provider was not
updating the machine index during an "up" - leaving the state as
"unknown".
This is basically a bug within the Docker provider, so I think it's okay
to update the plugin code to correct this rather than working around the
issue in Go.
All we need to do is call `machine.state` instead of reaching through to
`machine.provider.state` while waiting for the container to be started.
That causes the extra logic for updating the machine index in
`machine.state` to fire.