Permalink
Browse files

refactor virtualbox recipe

  • Loading branch information...
1 parent b6ca1cb commit 86449a936e3aec45b550852ae06b198d71220641 @phlipper phlipper committed May 15, 2011
View
5 kidsruby/recipes/default.rb
@@ -10,7 +10,4 @@
include_recipe "kidsruby::desktop"
# install the editor
-include_recipe "kidsruby::editor"
-
-# setup for use as virtualbox guest
-include_recipe "kidsruby::virtualbox"
+include_recipe "kidsruby::editor"
View
7 kidsruby/recipes/virtualbox.rb
@@ -1,7 +0,0 @@
-%w[
- smbios-utils libsmbios2
- virtualbox-guest-additions virtualbox-ose-guest-utils
- virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms
-].each do |pkg|
- package pkg
-end
View
7 virtualbox/metadata.rb
@@ -0,0 +1,7 @@
+maintainer "KidsRuby"
+maintainer_email "cookbooks@kidsruby.com"
+license "Apache 2.0"
+description "Install Virtualbox and Guest Additions"
+version "0.1.0"
+supports "ubuntu"
+recipe "default", "Install Virtualbox and Guest Additions"
View
24 virtualbox/recipes/default.rb
@@ -0,0 +1,24 @@
+#
+# Cookbook Name:: virtualbox
+# Recipe:: default
+#
+
+template "/etc/apt/sources.list.d/virtualbox.list" do
+ mode 0644
+ variables :code_name => node[:lsb][:codename]
+ notifies :run, resources(:execute => "apt-get update"), :immediately
+ source "virtualbox.list.erb"
+end
+
+execute "install virtualbox apt gpg key" do
+ command "wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | apt-key add -"
+ not_if "apt-key list | grep -i virtualbox"
+end
+
+%w[
+ smbios-utils libsmbios2
+ virtualbox-guest-additions virtualbox-ose-guest-utils
+ virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms
+].each do |pkg|
+ package pkg
+end
View
6 virtualbox/templates/default/virtualbox.list.erb
@@ -0,0 +1,6 @@
+#
+# Ubuntu <%= @code_name %>
+# Generated by Chef for node <%= node[:fqdn] %>
+#
+
+deb http://download.virtualbox.org/virtualbox/debian <%= @code_name %> contrib

0 comments on commit 86449a9

Please sign in to comment.