[chef] Re: LWRP to extends another cookbook LWRP


Chronological Thread 
  • From: Noah Kantrowitz < >
  • To:
  • Subject: [chef] Re: LWRP to extends another cookbook LWRP
  • Date: Thu, 14 May 2015 22:50:07 +0200


On May 14, 2015, at 2:42 PM, Giovanni Toraldo 
< >
 wrote:

> Hi,
> 
> I just want to define a new LWRP to define some different defaults for
> attributes of another LWRP.
> 
> Googling I've found this: http://stackoverflow.com/a/20732016/547195
> 
> And I've tried with: https://gist.github.com/gionn/6497eefdf9121c832b0e
> 
> But I am getting a recipe compile error:
> 
> Chef::Exceptions::InvalidResourceSpecification
> You must specify `resource_name'!
> /tmp/gionn_chef/cookbooks/cd-infrastructure/definitions/my_docker_container.rb:4:in
> `initialize'
> 
> Any suggestions?

This is not possible with LWRPs for reasons that are both complicated and 
very boring. Short version? You need to copy-pasta at least some of the 
upstream LWRP and build a wrapper around it instead of subclassing.

--Noah

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail




Archive powered by MHonArc 2.6.16.

§