Class: Blender::Driver::SshMulti

Inherits:
Ssh
  • Object
show all
Defined in:
lib/blender/drivers/ssh_multi.rb

Instance Attribute Summary

Attributes inherited from Ssh

#user

Attributes inherited from Base

#config, #events, #stderr, #stdout

Instance Method Summary collapse

Methods inherited from Ssh

#initialize, #run_command

Methods included from SSHExec

#fixup_sudo, #remote_exec

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Blender::Driver::Ssh

Instance Method Details

#execute(tasks, hosts) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/blender/drivers/ssh_multi.rb', line 28

def execute(tasks, hosts)
  Log.debug("SSH execution tasks [#{tasks.size}]")
  Log.debug("SSH on hosts [#{hosts.join("\n")}]")
  Array(tasks).each do |task|
    session = create_session(hosts, task.[:concurrency])
    cmd = run_command(task.command, session)
    if cmd.exitstatus != 0 and !task.[:ignore_failure]
      raise ExecutionFailed, cmd.stderr
    end
    session.loop
  end
end