]> gitweb.fluxo.info Git - puppet-autossh.git/commitdiff
add remote_user parameter
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>
Wed, 24 Feb 2010 14:51:55 +0000 (09:51 -0500)
committerJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>
Wed, 24 Feb 2010 14:59:57 +0000 (09:59 -0500)
manifests/tunnel.pp
templates/autossh-tunnel.erb

index a90a38accf858a4e1ed006a997b3dd4f7ed0befe..b4e7bdf829fdc59bc748ae0eac30f92d51bb9381 100644 (file)
@@ -6,6 +6,7 @@ define autossh::tunnel (
   $host = 'localhost',
   $hostport,
   $remote_host,
+  $remote_user = 'absent',
   $monitor_port = 'absent',
   $gatetime = 'absent',
   $first_poll = 'absent',
@@ -17,6 +18,11 @@ define autossh::tunnel (
 
   include autossh
 
+  $real_remote_user = $remote_user ? {
+      'absent' => $user,
+      default => $remote_user,
+  } 
+
   # According to the autossh documentation, using OpenSSH ServerAlive 
   # options is better than using a monitor port, so we do that by default.
   if ($monitor_port == 'absent') {
index f19cb514ce8ee708738be4c0adf97bd32b9c6456..e89bc2ac8e54be4addd900b03fd85a94b91e0e39 100644 (file)
@@ -26,7 +26,7 @@ SCRIPTNAME=/etc/init.d/$NAME
 #
 # AutoSSH configuration
 #
-AUTOSSH_ARGS="-M <%= real_monitor_port %> -N -L <%= bind_address %>:<%= port %>:<%= host %>:<%= hostport %> <%= ssh_extra_options %> <%= remote_host %>"
+AUTOSSH_ARGS="-M <%= real_monitor_port %> -N -L <%= bind_address %>:<%= port %>:<%= host %>:<%= hostport %> <%= ssh_extra_options %> <%= real_remote_user %>@<%= remote_host %>"
 <% if gatetime != 'absent' -%>
 AUTOSSH_GATETIME=<%= gatetime %>
 <% end -%>