about summary refs log tree commit diff
path: root/bundles/fail2ban/items.py
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/fail2ban/items.py')
-rw-r--r--bundles/fail2ban/items.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/bundles/fail2ban/items.py b/bundles/fail2ban/items.py
new file mode 100644
index 0000000..9627587
--- /dev/null
+++ b/bundles/fail2ban/items.py
@@ -0,0 +1,31 @@
+if node.os != "alpine":
+    raise BundleError(f"{node.name}: OS {node.os} is not supported.")
+
+from os.path import join
+
+svc_openrc = {
+    "fail2ban": {
+        "enabled": True,
+        "running": True,
+        "needs": {
+            "pkg_apk:fail2ban",
+            "bundle:firewall",
+            "bundle:tgnotify",
+        },
+    },
+}
+
+files = {
+}
+
+repo.libs.gen.add_files_recursive(
+    files,
+    join(repo.path, "bundles", "fail2ban", "files"),
+    {
+        "triggers": {
+            "svc_openrc:fail2ban:restart",
+        },
+    },
+)
+
+# TODO: metrics? https://github.com/hectorjsmith/fail2ban-prometheus-exporter