Archive for the ‘vagrant’ Category

Vagrant: Create a series of VMs from a hostname array

I couldn’t find any examples of creating VMs from a array of strings online so sat down to work something out myself. Here’s how you do it… Vagrant.configure(“2”) do |config| [ “web1”, “db1”, “web2”, “db2”, “backup1”, “backup2”, “admin1” ].each do |host| config.vm.define “#{host}” do |nrpe| nrpe.vm.box = “bento/centos-7.5” nrpe.vm.provider :virtualbox do |vb| vb.customize [ “modifyvm”, […]