0

我正在使用这个 github存储库来了解 Berkshelf 与 Amazon Opsworks 一起使用时的工作原理。我正在尝试的基本思想是,如果我在berksfile 中提到apache2 作为我的phpapp 配方的依赖项,那么它将自动管理apache2 的依赖项,而apache2本身就是phpapp 的依赖项。当我使用 AWS opsworks 尝试此操作时,我收到以下错误。

   ================================================================================
   Error executing action `run` on resource 'execute[enable mod_proxy for apache-tomcat binding]'
   ================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /usr/sbin/a2enmod proxy ----
STDOUT: 
STDERR: ERROR: Module proxy does not exist!
---- End output of /usr/sbin/a2enmod proxy ----
Ran /usr/sbin/a2enmod proxy returned 1


Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache.stage2/cookbooks/opsworks_java/recipes/apache_tomcat_bind.rb

1: execute 'enable mod_proxy for apache-tomcat binding' do
2:   command '/usr/sbin/a2enmod proxy'
3:   not_if do
4:     ::File.symlink?(::File.join(node['apache']['dir'], 'mods-enabled', 'proxy.load')) || node['opsworks_java']['tomcat']['apache_tomcat_bind_mod'] !~ /\Aproxy/
5:   end
6: end
7: 



Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/opsworks_java/recipes/apache_tomcat_bind.rb:1:in `from_file'

execute("enable mod_proxy for apache-tomcat binding") do
action "run"
retries 0
retry_delay 2
command "/usr/sbin/a2enmod proxy"
backup 5
returns 0
cookbook_name "opsworks_java"
recipe_name "apache_tomcat_bind"
not_if { #code block }
end
4

1 回答 1

1

metadata将 insted of添加cookbook "apache2" 到您的 Berksfile 中,Berkshelf 会将您的本地食谱添加到本地食谱列表中,它的依赖项来自metadata.rb

来自 berkshelf.com:

The metadata keyword is like saying gemspec in Bundler’s Gemfile. It says,
“There is a metadata.rb file within the same relative path of my Berksfile”.
This allows you to resolve a Cookbook’s dependencies that you are currently
working on just like you would resolve the dependencies of a Gem that 
you are currently working on with Bundler.

这是类似的问题

于 2014-11-28T07:44:21.357 回答