Hello,

Lets move into steps first.

You can have a box that include a vagrantfile, and that vagrantfile can be
a multi machine

so you can work first on getting the multi machine setup working.

vagrant by default will work with 1 vm, that is called default.

So in a multi node setup you can define new boxes, and vagrant up will
start all of them

more info here:
https://www.vagrantup.com/docs/multi-machine/


The order is top to botom

so if you want 3 web servers you can do

web3
web2
web1

if you need to happen something after 1 is done.


This is how I start 3 VM.

one called server and 2 called agent, so you can get some ideas:

  #server box

  config.vm.define "server" do |server|

    server.vm.box = "alvaro/oracle6-dev-491"

    server.vm.hostname = "server"

    ip="192.168.10.10"

    server.vm.network "private_network", ip: ip

  end


  #agent box

  (1..2).each do |i|

    vm_name = "agent#{i}"

    config.vm.define vm_name do |agent|

      agent.vm.box = "alvaro/oracle6-agent"

      agent.vm.hostname = vm_name

      ip="192.168.10.#{10+i}"

      agent.vm.network "private_network", ip: ip

    end

  end


Once the Vagrantfile is in place, vagrant status will check for all the
boxes. ie:


mini:dev_consul kikitux$ vagrant status

Current machine states:


server                    not created (vmware_fusion)

agent1                    not created (vmware_fusion)

agent2                    not created (vmware_fusion)


This environment represents multiple VMs. The VMs are all listed

above with their current state. For more information about a specific

VM, run `vagrant status NAME`.

mini:dev_consul kikitux$




On Wed, Feb 24, 2016 at 3:15 AM, Richard Wellum <[email protected]>
wrote:

> Is it possible to bring up multiple machines, with an embedded
> (./include/Vagrantfile)?
>
> And if this is supported - what are the vagrant [init/add/up] steps? For
> example usually when you do vagrant up - you have to --name the VM - but
> there are multiple VM's defined in the Vagrantfile. Similar for vagrant
> init - it either does a default or expects a machine(vm) name.
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/b91c53ea-b097-4fe2-8239-9e9afc3c12ad%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/b91c53ea-b097-4fe2-8239-9e9afc3c12ad%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0eyUtnq9h3Ln_kWtQKy4FMjhknVGFjct-YJ3CGQDUD0%3Dvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to