gpt4 book ai didi

chef-infra - Chef : No available formula with the name "httpd"

转载 作者:行者123 更新时间:2023-12-02 09:29:58 25 4
gpt4 key购买 nike

我正在学习 Chef,在尝试安装 httpd 包时被困在这里。我有一个在 Mac OS 上安装 httpd 包的简单方法。我安装了 ChefDK。

webserver.rb

package 'httpd' 

当我运行 chef-apply webserver.rb 时,它会抛出错误:

    Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of brew info --json=v1 httpd ----
STDOUT:
STDERR: Error: No available formula with the name "httpd"
---- End output of brew info --json=v1 httpd ----
Ran brew info --json=v1 httpd returned 1

Resource Declaration:
---------------------
# In webserver.rb

1: package 'httpd'

Compiled Resource:
------------------
# Declared in webserver.rb:1:in `run_chef_recipe'

homebrew_package("httpd") do
action [:install]
retries 0
retry_delay 2
default_guard_interpreter :default
package_name "httpd"
declared_type :package
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
end

有人可以告诉我我在这里错过了什么吗?谢谢。

最佳答案

那么让我们来看看您正在做的每一部分:

chef-apply采用单个 Chef Recipe 并在本地运行。这意味着发生的一切都在您的 Mac 笔记本电脑上。

这个 Recipe 使用package安装名为 'httpd' 的资源。 Chef 包含了一系列 package 的提供者资源,因此在 Ubuntu 上它使用 APT,在 CentOS 上它使用 YUM,在 OS X 上它使用 Homebrew(即 brew install )。

在安装软件包之前,Chef 会检查它是否已安装并收集有关软件包的其他详细信息。对于 Homebrew,它使用 brew info为了这。所以你最终得到命令 brew info httpd ,给出或采用 JSON 输出格式参数以使其更易于解析。 Homebrew 没有名为 'httpd' 的包(公式)因此它会返回一个错误,然后 Chef 会向上提升该错误链。

在更深层次上,Homebrew 不会打包 Apache(我猜您正在尝试安装),因为它是 OS X 中默认提供的。即使打包了,大多数打包系统也将其称为 apache2。 。仅 RHEL/CentOS 衍生版本调用该包 httpd仍然。

关于chef-infra - Chef : No available formula with the name "httpd",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34240179/

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