Skip to content

Instantly share code, notes, and snippets.

@ewhauser
Created May 1, 2011 22:06
Show Gist options
  • Save ewhauser/950920 to your computer and use it in GitHub Desktop.
Save ewhauser/950920 to your computer and use it in GitHub Desktop.
Knife csshx
# Use csshX to open terminals on the nodes found in a search
# knife exec csshx.rb 'role:the_role'
abort("usage: knife exec csshx SEARCH_TERM") unless ARGV[2]
nodes = search(:node, "#{ARGV[2].to_s}").collect { |n| n.fqdn }
exec('csshX ' + nodes.join(' ')) unless nodes.length < 1
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment