[chef] Re: Re: LWRP for N00bs


Chronological Thread 
  • From: Ameir Abdeldayem < >
  • To:
  • Subject: [chef] Re: Re: LWRP for N00bs
  • Date: Wed, 27 Aug 2014 07:25:03 -0400

While we're on the topic, what are some pros/cons to writing resources in the "libraries" directory vs "true" LWRP style in the "resources" and "providers" directories?  I see that a lot of Sean's contributions go the "libraries" route, but there's a pretty diverse mix community-wide (with most seeming to be "true" LWRP style).

-Ameir


On Wed, Aug 27, 2014 at 1:17 AM, Julian C. Dunn < " target="_blank"> > wrote:
The conversion logic is here:
https://github.com/opscode/chef/blob/master/lib/chef/mixin/convert_to_class_name.rb#L25-L43

TL;DR: "web_serverwebserver" is gonna get converted to
"WebServerwebserver", so the class you're looking for is
Chef::Resource::WebServerwebserver

- Julian

On Tue, Aug 26, 2014 at 10:45 PM, Brian < "> > wrote:
> I'm trying to figure out why Chef is not correctly loading my lwrps.
>
> So I'm trying to build a custom lwrp in my recipe.
>
> I have a cookbook named web_server. I have a resource called webserver. (real
> original, I know.).
>
> I'm getting a NameError when I try to use web_serverwebserver in a recipe.   I
> suspect I'm doing something wrong in my load_current_resource, but I don't know
> what.
>
> my load_current_resource
>
> def load_current_resource
= web_serverwebserver.new(@new_resource.AppName)
>     
> end
> I have tried
>
> web_server::webserver.
> Chef::Resource::webserver
> Chef::Resource::web_server::webserver
> and pretty much everything else I can think of. What am I doing wrong here?
>
> Is there a good way to get Chef to report why it can't seem to find my
> resource?
> -l debug doesn't seem to provide much in the way of detail as to why it can't
> find my lwrp.



--
[ 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.

§