vagrant/plugins/guests/redhat/cap/flavor.rb

23 lines
539 B
Ruby
Raw Normal View History

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
end
# Detect various flavors we care about
if output =~ /(CentOS|Red Hat Enterprise|Scientific) Linux( .+)? release 7/i
return :rhel_7
else
return :rhel
end
end
end
end
end
end