Created
August 11, 2011 12:15
-
-
Save octplane/1139507 to your computer and use it in GitHub Desktop.
First Recipe. Creates the empty monitoring registry and also store the new key
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 recipe should be called at the beginning of the run_list | |
| # If we are not the last item of the run_list break | |
| order = node.recipes | |
| if order[0] != "firstrecipe" | |
| Chef::Log.error("First Recipe should be the first recipe to run; current run list is "+order.inspect) | |
| raise "Please refactor my runlist" | |
| end | |
| # Generate Timestamp for next version of monitored objects | |
| # .to_s because chef is a monkey ! | |
| next_key = Time.now.to_i.to_s | |
| node[:monitored] ||= {} | |
| node[:monitored][:content] ||= {} | |
| node[:monitored][:next] = next_key | |
| node[:monitored][:content][next_key] = {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment