gpt4 book ai didi

git - 为什么 SaltStack pkg.installed 命令无法识别 CentOS 6.6 上已安装的软件包

转载 作者:太空宇宙 更新时间:2023-11-04 14:14:20 25 4
gpt4 key购买 nike

我有一系列在 Ubuntu 上运行良好的公式,但我发现它们在运行 CentOS 版本 6.6(最终版本)的我的 Minion 上无法正常运行。 Minion正在运行salt版本:salt-minion 2014.7.0 (Helium)

例如,git-core 包不起作用:

git-core:
pkg.installed

当我运行 highstate 时,出现此错误:

[user] out: ----------
[user] out: ID: git-core
[user] out: Function: pkg.installed
[user] out: Result: False
[user] out: Comment: Package 'git-core' not found (possible matches: git, wt-git)
[user] out: Changes:
[user] out: ----------

当我尝试在服务器上手动安装要求时,它们似乎已经安装:

root@host [225 01:41:35 /home/project]# yum install git-core
Loaded plugins: changelog, downloadonly, fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* epel: mirror.steadfast.net
Package wt-git-1.7.1-1.x86_64 already installed and latest version
Nothing to do

为什么在安装 git-core 后,SaltStack 似乎“找不到”它?

顺便说一句,跨软件包存在一整套错误,而不仅仅是 git,包括:

[user] out: ----------
[user] out: ID: ssh
[user] out: Function: service.running
[user] out: Result: False
[user] out: Comment: The named service ssh is not available
[user] out: Changes:
[user] out: ----------
[user] out: ID: iptables-persistent
[user] out: Function: pkg.installed
[user] out: Result: False
[user] out: Comment: The following package(s) were not found, and no possible matches were found in the package db: iptables-persistent
[user] out: Changes:
[user] out: ----------
[user] out: ID: iptables-persistent
[user] out: Function: service.running
[user] out: Result: False
[user] out: Comment: The named service iptables-persistent is not available
[user] out: Changes:
[user] out: ----------
[user] out: ID: openjdk-6-jdk
[user] out: Function: pkg.installed
[user] out: Result: False
[user] out: Comment: The following package(s) were not found, and no possible matches were found in the package db: openjdk-6-jdk
[user] out: Changes:
[user] out: ----------
[user] out: ID: tomcat6
[user] out: Function: pkg.installed
[user] out: Result: False
[user] out: Comment: The following packages failed to install/update: tomcat6.
[user] out: Changes:
[user] out: ----------

最佳答案

我确信您已经找到了这个,但为了下一个人的缘故,它是我的 CentOS 机器上的 sshd。尝试这样的事情:

{% if grains['os_family']=="RedHat" %}

sshd:
service.running

{% elif grains['os_family']=="Debian" %}

ssh:
service.running

{% endif %}

关于git - 为什么 SaltStack pkg.installed 命令无法识别 CentOS 6.6 上已安装的软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27938174/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com