#安装salt-master
yum install -y salt-master
#这个手动改一下吧 shell取IP 差异太大
#sed -i 's#\#interface#interface '`ifconfig|sed...`'#g' /etc/salt/minion
systemctl start salt-master
systemctl enable salt-master
#安装salt-minion 以主机名一键配置,master 手动配置
yum install -y salt-minion
#手动改master 名
sed -i 's#\#master: salt#master: m1#g' /etc/salt/minion
sed -i 's#\#id:#id: '`hostname`'#g' /etc/salt/minion
systemctl start salt-minion
systemctl enable salt-minion
#配置出错时,卸载salt-minion
yum remove -y salt-minion
find /etc -name "salt" -exec \rm -rf {} \;