Created
June 8, 2011 17:08
-
-
Save adamhjk/1014841 to your computer and use it in GitHub Desktop.
keep_last_run_list.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This should be in a recipe, as early in the run list as possible | |
begin | |
node.override[:previous_run_list] = JSON.parse(Chef::FileCache.load("previous_run_list")) | |
rescue Chef::Exceptions::FileNotFound | |
Chef::Log.debug("No stored run list!") | |
end | |
Chef::FileCache.store("previous_run_list", node.run_list.to_json) | |
# When you want to check if the last run list had the previous role... | |
if node.previous_run_list.include?("role[master]") | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment