[chef] Wrapper cookbook requires template of wrapped cookbook


Chronological Thread 
  • From: Steve Hummingbird < >
  • To:
  • Subject: [chef] Wrapper cookbook requires template of wrapped cookbook
  • Date: Sat, 23 Nov 2013 13:22:41 +0100
  • Authentication-results: smtp1h.mail.yandex.net; dkim=pass

I have created a simple wrapper cookbook called oracle-java for the opscode java cookbook, which can be found here: https://github.com/st-h/oracle-java

When I try to run that cookbook it fails since the oracle-java cookbook does not contain the template, which is referenced by the java cookbook. If I copy that template from the java cookbook to the oracle-java cookbook, it works fine. It doesn’t make much sense to me that a wrapper cookbook needs to include templates, that are already present in the wrapped cookbook.  What is going on here?

[2013-11-23T11:41:05+00:00] INFO: Forking chef instance to converge...
[2013-11-23T11:41:05+00:00] INFO: *** Chef 11.8.0 ***
[2013-11-23T11:41:05+00:00] INFO: Chef-client pid: 2087
[2013-11-23T11:41:06+00:00] INFO: Setting the run_list to ["recipe[apt]", "recipe[oracle-java::default]"] from JSON
[2013-11-23T11:41:06+00:00] INFO: Run List is [recipe[apt], recipe[oracle-java::default]]
[2013-11-23T11:41:06+00:00] INFO: Run List expands to [apt, oracle-java::default]
[2013-11-23T11:41:06+00:00] INFO: Starting Chef Run for oracle-java-berkshelf
[2013-11-23T11:41:06+00:00] INFO: Running start handlers
[2013-11-23T11:41:06+00:00] INFO: Start handlers complete.
[2013-11-23T11:41:06+00:00] INFO: Running queued delayed notifications before re-raising exception
[2013-11-23T11:41:06+00:00] ERROR: Running exception handlers
[2013-11-23T11:41:06+00:00] ERROR: Exception handlers complete
[2013-11-23T11:41:06+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-11-23T11:41:06+00:00] ERROR: template[/usr/local/java/.default.jinfo] (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/providers/ark.rb line 179) had an error: Chef::Exceptions::FileNotFound: Cookbook 'oracle-java' (0.1.0) does not contain a file at any of these locations:
  templates/ubuntu-12.04/oracle.jinfo.erb
  templates/ubuntu/oracle.jinfo.erb
  templates/default/oracle.jinfo.erb

================================================================================
Error executing action `create` on resource 'template[/usr/local/java/.default.jinfo]'
================================================================================


Chef::Exceptions::FileNotFound
------------------------------
Cookbook 'oracle-java' (0.1.0) does not contain a file at any of these locations:
  templates/ubuntu-12.04/oracle.jinfo.erb
  templates/ubuntu/oracle.jinfo.erb
  templates/default/oracle.jinfo.erb


Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/providers/ark.rb

179:       template jinfo_file do
180:         source "oracle.jinfo.erb"
181:         variables(
182:           :priority => new_resource.alternatives_priority,
183:           :bin_cmds => new_resource.bin_cmds,
184:           :name => java_name,
185:           :app_dir => app_home
186:         )
187:         action :create
188:       end
189:     end



Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/providers/ark.rb:179:in `block (2 levels) in class_from_file'

template("/usr/local/java/.default.jinfo") do
  provider Chef::Provider::Template
  action [:create]
  retries 0
  retry_delay 2
  path "/usr/local/java/.default.jinfo"
  backup 5
  atomic_update true
  source "oracle.jinfo.erb"
  variables {:priority=>1, :bin_cmds=>["java", "javac"], :name=>"default", :app_dir=>"/usr/local/java/default"}
  cookbook_name :"oracle-java"
end



[2013-11-23T11:41:05+00:00] INFO: Forking chef instance to converge...
[2013-11-23T11:41:06+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.



Archive powered by MHonArc 2.6.16.

§