Class: VagrantVbguest::Installers::Debian

Inherits:
Linux
  • Object
show all
Defined in:
lib/vagrant-vbguest/installers/debian.rb

Direct Known Subclasses

Ubuntu

Instance Attribute Summary

Attributes inherited from Base

#env, #host, #options, #vm

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Linux

#cleanup, #execute_installer, #find_tool, #guest_version, #installer, #installer_arguments, #installer_options, #mount_iso, #mount_point, #os_release, os_release, #provides_vboxadd_tools?, #rebuild, #running?, #start, #systemd_tool, #tmp_path, #unmount_iso, #vboxadd_tools_available?, #yes

Methods inherited from Base

#cleanup, distro, #guest_version, #host_version, #initialize, #installer_options, #installer_version, #iso_file, #mount_point, #provides_vboxadd_tools?, #reboot_after_install?, #rebuild, #running?, #start, #tmp_path, #upload, #vboxadd_tools_available?, #yield_installation_error_warning, #yield_installation_warning, #yield_rebuild_warning

Methods included from Helpers::VmCompatible

#communicate, #driver, included

Constructor Details

This class inherits a constructor from VagrantVbguest::Installers::Base

Class Method Details

.match?(vm) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/vagrant-vbguest/installers/debian.rb', line 5

def self.match?(vm)
  /\Adebian\d*\Z/ =~ self.distro(vm)
end

Instance Method Details

#install(opts = nil) {|type, data| ... } ⇒ Object

installs the correct linux-headers package installs ‘dkms` package for dynamic kernel module loading

Parameters:

  • opts (Hash) (defaults to: nil)

    Optional options Hash which might get passed to Vagrant::Communication::SSH#execute and friends

Yields:

  • (type, data)

    Takes a Block like Vagrant::Communication::Base#execute for realtime output of the command being executed

Yield Parameters:

  • type (String)

    Type of the output, ‘:stdout`, `:stderr`, etc.

  • data (String)

    Data for the given output.



15
16
17
18
19
20
21
22
23
# File 'lib/vagrant-vbguest/installers/debian.rb', line 15

def install(opts=nil, &block)
  begin
    communicate.sudo(install_dependencies_cmd, opts, &block)
  rescue
    communicate.sudo('apt-get -y --force-yes update', (opts || {}).merge(:error_check => false), &block)
    communicate.sudo(install_dependencies_cmd, opts, &block)
  end
  super
end