Fixed variable passing to abusehelper::init on puppet 3

This commit is contained in:
Ossi Salmi 2013-07-30 15:56:09 +03:00
parent eb08500518
commit baf347204b
3 changed files with 10 additions and 15 deletions

View file

@ -126,7 +126,9 @@ class abusehelper {
}
if $abusehelper_botnets {
include abusehelper::init
class { "abusehelper::init":
botnets => $abusehelper_botnets,
}
}
}
@ -134,15 +136,7 @@ class abusehelper {
# Install abusehelper init script.
#
class abusehelper::init {
if !$abusehelper_botnets {
fail("Must define \$abusehelper_botnets")
}
if !$abusehelper_user {
$abusehelper_user = "abusehel"
}
class abusehelper::init($botnets, $user="abusehel") {
file { "/etc/sysconfig/botnet":
ensure => present,

View file

@ -1,2 +1,2 @@
BOTUSER="<%= @abusehelper_user %>"
BOTNETS="<%= @abusehelper_botnets.join(" ") %>"
BOTUSER="<%= @user %>"
BOTNETS="<%= @botnets.join(" ") %>"

View file

@ -89,9 +89,10 @@ class abusesa {
python::setup::install { "/usr/local/src/abusesa": }
if $abusesa_botnets {
$abusehelper_botnets = $abusesa_botnets
$abusehelper_user = "abusesa"
include abusehelper::init
class { "abusehelper::init":
botnets => $abusesa_botnets,
user => "abusesa",
}
}
}