In most cases (recipe, attribute files, lwrps) you have it via an accessor method. Otherwise you can always invoke Chef::Node.load , but that's low level api. Note , in recipes node is a DSL mixin like search or data_bag which you can always get via include Chef::DSL::Recipe/DataQuery etc
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 < " target="_blank"> <mailto: " target="_blank"> >> 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.