2016-09-18 33 views
0

我不能讓我的廚師食譜使用depends 'httpd',我的繼承人metadata.rb廚師:不能使用取決於「httpd的」在metadata.rb

name 'awesome_customers_rhel' 
maintainer 'The Authors' 
maintainer_email '[email protected]' 
license 'all_rights' 
description 'Installs/Configures awesome_customers_rhel' 
long_description 'Installs/Configures awesome_customers_rhel' 
version '0.1.0' 

depends 'selinux', '~> 0.9.0' 
depends 'firewall', '~> 2.4.0' 
depends 'httpd' 

任何試圖讓我使用depends 'httpd'導致此錯誤。

我正在通過tutorial使用廚師httpd cookbook from Chef Supermarket來配置廚房測試實例。但是我卡在step 6。廚房不會收斂由於某些問題與compat_resource,引導和我的食譜之間的唯一區別是,我使用的httpd優化版本0.4.0

-----> Starting Kitchen (v1.11.1) 
-----> Converging <default-centos-72>... 
     Preparing files for transfer 
     Preparing dna.json 
     Resolving cookbook dependencies with Berkshelf 4.3.5... 
     Removing non-cookbook files before transfer 
     Preparing validation.pem 
     Preparing client.rb 
-----> Chef Omnibus installation detected (install only if missing) 
     Transferring files to <default-centos-72> 
     Starting Chef Client, version 12.14.60 
     resolving cookbooks for run list: ["awesome_customers_rhel::default"] 
     Synchronizing Cookbooks: 
     - awesome_customers_rhel (0.1.0) 
     - selinux (0.9.0) 
     - firewall (2.4.0) 
     - httpd (0.4.0) 
     - chef-sugar (3.4.0) 
     - compat_resource (12.14.3) 
     Installing Cookbook Gems: 
     Compiling Cookbooks... 

     ================================================================================ 
     Recipe Compile Error in /tmp/kitchen/cache/cookbooks/httpd/libraries/helpers.rb 
     ================================================================================ 

     LoadError 
     --------- 
     cannot load such file -- chef_compat/resource 

     Cookbook Trace: 
     --------------- 
     /tmp/kitchen/cache/cookbooks/httpd/libraries/helpers.rb:1:in `<top (required)>' 

     Relevant File Content: 
     ---------------------- 
     /tmp/kitchen/cache/cookbooks/httpd/libraries/helpers.rb: 

     1>> require 'chef_compat/resource' 
     2: 
     3: module HttpdCookbook 
     4: module Helpers 
     5:  def default_apache_version 
     6:  return '2.2' if node['platform_family'] == 'debian' && node['platform_version'].to_i == 7 
     7:  return '2.2' if node['platform_family'] == 'debian' && node['platform_version'] == '12.04' 
     8:  return '2.2' if node['platform_family'] == 'debian' && node['platform_version'].to_i == 6 
     9:  return '2.2' if node['platform_family'] == 'debian' && node['platform_version'].to_i == 7 
     10:  return '2.2' if node['platform_family'] == 'omnios' 

     Platform: 
     --------- 
     x86_64-linux 


     Running handlers: 
     [2016-09-18T19:03:29+00:00] ERROR: Running exception handlers 
     Running handlers complete 
     [2016-09-18T19:03:29+00:00] ERROR: Exception handlers complete 
     Chef Client failed. 0 resources updated in 01 seconds 
     [2016-09-18T19:03:29+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out 
     [2016-09-18T19:03:29+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
     [2016-09-18T19:03:29+00:00] ERROR: cannot load such file -- chef_compat/resource 
     [2016-09-18T19:03:29+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 
>>>>>> ------Exception------- 
>>>>>> Class: Kitchen::ActionFailed 
>>>>>> Message: 1 actions failed. 
>>>>>>  Converge failed on instance <default-centos-72>. Please see .kitchen/logs/default-centos-72.log for more details 
>>>>>> ---------------------- 
>>>>>> Please see .kitchen/logs/kitchen.log for more details 
>>>>>> Also try running `kitchen diagnose --all` for configuration 

我的繼承人.kitchen.yml

--- 
driver: 
    name: vagrant 
    network: 
    - ["private_network", {ip: "192.168.33.33"}] 

provisioner: 
    name: chef_zero 

platforms: 
    - name: centos-7.2 

suites: 
    - name: default 
    run_list: 
     - recipe[awesome_customers_rhel::default] 
    attributes: 
+0

看起來像' - compat_resource(12.14.3)'問題。嘗試與舊的' - compat_resource(12.10.6)' –

回答