We are using Vagrant for most of our projects in order to provide the work environment for all people involved in the project. One of the things that we think is missing, is the option to easily override the Vagrant config locally. Developers could of course just change the Vagrantfile but this is not quite handy if it is managed via Git for example. Recently we came across the idea to include a local Vagrantfile if it exists:
Vagrant.configure("2") do |config| # # ... # if File.exists?(".Vagrantfile.local") then eval(IO.read(".Vagrantfile.local"), binding) end end
This allows us to extend or override any Vagrant config in the file
.Vagrantfile.local which developers exclude from Git. If you want to add a synced folder for example, the file could look like the following:
config.vm.synced_folder "../icingaweb2-module-director", "/usr/share/icingaweb2-modules/director" config.vm.synced_folder "../icingaweb2-module-businessprocess", "/usr/share/icingaweb2-modules/businessprocess"