Class: QmailLog::SSH::Configure

Inherits:
Object
  • Object
show all
Defined in:
lib/qmail_log/ssh/configure.rb

Class Method Summary collapse

Class Method Details

.backend(host, ssh_options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/qmail_log/ssh/configure.rb', line 5

def backend host, ssh_options
  ssh_options.symbolize_keys!

  case host
  when 'localhost', '127.0.0.1'
    set :backend, :exec
  else
    set :backend,       :ssh
    set :host,          host
    set :ssh_options,   ssh_options
    set :sudo_password, ssh_options[:password]
  end
end