[chef] Access a Node's Previous Attributes


Chronological Thread 
  • From: < >
  • To:
  • Subject: [chef] Access a Node's Previous Attributes
  • Date: Fri, 27 Jun 2014 09:15:13 -0700 (PDT)

Hi everyone,

I was wondering if Chef's current API allows me to have access to my node's
previous attributes (i.e. before downloading/converging new
roles/environments/cookbooks)? I tried this out using
'Chef::Node.load(..)[my_attribute]' which worked giving me the value of the
attribute from the last chef run.

I feel like this could greatly simplify a lot of cookbooks I have written by
providing me the 'current' state of the node vs what it should be. 
Specifically
this could help me with,

 * Determine if we should upgrade our application (i.e. did the version 
change)
 * We have an attribute that is an array of URLs to files which we should
download and put in our app's lib directory. We could use the previous value 
to
determine which URLs were removed and remove those files.

Bryan



Archive powered by MHonArc 2.6.16.

§