Class: RSpecSystem::NodeSet::VagrantVirtualbox
- Inherits:
-
VagrantBase
- Object
- Base
- VagrantBase
- RSpecSystem::NodeSet::VagrantVirtualbox
- Defined in:
- lib/rspec-system/node_set/vagrant_virtualbox.rb
Overview
A NodeSet implementation for Vagrant.
Constant Summary collapse
- PROVIDER_TYPE =
'vagrant_virtualbox'
Instance Attribute Summary
Attributes inherited from Base
#config, #custom_prefabs_path, #destroy, #nodes, #setname
Instance Method Summary collapse
-
#customize_provider(name, options) ⇒ String
private
Adds virtualbox customization to the Vagrantfile.
-
#vagrant_provider_name ⇒ String
Name of provider.
Methods inherited from VagrantBase
#connect, #create_vagrantfile, #customize_vm, #global_vagrant_options, #initialize, #launch, #ssh_config, #teardown, #vagrant
Methods included from Util
Methods included from Log
#bold, #color, #formatter, #log, #output
Methods inherited from Base
#configure, #connect, #default_node, #initialize, #launch, #provider_type, #randmac, #random_string, #rcp, #run, #setup, #ssh_connect, #ssh_exec!, #teardown, #tmppath
Constructor Details
This class inherits a constructor from RSpecSystem::NodeSet::VagrantBase
Instance Method Details
#customize_provider(name, options) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Adds virtualbox customization to the Vagrantfile
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rspec-system/node_set/vagrant_virtualbox.rb', line 25 def customize_provider(name,) custom_config = "" .each_pair do |key,value| next if .include?(key) case key when 'cpus','memory' custom_config << " prov.customize ['modifyvm', :id, '--#{key}','#{value}']\n" when 'mac' custom_config << " prov.customize ['modifyvm', :id, '--macaddress1','#{value}']\n" else log.warn("Skipped invalid custom option for node #{name}: #{key}=#{value}") end end custom_config end |
#vagrant_provider_name ⇒ String
Name of provider
15 16 17 |
# File 'lib/rspec-system/node_set/vagrant_virtualbox.rb', line 15 def vagrant_provider_name 'virtualbox' end |