Skip to content

Instantly share code, notes, and snippets.

@jodok
Last active October 17, 2017 19:04
Show Gist options
  • Save jodok/e7855cee44c0f818512460a2c1752573 to your computer and use it in GitHub Desktop.
Save jodok/e7855cee44c0f818512460a2c1752573 to your computer and use it in GitHub Desktop.
#!/bin/bash
yum -y install https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el7.noarch.rpm
yum -y install salt-minion
sed -ie 's/#master: salt/master: salt.crate.io/' /etc/salt/minion
service salt-minion restart
TIMEOUT=600
COUNT=0
while [ ! -f /etc/salt/pki/minion/minion_master.pub ]; do
echo "Waiting for salt install."
if [ "$COUNT" -ge "$TIMEOUT" ]; then
echo "minion_master.pub not detected by timeout"
exit 1
fi
sleep 5
COUNT=$((COUNT+5))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment