Provision Vagrant with a shell
To allow everyone to be able to replicate the benchmark from my previous post, I’ve played with Vagrant to be able to provide correctly configured virtual machines.
I ended up provisioning two virtual machines in a single Vagrant file using shell provisioning.
I learned loads of unexpected things doing so that you will see in the shell files and the Vagrant file
- How to do a dist-upgrade bypassing the interactive questions about grub
- How to install the latest NodeJS
- How to provision using the vagrant user instead of the root user (:privileged => false)
- How to specify the number of CPUs used by the VM
- How to setup a private network with Vagrant
And that provisioning a Vagrant VM takes quite a long time (especially the dist-upgrade). My two VMs are 75% the same. It would be nice to be able to create a base VM that forks into the two final VMs.
Is there a way to do that apart from scripting to create a new box?