Allow multiple tunnels on the same host

This allows multiple autossh::tunnel defines to be instanciated on the
same host without puppet erroring with multiple services of the same
name.

Change-Id: I0a54629137f668c5d83e110312cbd26a87601bc0
This commit is contained in:
K Jonathan Harker 2016-02-26 13:24:55 -08:00
parent 7d232b51cc
commit 3225dc61a2
1 changed files with 2 additions and 1 deletions

View File

@ -26,8 +26,9 @@ define autossh::tunnel (
$monitoring_port = 0,
$run_in_background = true,
) {
service { '/usr/lib/autossh':
service { "autossh-service-${title}":
ensure => $ensure,
name => '/usr/lib/autossh',
start => template('autossh/autossh-command.erb'),
stop => 'AUTOSSH_PID=`pidof autossh` && CHILD_PID=`pgrep -P $AUTOSSH_PID` && kill -9 $AUTOSSH_PID && kill -9 $CHILD_PID',
provider => base,