Skip to content

Commit

Permalink
Merge pull request #100 from kobybr/use-custom_jails-param
Browse files Browse the repository at this point in the history
Use custom_jails parameter
  • Loading branch information
bastelfreak authored Dec 29, 2018
2 parents e082a9f + 4893b84 commit b12a7ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# == Class: fail2ban::config
#
class fail2ban::config {
# Load custom jails definition
$config_custom_jails = hiera_hash('fail2ban::custom_jails', undef)

file { 'fail2ban.dir':
ensure => $::fail2ban::config_dir_ensure,
Expand Down Expand Up @@ -30,9 +28,7 @@
}

# Custom jails definition
if $config_custom_jails {
create_resources('fail2ban::jail', $config_custom_jails)
}
create_resources('fail2ban::jail', $::fail2ban::custom_jails)

# Operating system specific configuration
case $facts['os']['family'] {
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
Array[String[1]] $jails = ['ssh', 'ssh-ddos'],
Integer[0] $maxretry = 3,
Array $whitelist = ['127.0.0.1/8', '192.168.56.0/24'],
$custom_jails = undef,
Hash[String, Hash] $custom_jails = {},
String[1] $banaction = 'iptables-multiport',
) inherits ::fail2ban::params {
$config_file_content = default_content($config_file_string, $config_file_template)
Expand Down

0 comments on commit b12a7ea

Please sign in to comment.