lib/capistrano/consul.rb in capistrano3-consul-0.2.0 vs lib/capistrano/consul.rb in capistrano3-consul-0.3.0
- old
+ new
@@ -1,14 +1,24 @@
require 'capistrano/consul/version'
require 'diplomat'
+require 'net/ssh/gateway'
module Capistrano
module Consul
def self.setup
return if @url
@url = fetch(:consul_url)
return false unless @url
+ @ssh_gateway = fetch(:consul_ssh_gateway)
+ if @ssh_gateway
+ @gateway = Net::SSH::Gateway.new(@ssh_gateway[:host], @ssh_gateway[:username], @ssh_gateway[:options])
+ @gateway.open('127.0.0.1', @ssh_gateway[:port], @ssh_gateway[:port])
+ end
+ if @use_ssh_proxy
+ @ssh_options = fetch(:ssh_options)
+ return false unless @ssh_options[:proxy]
+ end
Diplomat.configure do |config|
config.url = @url
end
end
end