1. 程式人生 > >saltstack安裝 配置

saltstack安裝 配置

salt

yum search salt
yum 配置 同步到所有機器
for i in host{1..99};do rsync -a /etc/yum.repos.d/salt.repo ${i}:/etc/yum.repos.d/ -e ‘ssh‘;done

server 服務端
yum install salt-master

systemctl start salt-master 啟動服務
端口4505 4506
ss -ltn | grep "450[56]"

client all 所有客戶端
for i in host{1..99};do ssh $i ‘yum install -y stalt-minion‘ ;done

master 是誰 sm
id 你是誰 客戶機主機名
network.ip=0.0.0.0

vim /etc/salt/minion
master: host99
id: host1
all host configure
systemctl start salt-minion

sed -n "/^#master: /p" /etc/salt/minion
sed -n "/^#id: /p" /etc/salt/minion
sed -e "s/^#\(master:\).*/\1 host99/" 
sed -e "/^#\(id:\)/1 ${HOSTNAME}/" /etc/salt/minion

salt-key -L

saltstack安裝 配置