Class: VagrantPlugins::Dotvm::Config::Machine
- Inherits:
-
AbstractConfig
- Object
- AbstractConfig
- VagrantPlugins::Dotvm::Config::Machine
- Defined in:
- lib/vagrant-dotvm/config/machine.rb
Instance Attribute Summary collapse
-
#authorized_keys ⇒ Object
Returns the value of attribute authorized_keys.
-
#autostart ⇒ Object
Returns the value of attribute autostart.
-
#boot_timeout ⇒ Object
Returns the value of attribute boot_timeout.
-
#box ⇒ Object
Returns the value of attribute box.
-
#box_check_update ⇒ Object
Returns the value of attribute box_check_update.
-
#box_download_ca_cert ⇒ Object
Returns the value of attribute box_download_ca_cert.
-
#box_download_ca_path ⇒ Object
Returns the value of attribute box_download_ca_path.
-
#box_download_checksum ⇒ Object
Returns the value of attribute box_download_checksum.
-
#box_download_checksum_type ⇒ Object
Returns the value of attribute box_download_checksum_type.
-
#box_download_client_cert ⇒ Object
Returns the value of attribute box_download_client_cert.
-
#box_download_insecure ⇒ Object
Returns the value of attribute box_download_insecure.
-
#box_download_location_trusted ⇒ Object
Returns the value of attribute box_download_location_trusted.
-
#box_url ⇒ Object
Returns the value of attribute box_url.
-
#box_version ⇒ Object
Returns the value of attribute box_version.
-
#communicator ⇒ Object
Returns the value of attribute communicator.
-
#cpucap ⇒ Object
Returns the value of attribute cpucap.
-
#cpus ⇒ Object
Returns the value of attribute cpus.
-
#graceful_halt_timeout ⇒ Object
Returns the value of attribute graceful_halt_timeout.
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#guest ⇒ Object
Returns the value of attribute guest.
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#memory ⇒ Object
Returns the value of attribute memory.
-
#name ⇒ Object
Returns the value of attribute name.
-
#natnet ⇒ Object
Returns the value of attribute natnet.
-
#networks ⇒ Object
Returns the value of attribute networks.
-
#nick ⇒ Object
Returns the value of attribute nick.
-
#options ⇒ Object
Returns the value of attribute options.
-
#post_up_message ⇒ Object
Returns the value of attribute post_up_message.
-
#primary ⇒ Object
Returns the value of attribute primary.
-
#provision ⇒ Object
Returns the value of attribute provision.
-
#routes ⇒ Object
Returns the value of attribute routes.
-
#shared_folders ⇒ Object
Returns the value of attribute shared_folders.
-
#usable_port_range ⇒ Object
Returns the value of attribute usable_port_range.
Instance Method Summary collapse
-
#initialize ⇒ Machine
constructor
A new instance of Machine.
- #populate_authorized_keys(data) ⇒ Object
- #populate_groups(data) ⇒ Object
- #populate_hosts(data) ⇒ Object
- #populate_networks(data) ⇒ Object
- #populate_options(data) ⇒ Object
- #populate_provision(data) ⇒ Object
- #populate_routes(data) ⇒ Object
- #populate_shared_folders(data) ⇒ Object
Methods inherited from AbstractConfig
#populate, #replace_vars, #replace_vars!
Constructor Details
#initialize ⇒ Machine
Returns a new instance of Machine.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 39 def initialize() @primary = false @networks = [] @routes = [] @provision = [] @groups = [] = [] @hosts = [] = { :virtualbox => [], } @shared_folders = [] populate_shared_folders( [ { "host" => "%project.host%", "guest" => "%project.guest%", "disabled" => false, "create" => false, "type" => nil, } ] ) end |
Instance Attribute Details
#authorized_keys ⇒ Object
Returns the value of attribute authorized_keys.
17 18 19 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 17 def end |
#autostart ⇒ Object
Returns the value of attribute autostart.
23 24 25 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 23 def autostart @autostart end |
#boot_timeout ⇒ Object
Returns the value of attribute boot_timeout.
18 19 20 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 18 def boot_timeout @boot_timeout end |
#box ⇒ Object
Returns the value of attribute box.
7 8 9 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 7 def box @box end |
#box_check_update ⇒ Object
Returns the value of attribute box_check_update.
19 20 21 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 19 def box_check_update @box_check_update end |
#box_download_ca_cert ⇒ Object
Returns the value of attribute box_download_ca_cert.
30 31 32 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 30 def box_download_ca_cert @box_download_ca_cert end |
#box_download_ca_path ⇒ Object
Returns the value of attribute box_download_ca_path.
31 32 33 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 31 def box_download_ca_path @box_download_ca_path end |
#box_download_checksum ⇒ Object
Returns the value of attribute box_download_checksum.
27 28 29 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 27 def box_download_checksum @box_download_checksum end |
#box_download_checksum_type ⇒ Object
Returns the value of attribute box_download_checksum_type.
28 29 30 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 28 def box_download_checksum_type @box_download_checksum_type end |
#box_download_client_cert ⇒ Object
Returns the value of attribute box_download_client_cert.
29 30 31 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 29 def box_download_client_cert @box_download_client_cert end |
#box_download_insecure ⇒ Object
Returns the value of attribute box_download_insecure.
32 33 34 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 32 def box_download_insecure @box_download_insecure end |
#box_download_location_trusted ⇒ Object
Returns the value of attribute box_download_location_trusted.
33 34 35 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 33 def box_download_location_trusted @box_download_location_trusted end |
#box_url ⇒ Object
Returns the value of attribute box_url.
34 35 36 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 34 def box_url @box_url end |
#box_version ⇒ Object
Returns the value of attribute box_version.
20 21 22 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 20 def box_version @box_version end |
#communicator ⇒ Object
Returns the value of attribute communicator.
35 36 37 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 35 def communicator @communicator end |
#cpucap ⇒ Object
Returns the value of attribute cpucap.
10 11 12 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 10 def cpucap @cpucap end |
#cpus ⇒ Object
Returns the value of attribute cpus.
9 10 11 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 9 def cpus @cpus end |
#graceful_halt_timeout ⇒ Object
Returns the value of attribute graceful_halt_timeout.
21 22 23 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 21 def graceful_halt_timeout @graceful_halt_timeout end |
#groups ⇒ Object
Returns the value of attribute groups.
16 17 18 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 16 def groups @groups end |
#guest ⇒ Object
Returns the value of attribute guest.
36 37 38 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 36 def guest @guest end |
#hosts ⇒ Object
Returns the value of attribute hosts.
24 25 26 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 24 def hosts @hosts end |
#memory ⇒ Object
Returns the value of attribute memory.
8 9 10 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 8 def memory @memory end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 6 def name @name end |
#natnet ⇒ Object
Returns the value of attribute natnet.
12 13 14 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 12 def natnet @natnet end |
#networks ⇒ Object
Returns the value of attribute networks.
13 14 15 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 13 def networks @networks end |
#nick ⇒ Object
Returns the value of attribute nick.
5 6 7 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 5 def nick @nick end |
#options ⇒ Object
Returns the value of attribute options.
25 26 27 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 25 def end |
#post_up_message ⇒ Object
Returns the value of attribute post_up_message.
22 23 24 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 22 def end |
#primary ⇒ Object
Returns the value of attribute primary.
11 12 13 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 11 def primary @primary end |
#provision ⇒ Object
Returns the value of attribute provision.
15 16 17 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 15 def provision @provision end |
#routes ⇒ Object
Returns the value of attribute routes.
14 15 16 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 14 def routes @routes end |
#shared_folders ⇒ Object
Returns the value of attribute shared_folders.
26 27 28 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 26 def shared_folders @shared_folders end |
#usable_port_range ⇒ Object
Returns the value of attribute usable_port_range.
37 38 39 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 37 def usable_port_range @usable_port_range end |
Instance Method Details
#populate_authorized_keys(data) ⇒ Object
101 102 103 104 105 106 107 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 101 def (data) data.to_a.each do |conf| item = AuthorizedKey.new item.populate conf << item end end |
#populate_groups(data) ⇒ Object
95 96 97 98 99 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 95 def populate_groups(data) data.to_a.each do |item| @groups << item end end |
#populate_hosts(data) ⇒ Object
109 110 111 112 113 114 115 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 109 def populate_hosts(data) data.to_a.each do |conf| item = Host.new item.populate conf @hosts << item end end |
#populate_networks(data) ⇒ Object
71 72 73 74 75 76 77 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 71 def populate_networks(data) data.to_a.each do |conf| item = Network.new item.populate conf @networks << item end end |
#populate_options(data) ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 117 def (data) data.to_h.each do |key, confs| key = key.to_sym raise "Invalid options category: #{key}." unless .has_key?(key) confs.to_a.each do |conf| item = Option.new item.populate conf [key] << item end end end |
#populate_provision(data) ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 87 def populate_provision(data) data.to_a.each do |conf| item = Provision.new item.populate conf @provision << item end end |
#populate_routes(data) ⇒ Object
79 80 81 82 83 84 85 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 79 def populate_routes(data) data.to_a.each do |conf| item = Route.new item.populate conf @routes << item end end |
#populate_shared_folders(data) ⇒ Object
130 131 132 133 134 135 136 |
# File 'lib/vagrant-dotvm/config/machine.rb', line 130 def populate_shared_folders(data) data.to_a.each do |conf| item = SharedFolder.new item.populate conf @shared_folders << item end end |