Skip to content

Instantly share code, notes, and snippets.

@ilkka
Created October 7, 2015 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilkka/2498c9d0d9fa7876f6f7 to your computer and use it in GitHub Desktop.
Save ilkka/2498c9d0d9fa7876f6f7 to your computer and use it in GitHub Desktop.
multi machine Vagrantfile with provisioning
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.define 'first' do |first|
first.vm.box = "trusty-server-cloudimg-i386"
first.vm.hostname = "first"
first.vm.provision "shell", inline: <<-SHELL
echo "this runs only in 'first', now in `hostname`"
SHELL
end
config.vm.define 'second' do |second|
second.vm.box = "trusty-server-cloudimg-i386"
second.vm.hostname = "second"
second.vm.provision "shell", inline: <<-SHELL
echo "this runs only in 'second', now in `hostname`"
SHELL
end
config.vm.provision "shell", inline: <<-SHELL
echo "this runs twice, now in `hostname`"
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment