Class: SSHKit::Runner::Sequential

Inherits:
Abstract
  • Object
show all
Defined in:
lib/sshkit/runners/sequential.rb

Direct Known Subclasses

Group

Instance Attribute Summary collapse

Attributes inherited from Abstract

#block, #hosts, #options

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

This class inherits a constructor from SSHKit::Runner::Abstract

Instance Attribute Details

#wait_interval=(value) ⇒ Object

Sets the attribute wait_interval

Parameters:

  • value

    the value to set the attribute wait_interval to.



6
7
8
# File 'lib/sshkit/runners/sequential.rb', line 6

def wait_interval=(value)
  @wait_interval = value
end

Instance Method Details

#executeObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/sshkit/runners/sequential.rb', line 7

def execute
  last_host = hosts.pop

  hosts.each do |host|
    run_backend(host, &block)
    sleep wait_interval
  end

  unless last_host.nil?
    run_backend(last_host, &block)
  end
end