]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
allow customizing user
authorAntoine Beaupré <anarcat@koumbit.org>
Thu, 18 Jun 2015 20:07:18 +0000 (16:07 -0400)
committerAntoine Beaupré <anarcat@koumbit.org>
Thu, 18 Jun 2015 21:15:27 +0000 (17:15 -0400)
manifests/autossh.pp

index 590f28b8eba062e0899cb020ff03616834117416..fadc575211c6fea80175cba5e5856ce760b1d0cc 100644 (file)
@@ -1,6 +1,7 @@
 class sshd::autossh($host,
-                    $port = undef, # this should be a remote->local hash
-                    $remote_user = undef,
+              $port = undef, # this should be a remote->local hash
+              $remote_user = undef,
+              $user = 'root',
 ) {
   if $port {
     $port_ensure = $port
@@ -21,7 +22,7 @@ class sshd::autossh($host,
       source => 'puppet:///modules/sshd/autossh.init.d';
     '/etc/default/autossh':
       mode    => '0444',
-      content => "DAEMON_ARGS='-o ServerAliveInterval=15 -o ServerAliveCountMax=4 -q -N -R $port_ensure:localhost:22 $remote_user_ensure@$host'\n";
+      content => "USER=$user\nDAEMON_ARGS='-o ServerAliveInterval=15 -o ServerAliveCountMax=4 -q -N -R $port_ensure:localhost:22 $remote_user_ensure@$host'\n";
   }
   package { 'autossh':
     ensure => present,