[chef] Re: Provider - load_current_resource


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Provider - load_current_resource
  • Date: Wed, 20 Nov 2013 12:22:18 -0800


On Wednesday, November 20, 2013 at 11:02 AM, Silviu Dicu wrote:

Hello,

How can I make into a provider that a variable will be re-initialized ?

Example:

providers/default.rb

def load_current_resource
  @current_resource.var = i_set_my_resource(@new_resource.name)
end

...

At some point I need to re-init @current_resource.var.

thanks!

Generally anything that appears in a DSL in chef uses a combined getter-setter, where:

    thing.value() # return the current value

    thing.value(a_new_value) # set the value


HTH,

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§