[chef] Re: Re: Set node attrs at compile-time from pure-ruby code in a recipe


Chronological Thread 
  • From: Jeff Blaine < >
  • To:
  • Subject: [chef] Re: Re: Set node attrs at compile-time from pure-ruby code in a recipe
  • Date: Mon, 22 Jul 2013 16:38:20 -0400

On 7/22/2013 4:06 PM, Ranjib Dey wrote:
node.set['foo']['bar'] or node.default,,, all these outside the ruby_block resource should be invoked during compile time

Hmm, so 'node' is a global object that exists? I can just have arbitrary non-DSL Ruby code in, for example, recipes/compiletest.rb and that can call node.set?



On Mon, Jul 22, 2013 at 1:00 PM, Jeff Blaine < <mailto: >> wrote:

    Does anyone have a quick example showing how to set a node
    attribute from within (our) Ruby code that is executing during the
    compile phase? Probably very simple to do, but I'm in uncharted
    territory here and not a Ruby-as-primary-lang person.






Archive powered by MHonArc 2.6.16.

§