summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2015-02-07 11:31:05 (GMT)
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2015-02-07 17:42:57 (GMT)
commit3a3b26d95c55b4cf9676a19e5d95cfc0d7602779 (patch)
treea5708ddaa15bab3faae712cd629c3ed6ca169ecd
parent72d295c7a74b378441b4524e347bb244c11af213 (diff)
downloaddefinitions-baserock/ps/add-pyinotify-fail2ban.tar.gz
Add fail2ban and pyinotify to connectivity.morphbaserock/ps/add-pyinotify-fail2ban
This includes a systemd unit file to start Fail2Ban
-rw-r--r--strata/connectivity.morph9
-rw-r--r--strata/connectivity/fail2ban.morph28
-rw-r--r--systems/devel-system-x86_64-generic.morph2
3 files changed, 39 insertions, 0 deletions
diff --git a/strata/connectivity.morph b/strata/connectivity.morph
index 2cc6bb6..409abcf 100644
--- a/strata/connectivity.morph
+++ b/strata/connectivity.morph
@@ -20,3 +20,12 @@ chunks:
ref: 482c6d3731e2681cb4baae835c294840300197e6
unpetrify-ref: v1.4.21
build-depends: []
+- name: fail2ban
+ morph: strata/connectivity/fail2ban.morph
+ repo: upstream:fail2ban
+ ref: master
+ build-depends: []
+- name: pyinotify
+ repo: upstream:pyinotify
+ ref: master
+ build-depends: []
diff --git a/strata/connectivity/fail2ban.morph b/strata/connectivity/fail2ban.morph
new file mode 100644
index 0000000..302a061
--- /dev/null
+++ b/strata/connectivity/fail2ban.morph
@@ -0,0 +1,28 @@
+name: fail2ban
+kind: chunk
+build-system: manual
+build-commands:
+- python setup.py build
+install-commands:
+- python setup.py install --prefix "$PREFIX" --root "$DESTDIR"
+- mkdir -p "$DESTDIR/var/run/fail2ban"
+post-install-commands:
+post-install-commands:
+ - |
+ install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/fail2ban.service
+ [Unit]
+ Description=Fail2ban Service
+
+ [Service]
+ Type=forking
+ ExecStart=/usr/bin/fail2ban-client -x start
+ ExecStop=/usr/bin/fail2ban-client stop
+ ExecReload=/usr/bin/fail2ban-client reload
+ PIDFile=/var/run/fail2ban/fail2ban.pid
+ Restart=always
+
+ [Install]
+ WantedBy=multi-user.target
+ EOF
+ - mkdir "$DESTDIR"/etc/systemd/system/multi-user.target.wants
+ - ln -s "$DESTDIR"/etc/systemd/system/fail2ban.service "$DESTDIR"/etc/systemd/system/multi-user.target.wants/fail2ban.service
diff --git a/systems/devel-system-x86_64-generic.morph b/systems/devel-system-x86_64-generic.morph
index 32ddfc5..64296d5 100644
--- a/systems/devel-system-x86_64-generic.morph
+++ b/systems/devel-system-x86_64-generic.morph
@@ -36,6 +36,8 @@ strata:
morph: strata/python-tools.morph
- name: devtools
morph: strata/devtools.morph
+- name: connectivity
+ morph: strata/connectivity.morph
configuration-extensions:
- set-hostname
- add-config-files