networker: Fixed running nsrports command.
This commit is contained in:
parent
bd8a63f0da
commit
cada7e0d69
1 changed files with 6 additions and 5 deletions
|
@ -5,6 +5,8 @@ class networker::common {
|
||||||
|
|
||||||
require portmap::server
|
require portmap::server
|
||||||
|
|
||||||
|
$range = inline_template('7937-<%= 7936 + @ports.to_i %>')
|
||||||
|
|
||||||
file { [ "/nsr", "/nsr/res", ]:
|
file { [ "/nsr", "/nsr/res", ]:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
mode => "0755",
|
mode => "0755",
|
||||||
|
@ -23,7 +25,7 @@ class networker::common {
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "nsrports":
|
exec { "nsrports":
|
||||||
command => "nsrports -S 7937-7940",
|
command => "nsrports -S ${range}",
|
||||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
unless => "nsrports | egrep '^Service ports: ${range}[[:space:]]$'",
|
unless => "nsrports | egrep '^Service ports: ${range}[[:space:]]$'",
|
||||||
require => Service["networker"],
|
require => Service["networker"],
|
||||||
|
@ -40,6 +42,9 @@ class networker::common {
|
||||||
#
|
#
|
||||||
class networker::client {
|
class networker::client {
|
||||||
|
|
||||||
|
if !$ports {
|
||||||
|
$ports = 4
|
||||||
|
}
|
||||||
include networker::common
|
include networker::common
|
||||||
|
|
||||||
package { "lgtoclnt":
|
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 %>'),
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue