Sha256: 8d285c3d902a1cb38bd8281b82b998671b7dcf4d0c285fe04c74aa4ba993c2d8

Contents?: true

Size: 810 Bytes

Versions: 63

Compression:

Stored size: 810 Bytes

Contents

require "pathname"

require "vagrant"

module VagrantPlugins
  module HostRedHat
    class Host < Vagrant.plugin("2", :host)
      def detect?(env)
        release_file = Pathname.new("/etc/redhat-release")

        if release_file.exist?
          release_file.open("r:ISO-8859-1:UTF-8") do |f|
            contents = f.gets
            return true if contents =~ /^CentOS/ # CentOS
            return true if contents =~ /^Fedora/ # Fedora
            return true if contents =~ /^Korora/ # Korora

            # Oracle Linux < 5.3
            return true if contents =~ /^Enterprise Linux Enterprise Linux/

            # Red Hat Enterprise Linux and Oracle Linux >= 5.3
            return true if contents =~ /^Red Hat Enterprise Linux/
          end
        end

        false
      end
    end
  end
end

Version data entries

63 entries across 56 versions & 8 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/hosts/redhat/host.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/hosts/redhat/host.rb
vagrant-unbundled-2.3.3.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.3.2.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.19.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.18.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.16.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.14.0 plugins/hosts/redhat/host.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.10.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.9.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.8.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.7.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.6.2 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.6.1 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.6.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.5.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.4.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.3.0 plugins/hosts/redhat/host.rb
vagrant-unbundled-2.2.2.0 plugins/hosts/redhat/host.rb