Sha256: 0ed70d8c9a1d1813481a8c9531050c8a0afdf3913b31fb9891f569a1b1b726ff

Contents?: true

Size: 1.59 KB

Versions: 13

Compression:

Stored size: 1.59 KB

Contents

require 'beaker/hypervisor/vagrant'

class Beaker::VagrantVirtualbox < Beaker::Vagrant
  def provision(provider = 'virtualbox')
    super
  end

  def self.provider_vfile_section(host, options)
    provider_section  = ""
    provider_section << "    v.vm.provider :virtualbox do |vb|\n"
    provider_section << "      vb.customize ['modifyvm', :id, '--memory', '#{options['vagrant_memsize'] ||= '1024'}']\n"
    provider_section << "      vb.vbguest.auto_update = false" if options[:vbguest_plugin] == 'disable'
    if host['disk_path']
      unless File.exist?(host['disk_path'])
        host['disk_path'] = File.join(host['disk_path'], "#{host.name}.vmdk")
        provider_section << "      vb.customize ['createhd', '--filename', '#{host['disk_path']}', '--size', #{host['disk_size'] ||= 5 * 1024}, '--format', 'vmdk']\n"
      end
      provider_section << "      vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium','#{host['disk_path']}']\n"
      provider_section << "      vb.customize [\"modifyvm\", :id, \"--natdnshostresolver1\", \"#{host['natdns']}\"]\n" unless host['natdns'].nil?
      provider_section << "      vb.customize [\"modifyvm\", :id, \"--natdnsproxy1\", \"#{host['natdns']}\"]\n" unless host['natdns'].nil?
      provider_section << "      vb.gui = true\n" unless host['vb_gui'].nil?
      provider_section << "      [\"modifyvm\", :id, \"--cpuidset\", \"1\",\"000206a7\",\"02100800\",\"1fbae3bf\",\"bfebfbff\"\]" if /osx/i.match(host['platform'])
    end
    provider_section << "    end\n"

    provider_section
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
beaker-2.12.0 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.11.0 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.10.0 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.9.0 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.8.0 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.7.1 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.7.0 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.6.0 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.5.1 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.5.0 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.4.1 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.4.0 lib/beaker/hypervisor/vagrant_virtualbox.rb
beaker-2.3.0 lib/beaker/hypervisor/vagrant_virtualbox.rb