厨师无法获得httpd依赖

前端之家收集整理的这篇文章主要介绍了厨师无法获得httpd依赖前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用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

我正在遵循AWS创建LAMP环境的教程.不幸的是,当我把它运行到我的Instance时,opsworks_cookbook_demo :: default(它会运行一些include,包括webserver.)我得到的错误是找不到httpd cookbook,我已经添加了我的Metadaba.rb取决于’httpd”〜> ..’,有人可以指导我这里做错了什么.因为我假设每当你放置’httpd’它将扩展我的食谱以使用该食谱.

这个案子我需要berkshelf吗? (目前我正在使用AWS OpsWorks并在github中使用我的食谱)

您必须提前下载所有依赖项以提供给OpsWorks.有关详细信息,请参阅 https://docs.aws.amazon.com/opsworks/latest/userguide/best-practices-packaging-cookbooks-locally.html.较旧的Chef 11堆栈曾经通过在目标上运行berks供应商来为您自动化,但现在您需要在工作站上自己执行此操作.

猜你在找的设计模式相关文章