Refactor to use osfamily instead of operatingsystem
The notion of operatingsystem should be abstracted for most usages by using osfamily (which gives windows, RedHat and Debian that I know of - not sure about MacOS). Some specific log files were missing from the default configuration for mail filters.
This commit is contained in:
1 parent
95b1d1231f
commit
e8e40569cf
3 files changed
+37
-29
No files matched your search
+27
-27
@@ -16,49 +16,49 @@ class fail2ban::params {
|
||||
|
||||
### Application related parameters
|
||||
|
||||
$package = $::operatingsystem ? {
|
||||
$package = $::osfamily ? {
|
||||
default => 'fail2ban',
|
||||
}
|
||||
|
||||
$service = $::operatingsystem ? {
|
||||
$service = $::osfamily ? {
|
||||
default => 'fail2ban',
|
||||
}
|
||||
|
||||
$service_status = $::operatingsystem ? {
|
||||
$service_status = $::osfamily ? {
|
||||
default => true,
|
||||
}
|
||||
|
||||
$process = $::operatingsystem ? {
|
||||
/(?i:Debian|Ubuntu|Mint)/ => 'fail2ban-server',
|
||||
/(?i:RedHat|Centos|Scientific|Fedora|OracleLinux)/ => 'fail2ban-server',
|
||||
default => 'fail2ban',
|
||||
$process = $::osfamily ? {
|
||||
'Debian' => 'fail2ban-server',
|
||||
'RedHat' => 'fail2ban-server',
|
||||
default => 'fail2ban',
|
||||
}
|
||||
|
||||
$process_args = $::operatingsystem ? {
|
||||
$process_args = $::osfamily ? {
|
||||
default => '',
|
||||
}
|
||||
|
||||
$process_user = $::operatingsystem ? {
|
||||
$process_user = $::osfamily ? {
|
||||
default => 'fail2ban',
|
||||
}
|
||||
|
||||
$config_dir = $::operatingsystem ? {
|
||||
$config_dir = $::osfamily ? {
|
||||
default => '/etc/fail2ban',
|
||||
}
|
||||
|
||||
$config_file = $::operatingsystem ? {
|
||||
$config_file = $::osfamily ? {
|
||||
default => '/etc/fail2ban/fail2ban.local',
|
||||
}
|
||||
|
||||
$config_file_mode = $::operatingsystem ? {
|
||||
$config_file_mode = $::osfamily ? {
|
||||
default => '0644',
|
||||
}
|
||||
|
||||
$config_file_owner = $::operatingsystem ? {
|
||||
$config_file_owner = $::osfamily ? {
|
||||
default => 'root',
|
||||
}
|
||||
|
||||
$config_file_group = $::operatingsystem ? {
|
||||
$config_file_group = $::osfamily ? {
|
||||
default => 'root',
|
||||
}
|
||||
|
||||
@@ -69,41 +69,41 @@ class fail2ban::params {
|
||||
# fail2ban::jail define
|
||||
$jails_config = ''
|
||||
|
||||
$jails_file = $::operatingsystem ? {
|
||||
$jails_file = $::osfamily ? {
|
||||
default => '/etc/fail2ban/jail.local',
|
||||
}
|
||||
|
||||
$jails_file_mode = $::operatingsystem ? {
|
||||
$jails_file_mode = $::osfamily ? {
|
||||
default => '0644',
|
||||
}
|
||||
|
||||
$jails_file_owner = $::operatingsystem ? {
|
||||
$jails_file_owner = $::osfamily ? {
|
||||
default => 'root',
|
||||
}
|
||||
|
||||
$jails_file_group = $::operatingsystem ? {
|
||||
$jails_file_group = $::osfamily ? {
|
||||
default => 'root',
|
||||
}
|
||||
|
||||
$config_file_init = $::operatingsystem ? {
|
||||
/(?i:Debian|Ubuntu|Mint)/ => '/etc/default/fail2ban',
|
||||
default => '/etc/sysconfig/fail2ban',
|
||||
$config_file_init = $::osfamily ? {
|
||||
'Debian' => '/etc/default/fail2ban',
|
||||
default => '/etc/sysconfig/fail2ban',
|
||||
}
|
||||
|
||||
$pid_file = $::operatingsystem ? {
|
||||
/(?i:Debian|Ubuntu|Mint)/ => '/var/run/fail2ban/fail2ban.pid',
|
||||
default => '/var/run/fail2ban.pid',
|
||||
$pid_file = $::osfamily ? {
|
||||
'Debian' => '/var/run/fail2ban/fail2ban.pid',
|
||||
default => '/var/run/fail2ban.pid',
|
||||
}
|
||||
|
||||
$data_dir = $::operatingsystem ? {
|
||||
$data_dir = $::osfamily ? {
|
||||
default => '/etc/fail2ban',
|
||||
}
|
||||
|
||||
$log_dir = $::operatingsystem ? {
|
||||
$log_dir = $::osfamily ? {
|
||||
default => '/var/log/fail2ban',
|
||||
}
|
||||
|
||||
$log_file = $::operatingsystem ? {
|
||||
$log_file = $::osfamily ? {
|
||||
default => '/var/log/fail2ban/fail2ban.log',
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user