[chef] Re: ruby_block that sets/alters attributes


Chronological Thread 
  • From: Alex Soto < >
  • To:
  • Subject: [chef] Re: ruby_block that sets/alters attributes
  • Date: Wed, 7 Jul 2010 23:36:25 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=XHKkhxL3vU7Mw4adCJk4chrtMF0EDdiyUpQ1tCUOAfpIHOzdD+3HvEjlcsHdMebQ8S eghCCd8jH3EXwt7X++ejomaMySi8bJDy7nT+2z66XKn9azj4r3Xhe/YslCPuc46hNL8F ZT07VAtg4sNZvS2yJO85Jyc/iYj062ZIMgw1c=

try node[:blah][:whatever] = 'bleck'  I do that in recipes though never tried 
it in a block.

Maybe try @node if node is undefined.

FYI, A trick I use while developing recipes:

I use chef-solo on the node I'm developing on with ruby-debug installed

Then I set breakpoints in the recipes so I can inspect variables, etc to see 
why things aren't working as expected.


On Jul 7, 2010, at 11:21 PM, Christopher Bottaro wrote:

> Hello,
> 
> I want to set some attributes in a ruby_block resource.  I tried saying 
> "set[:blah][:whatever] = bleck" in the block, but it errors saying "set" is 
> not defined for Chef::Resource::RubyBlock.
> 
> How to accomplish this?
> 
> Thank you.




Archive powered by MHonArc 2.6.16.

§