当前位置: 代码迷 >> 综合 >> 解决salt-minion安装异常: Error: Package: salt-2015.5.10-2.el6.noarch (epel) Requires: python(abi) = 2.6
  详细解决方案

解决salt-minion安装异常: Error: Package: salt-2015.5.10-2.el6.noarch (epel) Requires: python(abi) = 2.6

热度:16   发布时间:2023-12-24 10:09:30.0

使用yum install salt-minion -y安装salt从节点时报错如下:

解决方法:

vim /etc/yum.repos.d/saltstack.repo

[saltstack-repo]
name=SaltStack repo for RHEL/CentOS $releasever
baseurl=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
enabled=1
gpgcheck=1
gpgkey=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub

再使用yum install salt-minion -y重新安装报错如下:

yum clean all | sudo rm -r /var/cache/yum
yum clean all
yum makecache

再重新运行yum install salt-minion -y即可

在minion端配置master

vi /etc/salt/minion
master: master (大概在17行的位置)

设置master

vi /etc/salt/master
auto_accept: True

salt-key -L

添加key为Accepts Keys:

salt-key -A -y

salt执行远程命令

salt '*' cmd.run 'useradd $user_name'
salt '*' cmd.run 'userdel -r $user_name'
salt '*' cmd.run 'mkdir /home/istorm/test'
salt '*' cmd.run 'rm -rf /home/istorm/test'

 

  相关解决方案