Method: Blender::Driver::Ssh#execute
- Defined in:
- lib/blender/drivers/ssh.rb
#execute(tasks, hosts) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/blender/drivers/ssh.rb', line 35 def execute(tasks, hosts) Log.debug("SSH execution tasks [#{Array(tasks).size}]") Log.debug("SSH on hosts [#{hosts.join(",")}]") Array(hosts).each do |host| session = create_session(host) 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 end |