Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
---
driver_plugin: vagrant

driver:
name: vagrant

verifier:
name: inspec

transport:
username: vagrant
password: vagrant
elevated: true
name: winrm

provisioner:
name: chef_zero

platforms:
- name: debian-6
driver_config:
box: opscode-debian-6.0.7
box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_debian-6.0.7_chef-11.2.0.box
require_chef_omnibus: 11.4.0
- name: ubuntu-12.04
driver_config:
box: canonical-ubuntu-12.04
box_url: http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box
require_chef_omnibus: true
- name: centos-6.3
driver_config:
box: opscode-centos-6.3
box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.3_chef-11.2.0.box
- name: ubuntu-16.04
- name: ubuntu-16.10
- name: debian-8.6
- name: centos-6.8
- name: centos-7.2
- name: windows-2016
driver:
box: mwrock/Windows2016
gui: false

suites:
- name: default
run_list: ["recipe[virtualbox]"]
attributes: {}
run_list:
- recipe[virtualbox]
attributes:
3 changes: 2 additions & 1 deletion Berksfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
site :opscode
source 'https://supermarket.chef.io'

metadata
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# changelog

## 2.0.3

* VirtualBox 5.1.18 as default
* Working test kitchen for Windows 2016 using publicly available Windows 2016
image from @mwrock's [mrock/packer-templates](https://github.com/mwrock/packer-templates). Others should be able to converge & verify for windows systems.
* Updating contact info in metadata

## 2.0.1

* update to VirtualBox 5.1 and confirm it works for following in test kitchen
* ubuntu-16.04, 16.10
* centos 6.8, 7.2
* debian 8.6
* convert to inspec tests to verify successful install in above environments

## 1.0.3
* update `yum` dependency to 3
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Installs Virtualbox on OS X, Debian/Ubuntu or Windows.
Changes
=======

## v2.0.1

* Update to Virtualbox-5.1 as default
* Point to new signing keys for Ubuntu and RHEL
* Expand test kitchen to test on Debian, Ubuntu, and centos-6
* Add inspec test to verify install of VirtualBox-5.1

## v1.0.4
* Add chefignore

Expand Down Expand Up @@ -203,7 +210,7 @@ Contributions
=============

The source for this cookbook is hosted on
[GitHub](https://github.com/peplin/virtualbox-cookbook). If you have any issues
[GitHub](https://github.com/bradleyd/virtualbox-cookbook). If you have any issues
with this cookbook, please follow up there.

License and Author
Expand Down
9 changes: 5 additions & 4 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@

case node['platform_family']
when 'mac_os_x'
default['virtualbox']['url'] = 'http://download.virtualbox.org/virtualbox/4.2.12/VirtualBox-4.2.12-84980-OSX.dmg'
default['virtualbox']['url'] = 'http://download.virtualbox.org/virtualbox/5.1.18/VirtualBox-5.1.18-114002-OSX.dmg'
when 'windows'
default['virtualbox']['url'] = 'http://download.virtualbox.org/virtualbox/4.2.12/VirtualBox-4.2.12-84980-Win.exe'
default['virtualbox']['version'] = Vbox::Helpers.vbox_version(node['virtualbox']['url'])
default['virtualbox']['url'] = 'http://download.virtualbox.org/virtualbox/5.1.18/VirtualBox-5.1.18-114002-Win.exe'
default['virtualbox']['version'] = '5.1.18'
# Vbox::Helpers.vbox_version(node['virtualbox']['url'])
when 'debian', 'rhel', 'fedora'
default['virtualbox']['version'] = '4.3'
default['virtualbox']['version'] = '5.1'
end
11 changes: 8 additions & 3 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name "virtualbox"
maintainer "Bradley D Smith"
maintainer_email "[email protected]"
# maintainer "Bradley D Smith"
# maintainer_email "[email protected]"
maintainer "Dayne Broderson"
maintainer_email "[email protected]"
license "Apache 2.0"
description "Installs virtualbox"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.4"
version "2.0.3"

source_url "https://github.com/dayne/virtualbox-cookbook"
issues_url "https://github.com/dayne/virtualbox-cookbook/issues"

%w{ubuntu debian centos redhat mac_os_x windows fedora}.each do |os|
supports os
Expand Down
6 changes: 3 additions & 3 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

apt_repository 'oracle-virtualbox' do
uri 'http://download.virtualbox.org/virtualbox/debian'
key 'http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc'
key 'A2F683C52980AECF'
distribution node['lsb']['codename']
components ['contrib']
end
Expand All @@ -57,10 +57,10 @@
when 'rhel', 'fedora'

yum_repository 'oracle-virtualbox' do
description "#{node['platform_family']} $releasever - $basearch - Virtualbox"
description "#{node['platform_family']} $releasever - $basearch - Virtualbox"
baseurl "http://download.virtualbox.org/virtualbox/rpm/#{node['platform_family']}/$releasever/$basearch"
gpgcheck true
gpgkey 'http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc'
gpgkey 'https://www.virtualbox.org/download/oracle_vbox.asc'
end

package "VirtualBox-#{node['virtualbox']['version']}"
Expand Down
6 changes: 3 additions & 3 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require 'spec_helper'

describe 'virtualbox::default' do
context 'on Centos 6.4 x86_64 with virtualbox 4.3' do
context 'on Centos 6.8 x86_64 with virtualbox 5.1' do
let(:chef_run) do
ChefSpec::Runner.new(platform: 'centos', version: 6.4, step_into: ['yum_repository']) do |node|
ChefSpec::Runner.new(platform: 'centos', version: 6.8, step_into: ['yum_repository']) do |node|
node.automatic['kernel']['machine'] = 'x86_64'
node.default['virtualbox']['version'] = 4.3
node.default['virtualbox']['version'] = 5.1
end.converge(described_recipe)
end

Expand Down
6 changes: 0 additions & 6 deletions test/integration/default/bats/installed.bats

This file was deleted.

9 changes: 9 additions & 0 deletions test/integration/default/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe package('VirtualBox-5.1') do
it { should be_installed }
end

describe command('virtualbox --help') do
its('exit_status') { should eq 0 }
its('stdout') { should match 'Oracle VM VirtualBox Manager' }
its('stderr') { should match '' }
end