Code Monkey home page Code Monkey logo

puppet-virtualbox's Introduction

virtualbox

Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

This module installs VirtualBox on a Linux host using the official repositories or custom defined repositories. By default, this module will also configure the kernel modules required to run VirtualBox.

By default, this module will install the Oracle VirtualBox yum/apt repo, install the VirtualBox package, and build the VirtualBox kernel modules. You can define a custom package name and/or version, you can also opt to not manage the repositories with this module. Because of the strange convention Oracle has opted to use for versioning VirtualBox, if you set a custom package name, the version parameter will be ignored. If you wish to define a package version with a custom package name, you must use the package_ensure parameter.

Support

This module is tested with:

  • CentOS 6
  • CentOS 7
  • Debian 8
  • Debian 9
  • Ubuntu 16.04

It may work on other distros and OS versions, but these are the versions that we're targeting. If you wish to see another distro/version added to this list, so would we! PRs are welcome :)

This module is tested with the latest version Puppet 4 and Puppet 5; all Puppet supported versions of Ruby are included in the test matrix. If you're interested in the testing matrix, please have a look at the .travis.yml file in the root of the module.

Usage

To begin using the virtualbox module, just include the virtualbox class on your node like so:

include virtualbox

This will get you set up with the basics and will meet 90% of the use cases out there.

If you wish to manage your package repositories outside of this module, you just need to set $manage_repo to false:

class { 'virtualbox':
  manage_repo => false,
}

You can also specify a custom package name like so:

class { 'virtualbox':
  manage_repo  => false,
  package_name => 'virtualbox-custom',
}

You can also specify the version of the desired version 6.x. If the host is already running a lower version of virtualbox, it is upgraded. If the host is not yet running virtualbox, it is installed.

class { 'virtualbox':
  version => '6.1',
}

The peculiar versioning in use by Oracle has forced us to do some funky stuff with versioning. If you're using the default package name, this module will concatenate $package_name and $version together with a dash between them. If you opt to define your own package name, the $version parameter is ignored completely and the only way to specify a version would be to use the $package_ensure parameter:

class { 'virtualbox':
  manage_repo    => false,
  package_name   => 'virtualbox-custom',
  package_ensure => '4.3.18_96516',
}

If you don't want to install the VirtualBox kernel extensions, you can set the manage_kernel parameter to false.

class { 'virtualbox':
  manage_kernel => false,
}

You can also opt to not manage the package with the manage_package parameter. This would effectively just install the package repository:

class { 'virtualbox':
  manage_kernel  => false,
  manage_package => false,
}

Extension Pack

NOTE: To use this feature, you must have puppet/archive installed.

There's a defined type to install an Extension Pack. I'm not aware of any extension packs other than the Oracle Extension Pack, but this type should work for third party extensions. You can install Oracle's Extension Pack (adding support for USB 2.0, access to webcam, RDP and E1000 PXE ROM) like so:

  virtualbox::extpack { 'Oracle_VM_VirtualBox_Extension_Pack':
    ensure          => present,
    source          => 'http://download.virtualbox.org/virtualbox/6.0.0_RC1/Oracle_VM_VirtualBox_Extension_Pack-6.0.0_RC1.vbox-extpack',
    checksum_string => 'deecf9b15ffda29d4d5da4349763fd11',
  }

This will download the extension pack, check to make sure the downloaded file matches the expected md5sum, then install the extension pack to /usr/lib/virtualbox/ExtensionPacks.

Development

  1. Fork it
  2. Create a feature branch
  3. Write a failing test
  4. Write the code to make that test pass
  5. Refactor the code
  6. Submit a pull request

We politely request (demand) tests for all new features. Pull requests that contain new features without a test will not be considered. If you need help, just ask!

puppet-virtualbox's People

Contributors

alexjfisher avatar bastelfreak avatar dan33l avatar danzilio avatar dhollinger avatar dhoppe avatar ekohl avatar franck-iaropoli-arm avatar hansmi avatar igalic avatar juniorsysadmin avatar kengelhardt-godaddy avatar kenyon avatar llowder avatar mark0n avatar maxadamo avatar meskaya avatar mwaldmueller avatar nibalizer avatar sacres avatar sandra-thieme avatar smortex avatar sysadmiral avatar tamerz avatar throup avatar tosmi avatar tragiccode avatar vinzent avatar wyardley avatar zilchms avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-virtualbox's Issues

Use a 40 character ID for apt key

Currently this module emits a warning when used with modern versions of the apt module:

Warning: /Apt_key[98AB5139]: The id should be a full fingerprint (40 characters), see README.

Missing repository key for Ubuntu 18.04

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet:5.4.0-2ubuntu3
  • Ruby:1:2.5.1
  • Distribution:Ubuntu 18.04.1
  • Module version:2.2.1

How to reproduce (e.g Puppet code you use)

class { '::virtualbox':
manage_kernel => false,
manage_package => false,
}

What are you seeing

W: GPG error: http://download.virtualbox.org/virtualbox/debian bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2F683C52980AECF
E: The repository 'http://download.virtualbox.org/virtualbox/debian bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

What behaviour did you expect instead

No warning message regarding VirtualBox repository

Output log

Any additional information you'd like to impart

uname -r call without full path

environment => 'KERN_DIR=/usr/src/kernels/`uname -r`',

if puppet is called from a bootstrapping process /usr/bin may not be in the PATH by default, this will cause setup to fail

Error: '/usr/lib/virtualbox/vboxdrv.sh setup' returned 1 instead of one of [0]
  Error: /Stage[main]/Virtualbox::Kernel/Exec[vboxdrv]/returns: change from 'notrun' to ['0'] failed: '/usr/lib/virtualbox/vboxdrv.sh setup' returned 1 instead of one of [0] (corrective)

LOG

Building the main VirtualBox module.
Error building the module:
/tmp/vbox.0/Makefile-header.gmk:100: *** The variable KERN_DIR must be a kernel build folder and end with /build without a trailing slash, or KERN_VER must be set.  Stop.

please fully qualify the path for this or add all paths to exec resource.

Warning message regarding unsupported architecture

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.4.0-2ubuntu3
  • Ruby: 1:2.5.1
  • Distribution: Ubuntu 18.04.1
  • Module version: 2.2.1

How to reproduce (e.g Puppet code you use)

class { '::virtualbox':
manage_kernel => false,
manage_package => false,
}

What are you seeing

sudo apt update
N: Skipping acquire of configured file 'contrib/binary-i386/Packages' as repository 'http://download.virtualbox.org/virtualbox/debian bionic InRelease' doesn't support architecture 'i386'

What behaviour did you expect instead

No warning message regarding VirtualBox repository

Output log

Any additional information you'd like to impart

I was thinking maybe adding the node architecture to the apt::source to remove the message about i386 arch not supported.

== Class: virtualbox::install

    apt::source { 'virtualbox':
      architecture => $::virtualbox::params::architecture,
      location     => 'http://download.virtualbox.org/virtualbox/debian',
      release      => $::lsbdistcodename,
      repos        => $apt_repos,
      require      => Apt::Key[ $apt_key_thumb ],
    }

== Class virtualbox::params

$architecture = $facts['architecture']

==>
/etc/apt/sources.list.d/virtualbox.list

deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib

Cheers,
Franck

Predicting a bugfix release?

It looks like 1.2.2 is in the metadata but only 1.2.1 is released on the forge. Is this on purpose because the release is pending? What if the next release has a feature instead of a bugfix?

If you could keep a changelog documenting that it is a pending release, that would be great! http://keepachangelog.com/ documents a great changelog layout. (And it would be helpful to see the semantic versioned changes between releases.)

Replace the dependency on (deprecated) stahnma/epel with puppet/epel

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: all
  • Ruby: all
  • Distribution: n/a
  • Module version: 4.0.1

How to reproduce (e.g Puppet code you use)

n/a

What are you seeing

The module expresses a dependency on module stahnma/epel, which has been handed over by its author to Voxpupuli. stahnma/epel is accordingly deprecated, but puppet/virtualbox still depends on it.

What behaviour did you expect instead

puppet/virtualbox should depend on puppet/epel instead of stahnma/epel.

Output log

n/a

Any additional information you'd like to impart

n/a

upgrade virtualbox

Hello,

Is it possible to upgrade virtualbox using this module if I specify a newer version than what is currently installed?

Scheduling refresh of Class[Apt::Update] in Ubuntu/Debian

When I install this via:

class { 'virtualbox':
  manage_kernel => false,
}

I get this install error (on about 7 of ~200 machines). as apt-get update hasn't ran yet (Scheduling refresh of Class[Apt::Update]), but the repo has being added and the package has attempted to be installed. On the second puppet run, it installs fine as the repo is there and apt-get update has run.
See: https://github.com/puppetlabs/puppetlabs-apt#limitations

you may want to consider changing this in install.pp line 48:

if $manage_package {
  Apt::Source['virtualbox'] -> Package['virtualbox']
}

to this:

if $manage_package {
  Apt::Source['virtualbox'] -> Class['Apt::Update'] -> Package['virtualbox']
}

-- Versions
ubuntu 14.04
puppet-apt v2.2.0
danzilio-virtualbox v1.6.0

From Logs:

Notice: /Stage[main]/Virtualbox::Install/Apt::Source[virtualbox]/Apt::Setting[list-virtualbox]/File[/etc/apt/sources.list.d/virtualbox.list]/ensure: defined content as '{md5}7939495ce023eb625accd78e4e84e4f1'
Info: /Stage[main]/Virtualbox::Install/Apt::Source[virtualbox]/Apt::Setting[list-virtualbox]/File[/etc/apt/sources.list.d/virtualbox.list]: Scheduling refresh of Class[Apt::Update]
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install virtualbox-4.3' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Package virtualbox-4.3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'virtualbox-4.3' has no installation candidate
Error: /Stage[main]/Virtualbox::Install/Package[virtualbox]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install virtualbox-4.3' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Package virtualbox-4.3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'virtualbox-4.3' has no installation candidate
Info: Class[Virtualbox::Install]: Unscheduling all events on Class[Virtualbox::Install]
Info: Class[Profile::Push_Virtualbox]: Unscheduling all events on Class[Profile::Push_Virtualbox]
Info: Class[Apt::Update]: Scheduling refresh of Exec[apt_update] 
...

Checksum handling

We should leverage checksum_url throughout this module rather than 'hardcoding' them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.