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:



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

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.



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

def options
  @options
end

Instance Method Details

#gateway(gateway) ⇒ Object



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

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

#password(password) ⇒ Object



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

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

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



30
31
32
33
# File 'lib/sprinkle/actors/ssh.rb', line 30

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



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

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

#transfer(name, source, destination, roles, recursive = true, suppress_and_return_failures = false) ⇒ Object



35
36
37
38
# File 'lib/sprinkle/actors/ssh.rb', line 35

def transfer(name, source, destination, roles, recursive = true, suppress_and_return_failures = false)
  return transfer_with_gateway(name, source, destination, roles, recursive) if gateway_defined?
  transfer_direct(name, source, destination, roles, recursive)
end

#user(user) ⇒ Object



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

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