Configure multiple hosts with one YAML file
Based on laravel/homestead configuration
laravel/homestead allows you to define a single host automatically configured with nginx, mysql and blackfire, but if you want to have more than one host, for example one for web and another for the ddbb it is not possible
Using this repository you can define as many hosts as you want in a single YAML file and let Vagrant configure them
Include the repository into your project by git submodule
it and copy required files out to your project
git submodule init
git submodule add git@github.com:juliangut/vagrantMultiHost.git vagrant
cp ./vagrant/Vagrantfile ./
cp ./vagrant/Hosts.yaml ./
Now you should have a ./vagrant
directory and two files in your project root directory
Update Hosts.yaml
with your hosts configurations and you are ready to start using vagrant
vagrant status
vagrant up <host_name>
Review laravel/homestead documentation for rest of available configuration options
You can define your own named boxes providing a name and url to the box file. This is handly for example if you use private company boxes.
Is the path to this git module directory, normally if you didn't change directory name on git submodule add
you should leave this configuration untouched
Each host has a name that will be used on the command line to interact with the host
vagrant up web
vagrant destroy ddbb
Is the name of the virtual machine in VirtualBox
Every hosts setting autostart to true will be automatically started with vagran up
without asking for a host name. By default all hosts are set to autostart false
The name of the box to use, can be any of default vagrant boxes (defaults to laravel/homestead) or one of your previously named boxes
Virtual machine's ip, if none provided ips will be given secuentially per host starting on 192.168.10.101
Lets you configure each virtual machine independently. Review Vagrant documentation for VirtualBox configurations
List all your custom bash scripts you want to use to provide the box
See file LICENSE included with the source code for a copy of the license terms