summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-01-04 08:37:32 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-08 10:03:12 +0100
commit5340a8eac71349b5e9147b70a1f22c90110c2b93 (patch)
tree52bc00e0a8c6e6ff6d1d4c5b69e9d455c7d1f1d3
parent1800646baa0db1d555d994394633305390ef35a7 (diff)
downloaditzks-systems-5340a8eac71349b5e9147b70a1f22c90110c2b93.tar.gz
itzks-systems-5340a8eac71349b5e9147b70a1f22c90110c2b93.tar.bz2
itzks-systems-5340a8eac71349b5e9147b70a1f22c90110c2b93.zip
share/debian-edu-config/tools/gosa-*-host-itzks: Ship wrappers for Debian Edu's GOsa² hooks gosa-create-host and gosa-modify-host. We need assure file permissions on the created keytabs, so that puppet can read them.
-rwxr-xr-xshare/debian-edu-config/tools/gosa-create-host-itzks14
-rwxr-xr-xshare/debian-edu-config/tools/gosa-modify-host-itzks21
2 files changed, 35 insertions, 0 deletions
diff --git a/share/debian-edu-config/tools/gosa-create-host-itzks b/share/debian-edu-config/tools/gosa-create-host-itzks
new file mode 100755
index 0000000..ae484b0
--- /dev/null
+++ b/share/debian-edu-config/tools/gosa-create-host-itzks
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -e
+
+HOST="${1}"
+
+# call Debian Edu's gosa-create-host
+/usr/share/debian-edu-config/tools/gosa-create-host ${@}
+
+# ITZkS: assure that host keytabs are readable by puppet
+chown :puppet /etc/debian-edu/host-keytabs/*.keytab
+chmod 0640 /etc/debian-edu/host-keytabs/*.keytab
+
+exit 0
diff --git a/share/debian-edu-config/tools/gosa-modify-host-itzks b/share/debian-edu-config/tools/gosa-modify-host-itzks
new file mode 100755
index 0000000..9d053e6
--- /dev/null
+++ b/share/debian-edu-config/tools/gosa-modify-host-itzks
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+
+HOST="${1}"
+
+# FIXME: bluntly assuming domain .intern here...
+
+# call Debian Edu's gosa-create-host
+if ! LANG=C kadmin.local -q "get_principal host/$HOST.intern" 2>/dev/null | grep -q "^Principal: host/$HOST.intern@.*" && \
+ ! LANG=C kadmin.local -q "get_principal nfs/$HOST.intern" 2>/dev/null | grep -q "^Principal: nfs/$HOST.intern@.*"; then
+
+ /usr/share/debian-edu-config/tools/gosa-modify-host ${@}
+
+fi
+
+# ITZkS: assure that host keytabs are readable by puppet
+chown :puppet /etc/debian-edu/host-keytabs/*.keytab
+chmod 0640 /etc/debian-edu/host-keytabs/*.keytab
+
+exit 0