diff --git a/manifests/fail2ban.pp b/manifests/fail2ban.pp index 72058f4368c8e03d0ffaca7e5a9f8ca9e7e387e7..e2f1ef1aa6543da80c0c297e54db205cc0fefb75 100644 --- a/manifests/fail2ban.pp +++ b/manifests/fail2ban.pp @@ -1,4 +1,6 @@ -class lysnetwork::fail2ban { +class lysnetwork::fail2ban ( + $config = undef, +){ if $facts['os']['name'] == 'CentOS' { require ::epel } @@ -15,14 +17,13 @@ class lysnetwork::fail2ban { File['/etc/fail2ban/action.d/iptables-common.conf'],], } - file { - '/etc/fail2ban/jail.local': - ensure => file, - owner => 'root', - group => 'root', - mode => '0644', - source => "puppet:///modules/lysnetwork/fail2ban/jail_local_ssh-${facts['os']['name']}", - notify => Service['fail2ban'], + file { '/etc/fail2ban/jail.local': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + content => hash2ini($config, {quote_char => ''}), + notify => Service['fail2ban'], } file {