added controls for main conf/local files
This commit is contained in:
@@ -25,7 +25,6 @@ class cd_fail2ban::main::config (
|
||||
|
||||
) inherits cd_fail2ban::params {
|
||||
|
||||
if $fn_enable_fail2ban == true {
|
||||
include cd_fail2ban::main::service
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -109,4 +109,20 @@ class cd_fail2ban::main::dirs (
|
||||
seltype => fail2ban_var_lib_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# manage /var/run/fail2bam
|
||||
|
||||
file { $fn_var_run_dir:
|
||||
ensure => directory,
|
||||
path => $fn_var_run_dir,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => fail2ban_var_run_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,4 +26,39 @@ class cd_fail2ban::main::files (
|
||||
|
||||
require cd_fail2ban::main::dirs
|
||||
|
||||
if $fn_manage_config == true {
|
||||
|
||||
# manage fail2ban.conf
|
||||
|
||||
file { $fn_fail2ban_conf_file:
|
||||
ensure => present,
|
||||
path => $fn_fail2ban_conf_file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0640',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($fn_fail2ban_conf_erb),
|
||||
notify => Service[$fn_service],
|
||||
}
|
||||
|
||||
# manage fail2ban.local
|
||||
|
||||
file { $fn_fail2ban_local_file:
|
||||
ensure => present,
|
||||
path => $fn_fail2ban_local_file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0640',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($fn_fail2ban_conf_erb),
|
||||
notify => Service[$fn_service],
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,10 @@ class cd_fail2ban::main::service (
|
||||
require cd_fail2ban::main::files
|
||||
|
||||
service { $fn_service:
|
||||
ensure => running,
|
||||
ensure => $fn_enable_service,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
enable => true,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user