saltstack介绍:
saltstack是基于python开发的一套C/S自动化运维工具,通信采用了zeromq消息队列的(pub/sub),数据传输采用了AES(高级加密)保证安全性,认证采用了SSL方式。
安装 官方文档
https://repo.saltproject.io/
1.运行以下命令来安装 SaltStack 存储库和密钥:
sudo rpm --import https://repo.saltproject.io/py3/redhat/7/x86_64/3004/SALTSTACK-GPG-KEY.pub
curl -fsSL https://repo.saltproject.io/py3/redhat/7/x86_64/3004.repo | sudo tee /etc/yum.repos.d/salt.repo
sudo yum clean expire-cache
2.安装 只要在一台主机上装一个master,其他的机器都是minion
sudo yum install salt-master
sudo yum install salt-minion
3.配置
vi /etc/salt/master
interface: 0.0.0.0
vi /etc/salt/minion
master: 192.168.1.41
4.启动
sudo systemctl enable salt-master && sudo systemctl start salt-master
sudo systemctl enable salt-minion && sudo systemctl start salt-minion
5.测试saltstack 5.1 查看minion列表
[root@localhost ~]
Accepted Keys:
Denied Keys:
Unaccepted Keys:
192.168.1.41
Rejected Keys:
5.2 接受所有key
[root@localhost ~]
The following keys are going to be accepted:
Unaccepted Keys:
192.168.1.41
Proceed? [n/Y] y
Key for minion 192.168.1.41 accepted.
5.3 简单测试
[root@localhost ~]
192.168.1.41:
True
|