Refactored abusehelper init, added support for $abusesa_botnets
This commit is contained in:
parent
7ba77ed2ea
commit
12791c5891
2 changed files with 60 additions and 35 deletions
|
@ -2,6 +2,9 @@
|
|||
#
|
||||
# === Global variables
|
||||
#
|
||||
# $abusehelper_datadir
|
||||
# Abusehelper home directory. Defaults to /var/lib/ah2.
|
||||
#
|
||||
# $abusehelper_botnets
|
||||
# Array of botnet paths to start at boot.
|
||||
#
|
||||
|
@ -113,11 +116,25 @@ class abusehelper {
|
|||
}
|
||||
}
|
||||
|
||||
if $abusehelper_botnets {
|
||||
include abusehelper::init
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install abusehelper init script.
|
||||
#
|
||||
class abusehelper::init {
|
||||
|
||||
if !$abusehelper_botnets {
|
||||
fail("Must define \$abusehelper_botnets")
|
||||
}
|
||||
|
||||
if !$abusehelper_user {
|
||||
$abusehelper_user = "abusehel"
|
||||
}
|
||||
|
||||
if $abusehelper_botnets {
|
||||
file { "/etc/sysconfig/botnet":
|
||||
ensure => present,
|
||||
name => $::operatingsystem ? {
|
||||
|
@ -154,6 +171,5 @@ class abusehelper {
|
|||
service { "botnet":
|
||||
enable => true,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
# $abusesa_datadir
|
||||
# AbuseSA home directory. Defaults to /var/lib/abusesa.
|
||||
#
|
||||
# $abusesa_botnets
|
||||
# Array of botnet paths to start at boot.
|
||||
#
|
||||
class abusesa {
|
||||
|
||||
case $::operatingsystem {
|
||||
|
@ -76,4 +79,10 @@ class abusesa {
|
|||
}
|
||||
python::setup::install { "/usr/local/src/abusesa": }
|
||||
|
||||
if $abusesa_botnets {
|
||||
$abusehelper_botnets = $abusesa_botnets
|
||||
$abusehelper_user = "abusesa"
|
||||
include abusehelper::init
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue