Created
November 9, 2015 00:01
-
-
Save aarontc/c0589dbc507e324fa91c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [[ $UID -ne '0' ]]; then | |
echo "Must be root" >&2 | |
exit 1 | |
fi | |
# Check if minion running | |
set +e | |
pgrep salt-minion | |
x=$? | |
set -e | |
if [[ $x -ne '0' ]]; then | |
set +e | |
dpkg -l salt-minion >/dev/null 2>&1 | |
x=$? | |
set -e | |
if [[ $x -ne '0' ]]; then | |
echo "Installing salt minion..." | |
# Set up sources. | |
wget -O - https://repo.saltstack.com/apt/ubuntu/ubuntu14/latest/SALTSTACK-GPG-KEY.pub | apt-key add - | |
echo "deb http://repo.saltstack.com/apt/ubuntu/ubuntu14/latest trusty main" > /etc/apt/sources.list.d/salt.list | |
apt-get update | |
apt-get -y install salt-minion | |
fi | |
#echo "Starting salt minion..." | |
#update-rc.d salt-minion defaults | |
#service salt-minion start | |
else | |
echo "Salt minion running" | |
fi | |
salt-call state.highstate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment