salt-minion離線安裝

潇潇暮鱼鱼發表於2024-03-13

1.在nexus做salt官方的yum源代理

http://xxxx/repository/gw-yum-proxys 代理https://repo.saltproject.io/salt/py3/

2.在yum倉庫裡上傳repo檔案及salt.sh安裝檔案

latest.repo 檔案

[salt-repo]
name=Salt repo for RHEL/CentOS 7 PY3
baseurl=http://xxxx/repository/gw-yum-proxys/redhat/$releasever/$basearch/latest
skip_if_unavailable=True
failovermethod=priority
priority=10
enabled=1
enabled_metadata=1
gpgcheck=0

salt.sh安裝檔案

#下載repo
curl -fsSL https://xxxx/packages/initial/salt/redhat/latest.repo | sudo tee /etc/yum.repos.d/salt.repo
#安裝salt-minion
sudo yum install -y salt-minion
#修改配置檔案
sudo cat <<EOF >>/etc/salt/minion.d/minion.conf
master: xxxx
id: `hostname -I | cut -d' ' -f1`
EOF
#啟動salt-minion
sudo systemctl start salt-minion
#檢視salt-minion狀態
systemctl status salt-minion

3.在伺服器下載salt.sh檔案並執行

wget https://xxxx/packages/initial/salt/redhat/salt.sh | sh salt.sh

相關文章