Repository is archived
No commit activity in last 3 years
No release in over 3 years
Exports node data to disk at end of successful run
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

RunData

Chef handler to write out to disk a successful-run-data.json file which contains the information about the node at the end of the previous run.

Usage

The Chef docs [1] lay out a pretty simple way to use handlers by leveraging the chef_handler resource. Just ship the chef-handler-run-data.rb file to your handlers location and declare a new handler:

cookbook_file "#{node[:chef_handler][:handler_path]}/chef-handler-run-data.rb" do
  source 'chef-handler-run-data.rb'
  mode 00600
end

chef_handler 'RunData' do
  source "#{node[:chef_handler][:handler_path]}/chef-handler-run-data.rb"
  action :enable
end

Obviously make sure to copy the ruby file into the /files/default directory of your cookbook as well. Alternatively, install it as a Rubygem and source it that way:

chef_gem 'chef-handler-run-data' do
  action :install
end

chef_handler 'RunData' do
  source ::File.join(Gem.all_load_paths.grep(/chef-handler-run-data/).first,
                     'chef-handler-run-data.rb')
  action :enable
end

[1] http://docs.opscode.com/essentials_handlers_install.html

License

Apache License, Version 2.0

Author

Simple Finance ops@simple.com