【问题标题】:Why saltstate returns ERROR with pkg.installed (Windows) while application installs?为什么 saltstate 在应用程序安装时返回带有 pkg​​.installed (Windows) 的 ERROR?
【发布时间】:2021-08-16 05:19:32
【问题描述】:

我正在尝试在 salt minion (Windows 10) Cortex 上安装防病毒软件,使用 salt-call.bat

设置

{% set version = '73120981' %}
{% set source_path = 'INTERNAL_COMPANY_URL' %}

cortex:
  '{{version}}':
    {% if grains['cpuarch'] == 'AMD64' %}
    installer: '{{source_path}}/WindowsAgent{{version|replace(".", "_")}}_x64.msi'
    uninstaller: '{{source_path}}/WindowsAgent{{version|replace(".", "_")}}_x64.msi'
    arch: x64
    {% else %}
    installer: '{{source_path}}/WindowsAgent{{version|replace(".", "_")}}_x86.msi'
    uninstaller: '{{source_path}}/WindowsAgent{{version|replace(".", "_")}}_x86.msi'
    arch: x86
    {% endif %}
    full_name: 'Cortex {{version}}'
    install_flags: '/qn /norestart'
    uninstall_flags: '/qn /norestart'
    msiexec: True
    locale: en_US
    reboot: False

以下状态调用此状态:

install_cortex:
  pkg.installed:
    - name: cortex

当我执行命令 salt-call state.sls 时,我收到此错误:

C:\salt>salt-call.bat state.sls cortex
[ERROR   ] {'cortex': {'install status': 'success'}, 'Cortex XDR 7.3.1.20981': {'old': '', 'new': '7.3.1.20981'}}
local:
----------
          ID: install_cortex
    Function: pkg.installed
        Name: cortex
      Result: False
     Comment: The following packages failed to install/update: cortex
     Started: 20:07:05.612151
    Duration: 109018.207 ms
     Changes:
              ----------
              Cortex XDR 7.3.1.20981:
                  ----------
                  new:
                      7.3.1.20981
                  old:
              cortex:
                  ----------
                  install status:
                      success

Summary for local
------------
Succeeded: 0 (changed=1)
Failed:    1
------------
Total states run:     1
Total run time: 109.018 s

但是如果我运行 salt-call pkg.install 一切都会正常。

【问题讨论】:

    标签: windows salt-stack


    【解决方案1】:

    这可能是一个可能的解决方案:

    1. 手动安装 cortex
    2. 转到控制面板并从那里获取名称和版本。
    3. 在您的 repo 文件中,在 full_name 下提及准确捕获的名称以及版本的准确捕获版本。
    4. 做一个genrepo和refresh_db。

    这应该可以解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-17
      • 2019-09-18
      • 2017-07-21
      • 1970-01-01
      • 1970-01-01
      • 2014-06-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多