Class: ConfigBuilder::Model::VM
- Includes:
- ConfigBuilder::ModelDelegator
- Defined in:
- lib/config_builder/model/vm.rb
Overview
Instance Attribute Summary collapse
-
#box ⇒ String
The name of the Vagrant box to instantiate for this VM.
-
#box_url ⇒ String
The source URL for the Vagrant box associated with this VM.
-
#forwarded_ports ⇒ Array<Hash<Symbol, Object>>
A collection of port mappings.
-
#hostname ⇒ String
The hostname the machine should have.
-
#name ⇒ String
The name of the instantiated box in this environment.
-
#private_networks ⇒ Array<Hash<Symbol, Object>>
A collection of IP address network settings.
-
#provider ⇒ Hash<Symbol, Object>
The provider configuration for this VM.
-
#provisioners ⇒ Array<Hash<Symbol, Object>>
A collection of provisioner parameters in the order that they should be applied of provisioner types, and a list of provisioner instances for each type.
- #synced_folders ⇒ Array<Hash<Symbol, Object>>
Instance Method Summary collapse
-
#initialize ⇒ VM
constructor
A new instance of VM.
- #to_proc ⇒ Object
Methods included from ConfigBuilder::ModelDelegator
#eval_models, included, #model_delegators
Methods inherited from Base
#attrs=, #call, def_model_attribute, model_attributes, new_from_hash
Constructor Details
#initialize ⇒ VM
Returns a new instance of VM.
81 82 83 84 85 86 87 88 |
# File 'lib/config_builder/model/vm.rb', line 81 def initialize @defaults = { :provisioners => [], :forwarded_ports => [], :private_networks => [], :synced_folders => [], } end |
Instance Attribute Details
#box ⇒ String
Returns The name of the Vagrant box to instantiate for this VM.
67 |
# File 'lib/config_builder/model/vm.rb', line 67 def_model_attribute :box |
#box_url ⇒ String
Returns The source URL for the Vagrant box associated with this VM.
71 |
# File 'lib/config_builder/model/vm.rb', line 71 def_model_attribute :box |
#forwarded_ports ⇒ Array<Hash<Symbol, Object>>
Returns A collection of port mappings.
41 |
# File 'lib/config_builder/model/vm.rb', line 41 def_model_delegator :forwarded_ports |
#hostname ⇒ String
Returns The hostname the machine should have.
79 |
# File 'lib/config_builder/model/vm.rb', line 79 def_model_attribute :hostname |
#name ⇒ String
Returns The name of the instantiated box in this environment.
75 |
# File 'lib/config_builder/model/vm.rb', line 75 def_model_attribute :name |
#private_networks ⇒ Array<Hash<Symbol, Object>>
Returns A collection of IP address network settings.
52 |
# File 'lib/config_builder/model/vm.rb', line 52 def_model_delegator :private_networks |
#provider ⇒ Hash<Symbol, Object>
Returns The provider configuration for this VM.
16 |
# File 'lib/config_builder/model/vm.rb', line 16 def_model_delegator :provider |
#provisioners ⇒ Array<Hash<Symbol, Object>>
Returns A collection of provisioner parameters in the order that they should be applied of provisioner types, and a list of provisioner instances for each type.
31 |
# File 'lib/config_builder/model/vm.rb', line 31 def_model_delegator :provisioners |
#synced_folders ⇒ Array<Hash<Symbol, Object>>
63 |
# File 'lib/config_builder/model/vm.rb', line 63 def_model_delegator :synced_folders |
Instance Method Details
#to_proc ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/config_builder/model/vm.rb', line 90 def to_proc Proc.new do |global_config| global_config.vm.define(attr(:name)) do |config| vm_config = config.vm vm_config.box = attr(:box) if defined? attr(:box) vm_config.box_url = attr(:box_url) if defined? attr(:box_url) vm_config.hostname = attr(:hostname) if defined? attr(:hostname) eval_models(vm_config) end end end |