Salt Stack:功能:pkg.installed。 Yum不会更新已安装的软件包

时间:2017-05-23 08:47:19

标签: centos rpm yum salt-stack

我的代码是:

others:
  pkg.installed:
    - sources:
      - epel-release: https://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
      - salt-latest: https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm

我收到了错误:

errors:
    - Loaded plugins: fastestmirror, replace
      Setting up Install Process
      Examining     /var/cache/salt/minion/extrn_files/base/repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm: salt-repo-latest-2.el6.noarch
      /var/cache/salt/minion/extrn_files/base/repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm: does not update installed package.
      Error: Nothing to do

我认为这可能是 salt-repo-latest-2.el6.noarch.rpm 的问题。当我为这个RPM手动运行yum install时,我遇到了同样的错误,但是在Salt Stack中运行只会出现此错误。

它应以:

结束
      ID: others
Function: pkg.installed
  Result: True
 Comment: All specified packages are already installed
 Started: 10:45:33.171971
Duration: 595.672 ms
 Changes: 

但我得到了:

      ID: others
Function: pkg.installed
  Result: False
 Comment: Error occurred installing package(s). Additional info follows:

          errors:
              - Loaded plugins: fastestmirror, replace
                Setting up Install Process
                Examining /var/cache/salt/minion/extrn_files/base/repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm: salt-repo-latest-2.el6.noarch
                /var/cache/salt/minion/extrn_files/base/repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm: does not update installed package.
                Error: Nothing to do
 Started: 10:46:13.906581
Duration: 8988.515 ms
 Changes:  

1 个答案:

答案 0 :(得分:0)

包名是salt-repo not salt-latest。

代码应该是:

others:
  pkg.installed:
    - sources:
      - epel-release: https://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
      - salt-repo: https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm