如何解决状态不是作为列表形成的
我有一个非常愚蠢的问题女巫无法解决...... :( 查看 Salt 文档应该有效,但不是...... - https://docs.saltproject.io/en/latest/topics/windows/windows-package-manager.html
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<svg style="background-color: #eee; width: 100%; height: 300px;"></svg>
我得到:
chrome:
latest:
full_name: 'Google Chrome'
installer: 'salt://software/GoogleChromeStandaloneEnterprise.msi'
uninstaller: 'salt://software/GoogleChromeStandaloneEnterprise.msi'
install_flags: '/qn /norestart'
uninstall_flags: '/qn /norestart'
msiexec: True
locale: en_US
reboot: False
putty:
latest:
installer: 'salt://software/putty-64bit-0.74-installer.msi'
uninstaller: 'salt://software/putty-64bit-0.74-installer.msi'
full_name: 'PuTTY'
install_flags: '/qn'
uninstall_flags: '/qn'
msiexec: True
locale: en_US
reboot: False
winscp:
latest:
full_name: 'WinSCP'
installer: 'salt://software/WinSCP-5.17.10-Setup.exe'
uninstaller: 'salt://software/WinSCP-5.17.10-Setup.exe'
install_flags: '/SP- /verysilent /norestart'
uninstall_flags: '/verysilent'
msiexec: False
locale: en_US
reboot: False
知道问题出在哪里吗?
解决方法
您似乎在同一个 SLS 文件中定义了多个软件产品?根据{{3}}:
文件中只能有一个短名称
作为旁注,您是否考虑过仅使用 the page you cite?它有适用于 Chrome、Putty 和 WinSCP 的软件包,并且有一个 Chocolatey 可以使用它。
,您显示的有问题的文件是 software definition file。
它不是您可以针对 Minion 运行的 state.sls
文件。
此软件定义文件可以存储在主服务器上的路径中,例如:win/repo-ng/custom_defs
(默认位置)。它可以在主配置中使用 winrepo_dir_ng
进行配置。
示例win/repo-ng/custom_defs/putty.sls
:
putty:
latest:
installer: 'salt://software/putty-64bit-0.74-installer.msi'
uninstaller: 'salt://software/putty-64bit-0.74-installer.msi'
full_name: 'PuTTY'
install_flags: '/qn'
uninstall_flags: '/qn'
msiexec: True
locale: en_US
reboot: False
然后在像 config_windows.sls
这样的状态文件中:
install-putty:
pkg.installed:
- name: putty
- version: latest
现在此 pkg.installed
将引用我们的自定义定义文件 putty.sls
并安装/管理 PuTTY。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。