安装
配置安装源
1 rpm --import https://repo.saltstack.com/yum/redhat/7/x86_64/latest/SALTSTACK-GPG-KEY.pub
2 cd /etc/yum.repos.d/
3
4
5 [root@node1 yum.repos.d]# vim saltstcak.repo
6 [saltstack-repo]
7 name=SaltStack repo for RHEL/CentOS $releasever
8 baseurl=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
9 enabled=1
10 gpgcheck=1
11 gpgkey=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
安装salt服务端
安装salt客户端
启动salt-master
systemctl enable salt-master
systemctl start salt-master
配置salt-minion文件
[root@node1 salt]# vim /etc/salt/minion
master: 192.168.16.16
启动salt-minion
systemctl start salt-minion
# minion在第一次启动时会在/etc/salt/下生成pki目录,在minion下生成自己的公钥和私钥,会把公钥发给master保存在/etc/salt/pki/master/minions_pre下,并且已id命名
[root@node2 salt]# tree pki
pki
├── master
└── minion
├── minion.pem
└── minion.pub
认证
[root@node1 salt]# salt-key
Accepted Keys:
Denied Keys:
Unaccepted Keys:
node1
node2
Rejected Keys:
[root@node1 salt]# salt-key -A
The following keys are going to be accepted:
Unaccepted Keys:
node1
node2
Proceed? [n/Y] y
Key for minion node1 accepted.
Key for minion node2 accepted.