2016-09-18 32 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)' –

回答