Skip to content

Instantly share code, notes, and snippets.

/b.rb

Created August 11, 2011 13:47
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 anonymous/1139696 to your computer and use it in GitHub Desktop.
Save anonymous/1139696 to your computer and use it in GitHub Desktop.
# on every "node"
require 'rubygems'
require 'ruote'
require 'ruote/redis/storage'
engine = Ruote::Engine.new(
Ruote::Worker.new(
Ruote::Redis::Storage.new(:host => '192.168.1.2', :db => 14)
engine.register 'ssh', Taz::SshParticipant
engine.register 'emit_results', Taz::ResultParticipant
# then, in one of them
pdef = Ruote.define do
concurrent-iterator :on_f => 'ips', :to_f => 'ip', :merge_type => 'concat' do
ssh :ip => '${ip}', :command => 'du -f'
end
emit_results
end
wfid = engine.launch(pdef, 'ips' => %w[ 192.168.1.1 192.168.1.2 192.168.1.3 ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment