Class: Sprinkle::Actors::Ssh

Inherits:
Object
  • Object
show all
Defined in:
lib/sprinkle/actors/ssh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, &block) ⇒ Ssh

:nodoc:



8
9
10
11
# File 'lib/sprinkle/actors/ssh.rb', line 8

def initialize(options = {}, &block) #:nodoc:
  @options = options.update(:user => 'root')
  self.instance_eval &block if block
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



6
7
8
# File 'lib/sprinkle/actors/ssh.rb', line 6

def options
  @options
end

Instance Method Details

#gateway(gateway) ⇒ Object



17
18
19
# File 'lib/sprinkle/actors/ssh.rb', line 17

def gateway(gateway)
  @options[:gateway] = gateway
end

#process(name, commands, roles, suppress_and_return_failures = false) ⇒ Object



25
26
27
28
# File 'lib/sprinkle/actors/ssh.rb', line 25

def process(name, commands, roles, suppress_and_return_failures = false)
  return process_with_gateway(name, commands, roles) if gateway_defined?
  process_direct(name, commands, roles)
end

#roles(roles) ⇒ Object



13
14
15
# File 'lib/sprinkle/actors/ssh.rb', line 13

def roles(roles)
  @options[:roles] = roles
end

#user(user) ⇒ Object



21
22
23
# File 'lib/sprinkle/actors/ssh.rb', line 21

def user(user)
  @options[:user] = user
end