Puppet Class: virtualbox

Inherits:
virtualbox::params
Defined in:
manifests/init.pp

Summary

Installs VirtualBox.

Overview

Parameters:

  • version (String) (defaults to: '6.0')

    The major version of the package to install.

  • package_ensure (String) (defaults to: 'present')

    This gets passed to the package resource as the value of the ‘ensure’ parameter. This can be used to specify a package version.

  • manage_repo (Boolean) (defaults to: $virtualbox::params::manage_repo)

    Should this module manage the package repository? Defaults to true

  • manage_ext_repo (Boolean) (defaults to: true)

    On applicable platforms, should this module manage the external dependency repository when ‘manage_kernel` is set to true? Defaults to true

  • repo_proxy (Optional[String]) (defaults to: undef)

    proxy used by yum

  • manage_package (Boolean) (defaults to: true)

    Should this module manage the package? Defaults to true

  • manage_kernel (Boolean) (defaults to: true)

    Should this module install the VirtualBox kernel modules? Defaults to true

  • vboxdrv_dependencies (Array) (defaults to: $virtualbox::params::vboxdrv_dependencies)

    Dependencies for building the VirtualBox kernel modules. Defaults depend on the platform. See virtualbox::params.

  • package_name (String) (defaults to: $virtualbox::params::package_name)

    The name of the package to install. This must be the full packge name when not the default. When the default is in use, it gets compounded with the major.minor components of the version number. Defaults to ‘VirtualBox’ for RedHat and ‘virtualbox’ for Debian



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'manifests/init.pp', line 30

class virtualbox (
  String $version               = '6.0',
  String $package_ensure        = 'present',
  String $package_name          = $virtualbox::params::package_name,
  Boolean $manage_repo          = $virtualbox::params::manage_repo,
  Boolean $manage_ext_repo      = true,
  Boolean $manage_package       = true,
  Boolean $manage_kernel        = true,
  Array $vboxdrv_dependencies   = $virtualbox::params::vboxdrv_dependencies,
  Optional[String] $repo_proxy  = undef,
) inherits virtualbox::params {
  if versioncmp($version, '5.0') == -1 {
    $vboxdrv_command = '/etc/init.d/vboxdrv'
  } else {
    $vboxdrv_command = '/usr/lib/virtualbox/vboxdrv.sh'
  }

  class { 'virtualbox::install': } -> Class['virtualbox']

  if $manage_kernel {
    Class['virtualbox::install'] -> class { 'virtualbox::kernel': }

    if $facts['os']['family'] == 'RedHat' {
      if $manage_ext_repo {
        include epel
        Class['epel'] -> Class['virtualbox::kernel']
      }
    }
  }
}