Search code examples
ruby-on-railsdeploymentcapistrano

How to use gateway option with recap?


I really like recap gem for applications deployment.

I have only one question: how to use the capistrano set: gateway, [email protected] option with recap?

In our projects we use virtualization and all the applications we are running in isolated containers and access to container possible only via ssh tunnel through gateway.


Solution

  • Use simple ssh feature, like this:

    ssh -F path/to/config
    

    Add the ssh config (ex. in config dir):

    Host your_server_available_from_gateway_server
      User username
      ForwardAgent yes 
      ProxyCommand ssh gateway_server nc %h %p
    

    In recap you should use this:

      set :ssh_options, { :config => 'path/to/config'}