使用SaltStack的状态模块接受新添加的Repo的包签名密钥

时间:2016-11-17 19:04:20

标签: salt-stack opensuse zypper

问题

在独立的小工具上,salt.states.pkgrepo.managed用于添加非标准软件仓库。发生的问题是,当跟随sudo zypper update运行时,系统未接受(自动)密钥,从而阻止更新或安装任何软件包,从而导致下一个状态失败。

重申使用mysuse.sls的确切状态:

suse-gis-repo:
  pkgrepo.managed:
    - name: Application_Geo
    - humanname: Applications related to the earth (GIS, Mapping, geodesy, GPS, astronomy) (openSUSE_Leap_42.1)
    - baseurl: http://download.opensuse.org/repositories/Application:/Geo/openSUSE_Leap_42.1/
    - gpgcheck: 1
    - gpgkey: http://download.opensuse.org/repositories/Application:/Geo/openSUSE_Leap_42.1//repodata/repomd.xml.key

问题是当州的下一阶段运行时:

packages_uptodate:
  pkg.uptodate:
    - refresh: True

由于下面显示了必要的人工干预,它失败了:

New repository or package signing key received:

Repository:       Application_Geo
Key Name:         Application:Geo OBS Project <Application:Geo@build.opensuse.org>
Key Fingerprint:  195E2111 06BC205D 2A9C2222 CC7F0748 9591C39B
Key Created:      Thu 16 Jul 2015 08:01:27 PM CEST
Key Expires:      Sat 23 Sep 2017 08:01:27 PM CEST
Rpm Name:         gpg-pubkey-9591c39b-55a7f177


Do you want to reject the key, trust temporarily, or trust always? [r/t/a/? shows all options] (r):

尝试解决

  1. 即使suse-gis-repo的最后两行被注释掉(即gpgchk&amp; gpgkey),上述问题仍然存在。
  2. zypper ar -G <URI>确保未检查gpgkey,但在盐状态下没有此选项。
  3. 尝试了一次解决此问题的尝试,而不是尝试使用salt.states.pkgrepo.managed尝试使用相应的执行模块zypper.mod_repo
  4. #3中描述的例子如下:

    package_autoaccept_key:
      module.run:
        - name: zypper.mod_repo
        - kwargs: {
              repo: 'Application_Geo',
              baseurl: 'http://download.opensuse.org/repositories/Application:/Geo/openSUSE_Leap_42.1/',
              enabled: 'True',
              refresh: 'True',
              gpgcheck: 'True',
              gpgautoimport: 'True'
          }
    

    错误:

    local:
    ----------
        ID: package_autoaccept_key
        Function: module.run
        Name: zypper.mod_repo
        Result: False
        Comment: Module function zypper.mod_repo is not available
        Started: 02:18:34.108787
        Duration: 543.087 ms
        Changes:
    
    Summary for local
    ------------
    Succeeded: 0
    Failed:    1
    ------------
    

    问题

    1. 有没有办法通过状态或执行模块自主接受密钥(始终信任)?

    2. 执行模块是否能够通过module.run功能在独立的小兵上运行?

    3. 如果他们能够在独立的小兵上运行,那么确保所需模块存在的最佳方法是什么?

    4. 在一个州使用module.run的方法是否存在针对上述问题的错误方法?如果是这样,为什么?

0 个答案:

没有答案