Skip to content

Instantly share code, notes, and snippets.

@karlp
Created June 26, 2013 18:31
Show Gist options
  • Save karlp/5870030 to your computer and use it in GitHub Desktop.
Save karlp/5870030 to your computer and use it in GitHub Desktop.
vagrant up sets up two virtual machines with salt-minion installed pointing to the static ip of my private machine.
#!/bin/sh
echo "192.168.255.124 salt" >> /etc/hosts
apt-get -y install python-software-properties avahi-daemon
add-apt-repository -y ppa:saltstack/salt
apt-get -y update
# really, don't do this...
#apt-get -y dist-upgrade
apt-get -y install salt-minion
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Create two virtual machines, each with salt-minion installed
# They are bridged, so they need to reach a salt master somewhere.
# you can use these for trying out salt for deploying slightly different
# data collector settings for different machines from the same salt states
Vagrant.configure("2") do |config|
box_url = "http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-i386-disk1.box"
servers = {
:dcc => "dcc99",
:legacy => "legacy"
}
servers.each do |sid, sname|
config.vm.define sid do |app_config|
app_config.vm.box = "precise32-cloud"
app_config.vm.box_url = box_url
app_config.vm.hostname = sname.to_s
app_config.vm.network :public_network, :bridge => "eth1"
#app_config.vm.network :bridged, :bridge => "eth1"
app_config.vm.provision :shell, :path => "vagrant.bootstrap.sh"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment