Sha256: 88c30f039a3feb6544b99daaa3a82914325aa0c7b3c2eef893842e30ac7aaf68

Contents?: true

Size: 1.39 KB

Versions: 26

Compression:

Stored size: 1.39 KB

Contents

#
# Cookbook Name:: virtualbox
# Recipe:: systemservice
#
# Copyright 2012, Ringo De Smet
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

include_recipe "virtualbox::user"

cookbook_file "/etc/init.d/vboxcontrol" do
  source "vboxcontrol"
  mode "0755"
end

directory "/etc/virtualbox" do
  mode "0755"
end

unless FileTest.exists?("/etc/virtualbox/machines_enabled")
  cookbook_file "/etc/virtualbox/machines_enabled" do
    source "machines_enabled"
    mode "0644"
  end
end

host_interface = node[:network][:default_interface]
addresses = node[:network][:interfaces][host_interface][:addresses]
host_ip = 'unknown'
addresses.each do |ip, params|
  host_ip = ip if params['family'].eql?('inet')
end

template "/etc/virtualbox/config" do
  source "config.erb"
  mode "0644"
  variables(
      :host_interface => host_interface,
      :host_ip => host_ip
  )
end

service "vboxcontrol" do
  action [:enable, :start]
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
madscience-0.0.29 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.28 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.27 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.26 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.25 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.24 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.23 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.21 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.20 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.19 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.17 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.16 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.15 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.14 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.13 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.11 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.10 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.9 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.8 cookbooks/virtualbox/recipes/systemservice.rb
madscience-0.0.7 cookbooks/virtualbox/recipes/systemservice.rb