Salt installation Script

Source: Internet
Author: User

#!/bin/bashsaltmaster=192.168.0.10saltminionnane=$2initsaltevn () {         yum install wget -y        wget -c http ://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm         rpm -ivh epel-release-6-8.noarch.rpm}installsaltminion () {   if [  $# -ne 2 ]; then     echo $#      echo  "Explame installsalt.sh minion minionname"            exit 0   fi   initsaltevn   yum  install salt-minion -y   result=$?   if [  $result  -gt 0 ]; then     echo  "Repeat excute install  salt minion ***********"     yum install salt-minion -y   fi    filename=/etc/salt/minion   if [ ! -f  $filename  ];  then        echo  "yum install salt-minion failed  ! pleaease excute again this script "      exit  0;   fi   sed -i  "s/#master: salt/master:  $saltmaster/ G " /etc/salt/minion    sed -i " s/#id:*/id:  $saltminionNane/g " / etc/salt/minion   chkconfig --level 345 salt-minion  on          service salt-minion start}  installsaltmaster () {     InitSaltEvn    yum install salt-master -y     resut=$?    if [  $result  -lg 0 ] ;then      echo  "repeat excute install salt master ********************"           yum install salt-master -y    fi     chkconfig --level 345 salt-master on        service salt-master start}case  "$"  in    minion)          InstallSaltMinion [email protected]  &&  exit 0        ;;     master)         installsaltmaster | |  exit 0        ;;        *)         echo $ "Usage:  $0 {master|minion} "        exit 2esac 


This article is from the "James" blog, be sure to keep this source http://lizhuan.blog.51cto.com/8099531/1836815

Salt installation Script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.