Skip to content

Instantly share code, notes, and snippets.

@cedricporter
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedricporter/16f902c3621b643d927e to your computer and use it in GitHub Desktop.
Save cedricporter/16f902c3621b643d927e to your computer and use it in GitHub Desktop.
init_salt_minion.sh
#!/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