Class: Blender::Driver::SshMulti
- Defined in:
- lib/blender/drivers/ssh_multi.rb
Instance Attribute Summary
Attributes inherited from Ssh
Attributes inherited from Base
#config, #events, #stderr, #stdout
Instance Method Summary collapse
Methods inherited from Ssh
Methods included from SSHExec
Methods inherited from Base
Constructor Details
This class inherits a constructor from Blender::Driver::Ssh
Instance Method Details
#concurrency ⇒ Object
40 41 42 |
# File 'lib/blender/drivers/ssh_multi.rb', line 40 def concurrency @config[:concurrency] end |
#execute(tasks, hosts) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/blender/drivers/ssh_multi.rb', line 27 def execute(tasks, hosts) Log.debug("SSH execution tasks [#{tasks.size}]") Log.debug("SSH on hosts [#{hosts.join("\n")}]") session = create_session(hosts) Array(tasks).each do |task| cmd = run_command(task.command, session) if cmd.exitstatus != 0 and !task.[:ignore_failure] raise ExecutionFailed, cmd.stderr end end session.loop end |