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-1.9.8.1 plugins/hosts/redhat/host.rb
vagrant-unbundled-1.9.7.1 plugins/hosts/redhat/host.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/hosts/redhat/host.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/hosts/redhat/host.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/hosts/redhat/host.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/hosts/redhat/host.rb
vagrant-unbundled-1.9.5.1 plugins/hosts/redhat/host.rb
vagrant-unbundled-1.9.1.1 plugins/hosts/redhat/host.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/hosts/redhat/host.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/hosts/redhat/host.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/hosts/redhat/host.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/hosts/redhat/host.rb
vagrant-unbundled-1.8.5.2 plugins/hosts/redhat/host.rb
vagrant-unbundled-1.8.5.1 plugins/hosts/redhat/host.rb
vagrant-unbundled-1.8.4.2 plugins/hosts/redhat/host.rb
vagrant-unbundled-1.8.4.1 plugins/hosts/redhat/host.rb
vagrant-unbundled-1.8.1.2 plugins/hosts/redhat/host.rb
vagrant-unbundled-1.8.1.1 plugins/hosts/redhat/host.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/plugins/hosts/redhat/host.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/plugins/hosts/redhat/host.rb