Using Vagrant for local development
After having migrated our infrastructure configuration to puppet we finally switched to developing most of our projects in virtual machines.
Vagrant is a huge help - it allows us to define concise configuration and provisioning instructions in one file, the Vagrantfile
.
Most of our projects now contain a Vagrantfile
which looks like this:
Vagrant.configure('2') do |config|
config.vm.box = 'cargomedia/debian-7-amd64-cm'
config.vm.network :private_network, ip: '10.10.10.12'
config.vm.synced_folder '.', '/home/vagrant/denkmal', :type => 'nfs'
config.librarian_puppet.puppetfile_dir = 'puppet'
config.vm.provision :puppet do |puppet|
puppet.module_path = 'puppet/modules'
puppet.manifests_path = 'puppet/manifests'
end
config.vm.provision 'shell', inline: [
'cd /home/vagrant/denkmal',
'composer --no-interaction install --dev',
'bin/cm app setup',
].join(' && ')
end