Skip to content

cjsteel/ansible-role-virtualbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-role-virtualbox

[![Build Status](https://travis-ci.org/cjsteel/ansible-role-virtualbox.svg?branch=master)](https://travis-ci.org/cjsteel/ansible-role-virtualbox)

An ansible role for installing, reinstalling, removing and purging virtualbox

Procedure

sudo apt remove virtualbox
## ubuntu xenial
# deb http://download.virtualbox.org/virtualbox/debian xenial contrib
## debian 8 jesse
#deb http://download.virtualbox.org/virtualbox/debian jessie contrib

Additional notes:

VirtualBox 5.1 was released on July 12, 2016

  • increased Linux Integration, DKMS is no longer needed
  • improved multimedia support
  • a new bug reporting helper tool
  • a new NVMHCI storage controller for emulating NVMe (NVM Express) devices, aka, flash storage
  • better support for USB devices and multi-channel audio
  • significantly improved performance when running VMs with multi-CPU
  • improved systemd integration

Requirements

Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.

Variables

A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.

Dependencies

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

Example Playbook

Minimalist

You probably want this in almost all cases. The relies on defaults/main.yml value for the var ensure_virtualbox.

---
- hosts: virtualbox
  become: true
  gather_facts: true
  roles:
    - virtualbox

Overide var in default/main.yml for all hosts in inventory

- hosts: virtualbox
  become: true
  gather_facts: false
  vars:
    - virtualbox_state: 'absent'
  roles:
    - virtualbox

Overide default/main.yml by passing value for ensure_virtualbox via the role

- hosts: all
  become: true
  gather_facts: false
  roles:
    - { role: "virtualbox", virtualbox_state: 'present' }

Example Command

ansible-playbook -i inventory/dev site.yml --ask-become-pass --limit workstation_001

Role Testing

Locally using vagrant

mkdir .vagrant/synced
vagrant up
vagrant ssh -- -X

Check via terminal

vboxmanage --version

Output

Via script

#!/bin/bash
echo $(vboxmanage --version)

vi GUI

which virtualbox
virtualbox

Check the version.

Example:

VirtualBox Graphical User Interface
Version 5.1.22 r115126 (Qt5.5.1)
Copyright © 2017 Oracle Corporation and/or its affiliates. All rights reserved.
exit
vagrant destroy # if you are done testing

License

OSI Logo

Author Information

An optional section for the role authors to include contact information, or a website (HTML is not allowed).

About

An ansible role to install or remove virtual box

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •