guests/centos: use GUEST_DETECTION_NAME='centos' to ID CentOS
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.
This commit is contained in:
parent
3b1e277f72
commit
4336aff67d
@ -1,9 +1,11 @@
|
||||
require "vagrant"
|
||||
require_relative '../linux/guest'
|
||||
|
||||
module VagrantPlugins
|
||||
module GuestCentos
|
||||
class Guest < Vagrant.plugin("2", :guest)
|
||||
def detect?(machine)
|
||||
machine.communicate.test("cat /etc/centos-release")
|
||||
end
|
||||
class Guest < VagrantPlugins::GuestLinux::Guest
|
||||
# Name used for guest detection
|
||||
GUEST_DETECTION_NAME = "centos".freeze
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user