ssl_certificate-cookbook
ssl_certificate-cookbook copied to clipboard
Compilation fails when using Chef Client 16.1.16
Cookbook Version
2.1.0
Chef Client Version
16.1.16
Platform Details
Centos 7.8
Scenario
Recipe compilation
Steps to Reproduce
Add the ssl_certificate
dependency, add the snippet below in a recipe, and then converge it.
cert = ssl_certificate 'webapp1' do
namespace node['webapp1'] # optional but recommended
end
Expected Result
Compiles successfully
Actual Result
================================================================================
Recipe Compile Error in /tmp/kitchen/cache/cookbooks/parent-cookbook/recipes/default.rb
================================================================================
NoMethodError
-------------
undefined method `ssl_certificate' for cookbook: child-cookbook, recipe: default :Chef::Recipe
Cookbook Trace:
---------------
/tmp/kitchen/cache/cookbooks/child-cookbook/recipes/default.rb:9:in `from_file'
/tmp/kitchen/cache/cookbooks/parent-cookbook/recipes/default.rb:12:in `from_file'
Relevant File Content:
----------------------
/tmp/kitchen/cache/cookbooks/child-cookbook/recipes/default.rb:
2: # Cookbook Name:: child-cookbook
3: # Recipe:: default
4: #
5: # Copyright (c) 2016 The Authors, All Rights Reserved.
6: # include_recipe '****-sshd::default'
7: #
8:
9>> cert = ssl_certificate 'proftpd' do
10: common_name node['child-cookbook']['public-name']
11: end
System Info:
------------
chef_version=16.1.16
platform=centos
platform_version=7.8.2003
ruby=ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
program_name=/opt/chef/bin/chef-solo
executable=/opt/chef/bin/chef-solo
Running handlers:
[2020-06-10T18:19:53+00:00] ERROR: Running exception handlers
Running handlers complete
[2020-06-10T18:19:53+00:00] ERROR: Exception handlers complete
Chef Infra Client failed. 0 resources updated in 10 seconds
[2020-06-10T18:19:53+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2020-06-10T18:19:53+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-06-10T18:19:53+00:00] FATAL: NoMethodError: undefined method `ssl_certificate' for cookbook: child-cookbook, recipe: default :Chef::Recipe
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Converge failed on instance <default-centos-78>. Please see .kitchen/logs/default-centos-78.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration