Skip to content

Instantly share code, notes, and snippets.

@ftclausen
Last active August 29, 2015 14:07
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 ftclausen/65c2cb5e1f51aadba488 to your computer and use it in GitHub Desktop.
Save ftclausen/65c2cb5e1f51aadba488 to your computer and use it in GitHub Desktop.
require 'chef/node'
require 'chef/run_list'
require 'json'
nodes = search(:node, 'name:*example*')
nodes.each do |node|
new_run_list = '["recipe[example_cookbook]", "role[some_role]"]'
node.run_list(JSON.parse(new_run_list))
node.save
end
@ftclausen
Copy link
Author

Added required requires.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment