Hello

Yes its possible.

Following the format, I am an Chlean IT Proffesional also in Europe!


Vagrant does have a sense of default box, its called default

you can override that and setup a name on it, this is the building block to
have a multi setup setup.


let say you start with this


Vagrant.configure("2") do |config|

    config.vm.box = "hashicorp/precise64"

end

It will create a vm named default inside vagrant, you can check with
vagrant status


Vagrantfile is ruby, so if you learn bit of ruby will help a lot

basically the do |config| put us inside the block, so you can create nested
objects



Vagrant.configure("2") do |config|

    config.vm.box = "hashicorp/precise64"

    config.vm.define "box1"

end

Vagrant status here will say:


Current machine states:

box1                      not created (virtualbox)

So what we have here is, anything at config. level will apply to all the
boxes and we have a way to define boxes.


Putting to work we can have:


Vagrant.configure("2") do |config|

  config.vm.define vm_name = "web" do |node|

    node.vm.box = "hashicorp/precise64"

    node.vm.hostname = vm_name

  end

end


you can repeat


Vagrant.configure("2") do |config|

  config.vm.define vm_name = "web" do |node|

    node.vm.box = "hashicorp/precise64"

    node.vm.hostname = vm_name

  end

  config.vm.define vm_name = "db" do |node|

    node.vm.box = "hashicorp/precise64"

    node.vm.hostname = vm_name

  end

end



you can add a loop to one


Vagrant.configure("2") do |config|

  prefix="node"

  #node box

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

    vm_name = "#{prefix}#{i}"

    config.vm.define vm_name do |node|

      node.vm.box = "hashicorp/precise64"

      node.vm.hostname = vm_name

    end

  end

end


Key point here, do |node| create a new block, and inside here whatever we
do will apply to that box only

If you want setup cpu/ram for all the boxes, you put it at config. level

if you want to setup just 1 vm hostname to <this> then you do it in a node.
level

make sense?


if you want to add provisioning, at config. level will apply to all the
boxes

at node. level will apply to that particular box

let me know if this helps to get you started



Thanks
Alvaro

On Thu, Feb 22, 2018 at 10:09 AM, Mitchell Sullivan <
mitchell.sulliva...@gmail.com> wrote:

> Hi Vagrant Team.
>
> I'm an Australian IT Professional who has just started a new role in
> Europe. I come from a wintel IT Infrastructure background, however for my
> new role I need to get up to speed with Linux Really quick.
> Is it possible to use Vagrant to build Mutliple VMs on my laptop, in an
> isloated 'sandbox' setup to test linux server topology. I want to built 3
> simple linux servers and test intergrating FreeIPA with FreeRadius.
>
> I've just built a Vagrant VM based on the getting started guide. I will
> keep trying things out, but any tips or feedback to help me on my way would
> be greatly appreciated.
>
> Thanks
> Mitch.
>
> --
> 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 vagrant-up+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/vagrant-up/1fbe6486-0577-4f4a-857e-3d0a5d3e59e3%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/1fbe6486-0577-4f4a-857e-3d0a5d3e59e3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Alvaro

-- 
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 vagrant-up+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezkkrBUANU2QBL6U2TovoXuoU_SuT3LaZ1arH_x8_hdyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to