Chef infra Chef无法获取httpd

Chef infra Chef无法获取httpd,chef-infra,chef-recipe,recipe,Chef Infra,Chef Recipe,Recipe,我正在学习厨师使用OpsWorks,目前我正在尝试创建一个食谱,将安装2包在一个实例中。我把我的食谱储存在github上。。在这里,我有一个类似这样的食谱-webserver.rb # Install apache and start the service httpd_service 'site' do mpm 'prefork' action [:create, :start] end # Add the site configuration httpd_config 'site

我正在学习厨师使用OpsWorks,目前我正在尝试创建一个食谱,将安装2包在一个实例中。我把我的食谱储存在github上。。在这里,我有一个类似这样的食谱-webserver.rb

# Install apache and start the service
httpd_service 'site' do 
  mpm 'prefork'
  action [:create, :start]
end

# Add the site configuration
httpd_config 'site' do
  instance 'site'
  source 'site.conf.erb'
  notifies :restart, 'httpd_service[site]'
end

#create the document root directory
#directory '/var/www/public_html' do
#  recursive true
#end

#write the homepage
file '/var/www/index.html' do 
  content '<html>This is a web</html>'
  mode '0644'
  owner 'web_admin'
  group 'web_admin'
end

# Install apache , config and etc END

# Install the mod_php5 apache module
httpd_module 'php' do 
  instance 'site'
end

#install php5-mysql
package 'php-mysql' do 
  action :install
  notifies :restart, 'httpd_service[site]'
end

#write the homepage
file '/var/www/index2.php' do 
  content '<html><?php echo phpinfo(); ?></html>'
  mode '0644'
  owner 'web_admin'
  group 'web_admin'
end
#安装apache并启动服务
httpd_服务“站点”do
mpm“预工作”
操作[:创建,:开始]
结束
#添加站点配置
httpd_配置“站点”do
实例“站点”
来源“site.conf.erb”
通知:重新启动“httpd_服务[站点]”
结束
#创建文档根目录
#目录'/var/www/public_html'do
#递归真
#结束
#写主页
文件'/var/www/index.html'do
内容“这是一个网站”
模式'0644'
所有者“网络管理员”
组“网络管理员”
结束
#安装apache、config等
#安装mod_php5 apache模块
httpd_模块“php”do
实例“站点”
结束
#安装php5-mysql
包'php-mysql'do
操作:安装
通知:重新启动“httpd_服务[站点]”
结束
#写主页
文件'/var/www/index2.php'do
内容“”
模式'0644'
所有者“网络管理员”
组“网络管理员”
结束
我正在学习AWS创建灯光环境的教程。不幸的是,当我在我的实例中运行这个时,opsworks_cookbook_demo::default(它将运行一些include,包括webserver。)得到一个错误,
未找到httpd cookbook,我已经在我的metadaba.rb上添加了它依赖于“httpd”~>,有人能告诉我这里的错误是什么吗。因为我假设,无论何时,只要你输入'httpd',它都会扩展我的食谱,以使用该食谱


我需要这个箱子的架子吗?(目前我正在使用AWS OpsWorks,并在github中有我的配方)

您必须提前下载所有依赖项才能提供给OpsWorks。有关更多信息,请参阅。旧的Chef 11 stacks过去通过在target上运行
berks vendor
来为您实现自动化,但现在您需要自己在工作站上实现这一点