Skip to content

Instantly share code, notes, and snippets.

@raphink
Created December 4, 2013 16:35
Show Gist options
  • Save raphink/7790739 to your computer and use it in GitHub Desktop.
Save raphink/7790739 to your computer and use it in GitHub Desktop.
require 'mcollective'
include MCollective::RPC
c = rpcclient("rpcutil")
c.discovery_method="mc"
all_nodes = c.discover.clone
all_nodes.in_groups_of(5) do |nodes|
c.reset
c.discover :nodes => nodes.compact
resp = c.freenodes
# check responses are all ok etc
# kick off backups etc
c.unfreeze
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment