- From: "steve ." <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Re: Jenkins cookbook(s) - recommendations
- Date: Thu, 11 Oct 2012 11:41:24 -0700
Correct, as prior posters in this thread have mentioned, you have a
namespacing issue.
LWRPs are namespaced according to the name of the cookbook. When you
renamed the cookbook from "jenkins" to "chef-jenkins," you renamed all
of the LWRPs along with it (LWRP == Lightweight Resource Provider, a
case where somebody has extended Chef to know about new resources
and/or providers). The Jenkins cookbook has a number of LWRPs defined
for managing Jenkins jobs and slave nodes, among other things.
Here's the page on the Chef wiki that discusses how LWRPs work:
http://wiki.opscode.com/display/chef/Lightweight+Resources+and+Providers+(LWRP)
And here's the specific section of the article that tells you how the
files are laid out and demonstrates the namespacing issue:
http://wiki.opscode.com/display/chef/Lightweight+Resources+and+Providers+(LWRP)#LightweightResourcesandProviders%28LWRP%29-FileLocations
There are two ways to solve this problem:
* Change the name of the cookbook back to "jenkins". Make sure you
edit your test node's run list.
* Change the name of the resource in the node.jnlp.rb recipe from
"jenkins_node" to "chef_jenkins_node" (I think dashes get converted to
underscores...).
I prefer not to change the names on community cookbooks for this
reason unless it's to adhere to some sort of internal namespacing
policy ... in which case it ends up being a lot of extra work,
renaming attributes, resources, providers, etc. ...
I do think that using the namespace generated by the cookbook is the
proper way to do things, though -- we shouldn't start letting people
define arbitrary resources using LWRP code. Imagine the
troubleshooting delight that will ensue if someone downloads a
cookbook from the community site written by some dude who decides to
override "package."
Hope this helps you figure this out.
On Thu, Oct 11, 2012 at 8:37 AM, Maven User
<
>
wrote:
>
I see this tho in the node_jnlp.rp recipe:
>
>
jenkins_node node[:jenkins][:node][:name] do
>
description node[:jenkins][:node][:description]
>
executors node[:jenkins][:node][:executors]
>
remote_fs node[:jenkins][:node][:home]
>
labels node[:jenkins][:node][:labels]
>
mode node[:jenkins][:node][:mode]
>
launcher "jnlp"
>
mode node[:jenkins][:node][:mode]
>
availability node[:jenkins][:node][:availability]
>
end
>
>
>
>
>
On Wed, Oct 10, 2012 at 6:36 PM, Daniel DeLeo
>
<
>
>
wrote:
>
>
>
>
>
> On Wednesday, October 10, 2012 at 3:31 PM, Maven User wrote:
>
>
>
> I keep hitting this:
>
>
>
>
>
> ================================================================================
>
>
>
> Recipe Compile Error in
>
> /var/chef/cache/cookbooks/chef-jenkins/recipes/node_jnlp.rb
>
>
>
>
>
> ================================================================================
>
> NameError
>
> ---------
>
>
>
> Cannot find a resource for jenkins_node on ubuntu version 12.04
>
>
>
> Cookbook Trace:
>
> ---------------
>
>
>
> /var/chef/cache/cookbooks/chef-jenkins/recipes/node_jnlp.rb:44:in
>
> `from_file'
>
>
>
>
>
> It just highlights this line:
>
>
>
> 44>> jenkins_node node[:jenkins][:node][:name] do
>
>
>
> I have all the attributes in the role already - any suggestions?
>
>
>
> It means what the error says, there is no resource type `jenkins_node`. Is
>
> there supposed to be a LWRP or resource definition that defines this?
>
>
>
> --
>
> Daniel DeLeo
>
>
>
Archive powered by MHonArc 2.6.16.