From cada7e0d6913c6815ed7a2c73d40c4786d9c1af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Fri, 12 Jul 2013 00:22:11 +0300 Subject: [PATCH] networker: Fixed running nsrports command. --- networker/manifests/init.pp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/networker/manifests/init.pp b/networker/manifests/init.pp index c9f214c..72667ce 100644 --- a/networker/manifests/init.pp +++ b/networker/manifests/init.pp @@ -5,6 +5,8 @@ class networker::common { require portmap::server + $range = inline_template('7937-<%= 7936 + @ports.to_i %>') + file { [ "/nsr", "/nsr/res", ]: ensure => directory, mode => "0755", @@ -23,7 +25,7 @@ class networker::common { } exec { "nsrports": - command => "nsrports -S 7937-7940", + command => "nsrports -S ${range}", path => "/bin:/usr/bin:/sbin:/usr/sbin", unless => "nsrports | egrep '^Service ports: ${range}[[:space:]]$'", require => Service["networker"], @@ -40,6 +42,9 @@ class networker::common { # class networker::client { + if !$ports { + $ports = 4 + } include networker::common package { "lgtoclnt": @@ -94,9 +99,5 @@ class networker::server($datadir="/nsr", $ports=8) inherits networker::common { } } - Exec["nsrports"] { - command => inline_template('nsrports -S 7937-<%= 7936 + @ports.to_i %>'), - } - }