Archive for the ‘devops’ Category

Vagrant: Create a series of VMs from a hostname array


Warning: count(): Parameter must be an array or an object that implements Countable in /home/fbsqlcom/public_html/youdidwhatwithtsql.com/wp-content/plugins/wp-codebox/main.php on line 31

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… ?View Code RUBYVagrant.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| […]