[chef] after_created in LWRPs


Chronological Thread 
  • From: Peter Donald < >
  • To: Chef Mailing List < >
  • Subject: [chef] after_created in LWRPs
  • Date: Fri, 3 May 2013 16:28:24 +1000

Hi,

In our infrastructure we have had the need for some of our LWRPs to
take some action during the compile phase rather than the converge
phase. Mostly this involves publishing calculated values as attribute
data so a later resource can make use of the attribute data. We have
been doing this by overriding the after_created hook in resources. So
the question is ... is this something anyone else is doing or is it
insanely bad in some way I can't figure out just yet. Thoughts?

i.e. We a LWRP similar to ark that downloads and extracts archives and
optionally publishes the directory to which the archive will be
extracted as attribute data. We then use this attribute data in a
following resource definition. See [1]

[1] 
https://github.com/realityforge/chef-archive/blob/master/resources/default.rb#L116

-- 
Cheers,

Peter Donald



Archive powered by MHonArc 2.6.16.

§