首页 > 代码库 > salt-ssh安装salt-minion

salt-ssh安装salt-minion

一、安装salt

yum install -y http://repo.saltstack.com/yum/redhat/salt-repo-2016.3-1.el7.noarch.rpm


二、修改默认源

cat /etc/yum.repos.d/salt-2016.3.repo 
[salt-2016.3]
name=SaltStack 2016.3 Release Channel for RHEL/Centos $releasever
#baseurl=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/2016.3
baseurl=http://debian.ustc.edu.cn/salt/yum/redhat/$releasever/$basearch/2016.3
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/saltstack-signing-key


三、 安装salt-minion

cp /etc/yum.repos.d/salt-2016.3.repo /srv/salt/
salt-ssh ‘192.168.56.103‘  pkg.install http://repo.saltstack.com/yum/redhat/salt-repo-2016.3-1.el7.noarch.rpm
salt-ssh ‘192.168.56.103‘  cp.get_file salt://salt-2016.3.repo /etc/yum.repos.d/salt-2016.3.repo
salt-ssh ‘192.168.56.103‘  pkg.install salt-minion

四、配置salt-minion

1、编辑 /srv/salt/192.168.56.103_minion.conf
cat /srv/salt/192.168.56.103_minion.conf
master: 192.168.56.102
id: 192.168.56.103

2、配置salt-minion

salt-ssh ‘192.168.56.103‘ cp.get_file salt://192.168.56.103_minion.conf /etc/salt/minion.d/192.168.56.103_minion.conf
salt-ssh ‘192.168.56.103‘ service.enable salt-minion
salt-ssh ‘192.168.56.103‘ service.restart salt-minion

五、在master端口添加key

salt-key -a 192.168.56.10


本文出自 “武陵荒草” 博客,请务必保留此出处http://penguintux.blog.51cto.com/3021117/1857480

salt-ssh安装salt-minion