class VagrantVbguest::Installers::Suse
Public Class Methods
match?(vm)
click to toggle source
To distingish between OpenSuse
and SLEs (both shows up as “suse”), check for presence of the zypper and entry on os-release
# File lib/vagrant-vbguest/installers/suse.rb, line 7 def self.match?(vm) :suse == self.distro(vm) && has_zypper?(vm) && sles?(vm) end
Protected Class Methods
has_zypper?(vm)
click to toggle source
# File lib/vagrant-vbguest/installers/suse.rb, line 23 def self.has_zypper?(vm) communicate_to(vm).test "which zypper" end
sles?(vm)
click to toggle source
# File lib/vagrant-vbguest/installers/suse.rb, line 18 def self.sles?(vm) osr = self.os_release(vm) osr && osr["ID"] == "sles" end
Public Instance Methods
install(opts=nil, &block)
click to toggle source
Install missing deps and yield up to regular linux installation
Calls superclass method
VagrantVbguest::Installers::Linux#install
# File lib/vagrant-vbguest/installers/suse.rb, line 12 def install(opts=nil, &block) communicate.sudo(install_dependencies_cmd, opts, &block) super end
Protected Instance Methods
dependencies()
click to toggle source
# File lib/vagrant-vbguest/installers/suse.rb, line 31 def dependencies version = os_release["VERSION_ID"].to_f packages = if (10...12).include?(version) ['kernel-default-devel', 'gcc', 'make', 'tar'] elsif version >= 12.0 ['kernel-devel', 'gcc', 'make', 'tar'] end packages.join(' ') end
install_dependencies_cmd()
click to toggle source
# File lib/vagrant-vbguest/installers/suse.rb, line 27 def install_dependencies_cmd "zypper --non-interactive install #{dependencies}" end