Skip to content

Instantly share code, notes, and snippets.

@grantr
Created May 20, 2011 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grantr/983981 to your computer and use it in GitHub Desktop.
Save grantr/983981 to your computer and use it in GitHub Desktop.
# use for oneshot recipes
if node[:oneshot]
# clear oneshot and save node
oneshot, node[:oneshot] = node[:oneshot], []
node.save
oneshot.each do |recipe|
include_recipe recipe
end
end
## in the role:
include_recipe "oneshot"
## oneshot.json:
{"oneshot":["recipe_to_run_once"]}
## to run (cron file):
chef-client -j oneshot.json
##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment