Last active
August 29, 2015 14:16
-
-
Save cedricporter/16f902c3621b643d927e to your computer and use it in GitHub Desktop.
init_salt_minion.sh
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 | |
# By Hua Liang<et@everet.org> | |
host_name=$1 | |
if [ -z ${host_name} ] ; then | |
echo "hostname is empty" | |
exit | |
fi | |
echo ${host_name} | |
echo "127.0.0.1 ${host_name}" | |
echo ${host_name} > /etc/hostname | |
hostname -b ${host_name} | |
echo "127.0.0.1 ${host_name}" >> /etc/hosts | |
apt-get update | |
apt-get install -y salt-minion | |
sed -i "s/#master: salt/master: 17ar.com/g" /etc/salt/minion | |
service salt-minion restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment