Module: EasyConfig::VM

Extended by:
VM
Included in:
VM
Defined in:
lib/vagrant-easyconfig/vm.rb

Class Method Summary collapse

Class Method Details

.each(config, &block) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/vagrant-easyconfig/vm.rb', line 8

def self.each(config, &block)
  hostnames = Config.get("hosts").keys
  Config.get("hosts").each_with_index do |item, index|
    hostname    = item[0]
    host_config = item[1]

    config.vm.define hostname do |host|
      self.define(host, hostname, host_config, index == hostnames.size-1)

      block.call(host)
    end
  end
end