Bootstrap Salt

Now for something different. If you have a VPS provider that allows you to use a custom script after the networking layer is up, here is a quick way to install salt. On debian.

wget -O - https://repo.saltstack.com/py3/debian/9/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
echo "deb http://repo.saltstack.com/py3/debian/9/amd64/latest stretch main" > /etc/apt/sources.list.d/saltstack.list
apt-get update
apt-get install -y salt-minion curl
sed -i 's/#master: salt/master: IP_OF_MASTER/' /etc/salt/minion
ADDR=`curl http://ifconfig.me | sed 's/\./-/g'`
echo "ip-$ADDR" > /etc/hostname
sed -i "s/debian/ip-$ADDR/" /etc/hosts
sed -i "s/#id:/id: ip-$ADDR/" /etc/salt/minion
sed -i 's/#reactor_worker_threads: 10/reactor_worker_threads: 1/' /etc/salt/minion
systemctl restart salt-minion