Sha256: 2415dd794484ef48cbdd0b63877df94460ac525ca03598ec71aa1af976a88ed3

Contents?: true

Size: 800 Bytes

Versions: 47

Compression:

Stored size: 800 Bytes

Contents

module VagrantPlugins
  module GuestLinux
    class Guest < Vagrant.plugin("2", :guest)
      # Name used for guest detection
      GUEST_DETECTION_NAME = "linux".freeze

      def detect?(machine)
        machine.communicate.test <<-EOH.gsub(/^ */, '')
          if test -r /etc/os-release; then
            source /etc/os-release && test 'x#{self.class.const_get(:GUEST_DETECTION_NAME)}' = "x$ID" && exit
          fi
          if test -x /usr/bin/lsb_release; then
            /usr/bin/lsb_release -i 2>/dev/null | grep -qi '#{self.class.const_get(:GUEST_DETECTION_NAME)}' && exit
          fi
          if test -r /etc/issue; then
            cat /etc/issue | grep -qi '#{self.class.const_get(:GUEST_DETECTION_NAME)}' && exit
          fi
          exit 1
        EOH
      end
    end
  end
end

Version data entries

47 entries across 43 versions & 5 rubygems

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