Ah, no big deal, keep going.

as all the boxes use the same box, you can move that part out.


Then later you can do something like this:

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  #Use the same key for each machine
  config.ssh.insert_key=false
  config.vm.box = "ubuntu/trusty64"
  ["first","second","third"].to_enum.with_index(1).each do |vm_name, i|
    port1 = 8080+i-1
    port2 = 8443+i-1
    config.vm.define vm_name = vm_name do |config|
      config.vm.network "forwarded_port", guest: 80, host: port1
      config.vm.network "forwarded_port", guest: 443, host: port2
    end
  end
end


And allow you put whatever name you like to the box..

Have fun
Alvaro.


On Sat, Jun 6, 2015 at 11:57 AM, richard kappler <[email protected]> wrote:
> OMG! How did I miss that? Thanks Alvaro!
>
> On Jun 5, 2015 19:30, "Alvaro Miranda Aguilera" <[email protected]> wrote:
>>
>> On Sat, Jun 6, 2015 at 4:23 AM, richard kappler <[email protected]>
>> wrote:
>> > VAGRANTFILE_API_VERSION = "2"
>> >
>> > Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
>> >   #Use the same key for each machine
>> >   config.ssh.insert_key=false
>> >
>> >  config.vm.define "vagrant1" do |vagrant1|
>> >   vagrant1.vm.box = "ubuntu/trusty64"
>> >   vagrant1.vm.network "forwarded_port", guest: 80, host: 8080
>> >   vagrant1.vm.network "forwarded_port", guest: 443, host: 8443
>> >  end
>> >  config.vm.define "vagrant2" do |vagrant2|
>> >   vagrant2.vm.box = "ubuntu/trusty64"
>> >   vagrant2.vm.network "forwarded_port", guest: 80, host: 8081
>> >   vagrant2.vm.network "forwarded_port", guest: 443, guest: 8444
>> >  end
>> >  config.vm.define "vagrant3" do |vagrant3|
>> >   vagrant3.vm.box = "ubuntu/trusty64"
>> >   vagrant3.vm.network "forwarded_port", guest: 80, host: 8082
>> >   vagrant3.vm.network "forwarded_port", guest: 443, host: 8445
>> >  end
>> > end
>>
>> he
>>
>> small error
>>
>>   vagrant2.vm.network "forwarded_port", guest: 443, guest: 8444
>>
>> guest guest
>>
>> Alvaro.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Vagrant" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/vagrant-up/ZXgAzzWpm_c/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to