2014-08-31 05:44:48 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestRedHat
|
|
|
|
module Cap
|
|
|
|
class Flavor
|
|
|
|
def self.flavor(machine)
|
|
|
|
# Read the version file
|
|
|
|
output = ""
|
2016-06-05 23:10:19 +00:00
|
|
|
machine.communicate.sudo("cat /etc/redhat-release") do |_, data|
|
|
|
|
output = data
|
2014-08-31 05:44:48 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Detect various flavors we care about
|
2016-06-12 13:51:55 +00:00
|
|
|
if output =~ /(CentOS|Red Hat Enterprise|Scientific|Cloud)\s*Linux( .+)? release 7/i
|
2014-08-31 05:44:48 +00:00
|
|
|
return :rhel_7
|
|
|
|
else
|
|
|
|
return :rhel
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|