在我的定制厨师食谱中(位于https://github.com/sanguis/chef-omeka/tree/lwrp)。
我正在从自定义 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] 致命:如果您提交错误报告,请提供 stacktrace.out 文件的内容
[#] [2016-02-23T23:02:31+00:00] 错误:instanceomeka.dev 出现错误:Chef::Exceptions::ResourceNotFound: 资源执行 [a2enmod 标头] 配置为通知资源服务 [apache2]重新加载操作,但在资源集合中找不到 service[apache2]。execute[a2enmod headers] 在 /tmp/kitchen/cache/cookbooks/apache2/definitions/apache_module.rb:35:in `block in from_file' 中定义
但是,当我在此处(第 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 上都失败了。