Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/fail2ban/manifests/filter.pp

Issue 29364214: Issue 2487 - Introduce fail2ban module (Closed)
Patch Set: Issue 2487 - Introduce fail2ban module Created Nov. 25, 2016, 3:17 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: modules/fail2ban/manifests/filter.pp
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/fail2ban/manifests/filter.pp
@@ -0,0 +1,41 @@
+# == Type: fail2ban::filter
+#
+# Manage filter information and files for any custom filter.
+#
+# == Parameters:
+#
+# [*failregex*]
+# The regular expressions applied to the filter.
+#
+# [*ensure*]
+# A boolean to ensure the state of the file.
+#
+# === Examples:
+#
+# filters => {
+# 'wordpress' => {
+# failregex => [
+# '^<HOST>.*\"WordPress\/.*',
+# ],
+# }
+# },
+define fail2ban::filter (
+ $failregex = undef,
+ $ensure = 'present',
+) {
+
+ include fail2ban
+ include stdlib
+
+ if ($failregex != undef) and ($ensure == 'present') {
+ file {"/etc/fail2ban/filter.d/$title.conf":
+ ensure => $ensure,
+ content => template("fail2ban/filter.erb"),
+ group => 'root',
+ mode => '0644',
+ owner => 'root',
+ require => Package['fail2ban'],
+ notify => Service['fail2ban'],
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld