Skip to content

Instantly share code, notes, and snippets.

@akaihola
Created February 20, 2013 20:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akaihola/4999231 to your computer and use it in GitHub Desktop.
Save akaihola/4999231 to your computer and use it in GitHub Desktop.
Salt minion bootstrap script for pristine Debian/Ubuntu virtual hosts
#!/bin/bash
# Salt minion bootstrap script for freshly installed Debian/Ubuntu
# virtual servers
#
# Let's assume you have a newly created Debian/Ubuntu VPS with no
# network interface running. To bootstrap Salt, copy this file into
# your home directory on the [SALT MASTER] and do the following on the
# VPS:
#
# $ sudo ip addr add [VPS IP ADDRESS]/[NETMASK] dev eth0
# $ sudo ip route add default via [GATEWAY IP ADDRESS]
# $ ssh [SALT MASTER] cat salt-bootstrap.sh | sudo bash
#
# On [SALT MASTER], do the following:
#
# # salt-key -L
# # salt-key -a <VPS NAME>
# # salt <VPS NAME> state.highstate
set -e
apt-get update
apt-get install -y python-{jinja2,m2crypto,crypto,yaml,zmq,virtualenv} msgpack-python
virtualenv --distribute --system-site-packages --prompt "(salt)" /opt/salt/venv
USE_SETUPTOOLS=1 /opt/salt/venv/bin/pip install salt
mkdir -p /etc/salt
echo "master: 10.10.10.100" >/etc/salt/minion
/opt/salt/venv/bin/salt-minion -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment