This module setup fail2ban.
Call this task to install fail2ban on your system.
- ensure - Default: latest
- service_ensure - Default: running
- fail2ban_conf, Location of configuration file - Default: /etc/fail2ban/fail2ban.conf
- fail2ban_conf_template, Template to use to configure fail2ban. - Default: templates/fail2ban/fail2ban.conf.tpl
- loglevel - Default: INFO
- logtarget - Default: /var/log/fail2ban.log
- syslogsocket - Default: auto
- socket - Default: /var/run/fail2ban/fail2ban.sock
- pidfile - Default: /var/run/fail2ban/fail2ban.pid
- dbfile - Default: /var/lib/fail2ban/fail2ban.sqlite3
- dbpurgeage - Default: 86400
use Fail2ban;
task "setup", sub {
Fail2ban::setup;
};
use Fail2ban;
task "setup", sub {
Fail2ban::setup {
socket => "/tmp/fail2ban.sock",
};
};
Create a fail2ban action. Will place a file inside /etc/fail2ban/action.d.
- ensure - Default: present
- content - Content of the action.
This will create the file /etc/fail2ban/action.d/myaction.conf.
Fail2ban::action "myaction",
ensure => "present",
content => template("templates/myaction.tpl");
Create a fail2ban filter. Will place a file inside /etc/fail2ban/filter.d.
- ensure - Default: present
- content - Content of the filter.
This will create the file /etc/fail2ban/filter.d/myfilter.conf.
Fail2ban::filter "myfilter",
ensure => "present",
content => template("templates/myfilter.tpl");
Create a fail2ban jail. Will place a file inside /etc/fail2ban/jail.d.
- ensure - Default: present
- content - Content of the jail.
This will create the file /etc/fail2ban/jail.d/myjail.conf.
Fail2ban::jail "myjail",
ensure => "present",
content => template("templates/myjail.tpl");