sudo yum install https://repo.saltstack.com/yum/redhat/salt-repo-latest.el7.noarch.rpm
sudo yum install -y sudo git tmux vim salt-master python-pip
sudo yum install salt-master
sudo yum install salt-minion
sudo yum install salt-ssh
sudo yum install salt-syndic
sudo yum install salt-cloud
sudo yum install salt-api
sudo systemctl restart salt-master
sudo systemctl restart salt-minion
/etc/init.d/salt-master restart
service salt-master restart
启动服务端
客户端修改连接参数去连接服务端:
/etc/salt/minion中:
master#服务端ip
id:客户端的自己的名字
服务端:salt-key -L 显示连接上来的客户端加入服务端如下图所示:
salt执行命令
通过saltstack安装apache:
apache安装的sls脚本路劲如下:
安装的命令和截图:sudo salt '*' state.sls apache
test