在我的自定義廚師食譜(位於https://github.com/sanguis/chef-omeka/tree/lwrp)。從自定義資源調用時,廚師Apache2 cookbook資源無法找到服務[apache2]
我正在從自定義solo.rb配方調用的自定義資源(LWRP)中調用Apache2資源web_app。
include_recipe 'apache2'
web_app url do
server_name url
server_aliases aliaes
cookbook_name 'apache2'
docroot dir
allow_override 'All'
directory_index 'false'
# notifies :reload, 'service[apache2]', :delayed
end
這這將返回一個錯誤:
[#] [2016-02-23T23:02:31+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[#] [2016-02-23T23:02:31+00:00] ERROR: instanceomeka.dev had an error: Chef::Exceptions::ResourceNotFound: resource execute[a2enmod headers] is configured to notify resource service[apache2] with action reload, but service[apache2] cannot be found in the resource collection. execute[a2enmod headers] is defined in /tmp/kitchen/cache/cookbooks/apache2/definitions/apache_module.rb:35:in `block in from_file'
然而,當我打電話相同的資源直接定製配方here(線126)的內部工作原理。
我運行列表是波紋管
# - recipe[build-essential]
- recipe[php::default]
- recipe[apache2]
- recipe[apache2::mod_rewrite]
# - recipe[apache2::mod_expires]
- recipe[apache2::mod_ssl]
- recipe[apache2::mod_php5]
- recipe[omeka::default]
- recipe[omeka::solo]
attributes: # - recipe[build-essential]
- recipe[php::default]
- recipe[apache2]
- recipe[apache2::mod_rewrite]
# - recipe[apache2::mod_expires]
- recipe[apache2::mod_ssl]
- recipe[apache2::mod_php5]
- recipe[omeka::default]
- recipe[omeka::solo]
attributes:
machine_fqdn: omeka.dev
machine_fqdn_as_hostname: true
apache2:
listen_ports: ["80", "443"]
machine_fqdn: omeka.dev
machine_fqdn_as_hostname: true
apache2:
listen_ports: ["80", "443"]
這失敗在兩個Ubuntu的14.04和centos7。
所以他這樣說我創建一個我希望能夠從其他食譜中使用我的食譜資源,我應該只是做舊的LWRP風格,直到完成上述工作爲止? –
以上內容不會被整理出來AFAIK,這是Chef核心團隊如何實現的系統性問題。 Poise的幫手或類似的項目可能會比Chef的內部工具更好地滿足這個用例。舊式的LWRPs會以相同的方式受到影響,除非您不使用'use_inline_resources',否則您不應該這樣做,因爲這有更多奇怪的問題。 – coderanger
感謝您的信息。 –