Skip to content

Instantly share code, notes, and snippets.

@ryan-lane
Created July 11, 2014 00:18
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 ryan-lane/94c7d96b5586d661f30f to your computer and use it in GitHub Desktop.
Save ryan-lane/94c7d96b5586d661f30f to your computer and use it in GitHub Desktop.
Salt development Vagrantfile
$script = <<SCRIPT
# Install salt dependencies
sudo apt-get -y update
sudo apt-get install -y build-essential libssl-dev python-dev python-m2crypto \
python-pip python-virtualenv python-zmq swig virtualenvwrapper git-core python-apt
if [ ! -d /srv/salt/venv ]
then
sudo mkdir -p /srv/salt/venv
fi
sudo chown vagrant /srv/salt/venv
virtualenv --system-site-packages /srv/salt/venv
if [ "$?" != "0" ]
then
echo "Failed to create the venv"
exit 1
fi
. /srv/salt/venv/bin/activate
pip install -U e git+https://github.com/saltstack/salt@develop#egg=salt
deactivate
if [ ! -L /usr/local/bin/salt-call ]
then
sudo ln -s /srv/ops/venv/bin/salt-call /usr/local/bin/salt-call
fi
SCRIPT
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
vb.cpus = 2
vb.memory = 1024
end
config.vm.box = "ubuntu/trusty64"
config.vm.provision :shell, :privileged => false, :inline => $script
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment