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.
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.
"sed -i" is specific to GNU sed and is not a posix standard option.
The default sed command in Solaris is not GNU sed though it is possible
to install the GNU-sed which includes /usr/bin/gsed
SLE 11 does not ship systemd and then using systemctl poweroff does not
work. Therefore we fall back to using /sbin/shutdown for machines without
systemd.
This fixes https://github.com/hashicorp/vagrant/issues/12487
We have started seeing occasional shutdown failures on openSUSE Tumbleweed with
Virtualbox inside a qemu virtual machine, where `shutdown -h now` would return
nil. While the machine is successfully turned off, the command fails and vagrant
reports an error.
This commit changes the shutdown command to launch in the background which
also triggers a shutdown, but always succeeds.
This adds a check to the `#wait_for_reboot` method on the linux
guest reboot capability to determine if the a reboot is still
in process. This prevents the reboot process from being initiated
and the `#ready?` check on the guest being called before the
system shutdown process has shutdown the communicator process.
Keep the default duration as a constant and fetch the custom environment
variable at run time with a fallback to the default. Set the sleep duration
into a constant and add tests covering the expected behaviors when the
default duration is in use as well as the override value. Also match the
environment variable up with the constant just for consistency.
Previously the maximum amount of time Vagrant would poll for whether a
machine has successfully reboot was hard coded to 120 seconds. This
change introduces the VAGRANT_MAX_REBOOT_RETRY_TIMEOUT environment
variable to allow this attribute to be configurable.
Add RSpec tests of the maximum retry logic. Since the maximum retries
are configured as a constant, we'd need to reload the class and that's
fairly ugly to do in RSpec.
Fixes#11695
Leaving out smbclient from the install will cause a cyclical
dependency error.
```
Was getting error
Stderr from the command:
warning: dependency cycle detected:
warning: smbclient will be installed before its cifs-utils dependency
error: failed to commit transaction (conflicting files)
```