From 8d9bded5e977016d13e6521ee383cb3d5918506f Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Sat, 26 Dec 2009 14:15:51 -0500 Subject: if 'monitor_port' is defined, don't enable ServerAliveInterval and ServerAliveCountMax --- manifests/tunnel.pp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/tunnel.pp b/manifests/tunnel.pp index 6d9c9d1..a90a38a 100644 --- a/manifests/tunnel.pp +++ b/manifests/tunnel.pp @@ -6,7 +6,7 @@ define autossh::tunnel ( $host = 'localhost', $hostport, $remote_host, - $monitor_port = 0, + $monitor_port = 'absent', $gatetime = 'absent', $first_poll = 'absent', $poll = 'absent', @@ -17,6 +17,17 @@ define autossh::tunnel ( include autossh + # 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') { + $real_monitor_port = 0 + $ssh_extra_options = "-o ServerAliveInterval=30 -o ServerAliveCountMax=3" + } + else { + $real_monitor_port = $monitor_port + $ssh_extra_options = '' + } + if ($ensure == 'present') { file { "/etc/init.d/autossh-tunnel-${name}": -- cgit v1.2.3