Class: Salticid::Gateway

Inherits:
Host show all
Defined in:
lib/salticid/gateway.rb

Instance Attribute Summary

Attributes inherited from Host

#env, #groups, #name, #password, #roles, #salticid, #tasks, #user

Instance Method Summary collapse

Methods inherited from Host

#==, #append, #as, #cd, #chmod, #chmod_r, #cwd, #dir?, #download, #escape, #exec!, #exists?, #expand_path, #file?, #ftype, #group, #group?, #homedir, #inspect, #log, #method_missing, #mode, #on_log, #resolve_task, #role, #role?, #role_proxy, #run, #ssh, #sudo, #sudo_upload, #task, #to_s, #to_string, #upload

Constructor Details

#initialize(*args) ⇒ Gateway

Returns a new instance of Gateway.


2
3
4
5
# File 'lib/salticid/gateway.rb', line 2

def initialize(*args)
  @tunnel_lock = Mutex.new
  super *args
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Salticid::Host

Instance Method Details

#gateway_tunnelObject

Tunnel for connecting to other hosts.


12
13
14
15
16
17
18
# File 'lib/salticid/gateway.rb', line 12

def gateway_tunnel
  # Multiple hosts will be asking for this tunnel at the same time.
  # We need to only create one.
  @tunnel_lock.synchronize do
    @gateway_tunnel ||= Net::SSH::Gateway.new(name, user)
  end
end

#gwObject

Gateways don't need gateways.


8
9
# File 'lib/salticid/gateway.rb', line 8

def gw
end

#tunnelObject

We don't need tunnels either


21
22
# File 'lib/salticid/gateway.rb', line 21

def tunnel
end