- From: Steve Hummingbird <
>
- To:
- Subject: [chef] Re: Re: Re: Wrapper cookbook requires template of wrapped cookbook
- Date: Mon, 25 Nov 2013 01:01:45 +0100
- Authentication-results: smtp17.mail.yandex.net; dkim=pass
ah, I see. thanks for clarifying.
- Steve
On 25 Nov 2013, at 00:56, Julian C. Dunn
<
>
wrote:
>
It should say
>
>
template jinfo_file do
>
cookbook "java"
>
source "oracle.jinfo.erb"
>
.
>
.
>
.
>
end
>
>
>
- Julian
>
>
On Sun, Nov 24, 2013 at 7:24 AM, Steve Hummingbird
>
<
>
>
wrote:
>
> Thanks,
>
> probably I don’t understand your proposal for a fix correctly. The
>
> relevant part of the java provider looks like this:
>
>
>
>> template jinfo_file do
>
>> source "oracle.jinfo.erb"
>
>> variables(
>
>> :priority => new_resource.alternatives_priority,
>
>> :bin_cmds => new_resource.bin_cmds,
>
>> :name => java_name,
>
>> :app_dir => app_home
>
>> )
>
>> action :create
>
>> end
>
>
>
> To me that looks hardcoded, but probably you are referring a completely
>
> different part. Could you please clarify that?
>
>
>
>
>
>
>
>
>
> On 23 Nov 2013, at 18:37, Julian C. Dunn
>
> <
>
>
> wrote:
>
>
>
>> I would interpret this as a bug in the wrapped cookbook's provider.
>
>> Probably worth a ticket at tickets.opscode.com.
>
>>
>
>> It's best practice for providers to hardcode the "cookbook" attribute
>
>> in the inline "template" resource, otherwise when people try to wrap
>
>> that cookbook, the cookbook that's searched is the caller's rather
>
>> than the callee's.
>
>>
>
>> - Julian
>
>>
>
>> On Sat, Nov 23, 2013 at 7:22 AM, Steve Hummingbird
>
>> <
>
>
>> wrote:
>
>>> 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.
>
>>
>
>>
>
>>
>
>> --
>
>> [ Julian C. Dunn
>
>> <
>
>
>> * Sorry, I'm ]
>
>> [ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
>
>> [ gopher://sdf.org/1/users/keymaker/ * compliant! ]
>
>> [ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]
>
>
>
>
>
>
--
>
[ Julian C. Dunn
>
<
>
>
* Sorry, I'm ]
>
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
>
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
>
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]
Archive powered by MHonArc 2.6.16.