A quick little cookbook that sets up an autossh
upstart service that
connects to a remote host and sets up some SSH port forwards. This is
used to provide a gateway to a remote host which is firewalled and
unable to accept or make connections which prevents it from connecting
to the VPN.
Only tested with Ubuntu 12.04 LTS. As such, it requires the autossh
package
to be available for installation and it only sets up an Upstart
service.
You'll need to define the node['hands-on']['key']
attribute which is
the private SSH key that can connect to thenode['hands-on']['tunnel_host']['hostname']
as
thenode['hands-on']['tunnel_host']['user']
user.
Then you'll want to define the port forwards in the node['hands-on']['forwards']
array.
node['hands-on']['user']
-- this is the user account that the tunnel will run asnode['hands-on']['package']
-- the name of theautossh
packagenode['hands-on']['home']
-- the home directory of thenode['hands-on']['user']
node['hands-on']['key']
-- the private SSH key that will be used for authenticationnode['hands-on']['tunnel_host']['user']
-- the user to SSH asnode['hands-on']['tunnel_host']['hostname']'
-- the name of the machine to connect tonode['hands-on']['forwards']
-- an array of hashes containing thelocal
andremote
ports that the service should setup
default
-- creates an Upstart job that sets up the tunnel
Author:: Aaron D. Valade ([email protected])