feat: add slurm key generators and remove stale scripts

This commit is contained in:
2025-09-25 12:08:05 +02:00
parent 96f8215c52
commit d2e27a7e87
7 changed files with 5 additions and 110 deletions

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
TOP="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
if [ $# != 1 ]; then
echo "usage: copy-hardware-configuration.sh name"
exit 1
fi
node=$1
[ -e $node.nix ] && mv $node.nix $node.nix.bak
scp root@$node:/etc/nixos/hardware-configuration.nix $node.nix

View File

@@ -1,27 +0,0 @@
#!/usr/bin/env bash
TOP="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/.."
if [ $# = 0 ]; then
echo "usage: deploy.sh name ..."
exit 1
fi
if [ ! -f $TOP/$1/default.nix ]; then
echo "error: $1 does not contain a deployment"
exit 1
fi
cd $TOP/$1
nixops list | grep -q $1
if [ $? = 0 ]; then
echo "--- Updating deployment"
nixops modify -d $1 .
else
echo "--- Creating deployment"
nixops create -d $1 .
fi
echo "--- Deploying $1"
nixops deploy -k -d $* --allow-reboot

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env bash
TOP="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/.."
if [ $# = 0 ]; then
echo "usage: reboot.sh cluster "
exit 1
fi
d=$1
shift
nixops reboot -d $d $*

View File

@@ -0,0 +1,3 @@
#!/bin/sh
dd if=/dev/random of=jwt_hs256.key bs=32 count=1
chmod 400 jwt_hs256.key

View File

@@ -0,0 +1,2 @@
#!/bin/sh
mungekey -c -b 2048 -k munge.key

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env bash
TOP="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/.."
if [ $# = 0 ]; then
echo "usage: ssh.sh cluster ..."
exit 1
fi
d=$1; shift
nixops ssh-for-each -d $d -- $@

View File

@@ -1,45 +0,0 @@
#!/usr/bin/env bash
TOP="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
reboot=no
case $1 in
--reboot) reboot=yes; shift ;;
esac
if [ $# != 1 ]; then
echo "usage: teardown.sh [--reboot] name"
exit 1
fi
d=$1
tmp=$TOP/.$d.$$
teardown () {
mkdir -p $tmp
cp -r $TOP/$d/* $tmp
sed -i '/k8s *= *{/,+1 s/enable *= *true/enable = false/' $tmp/cluster.nix
nixops modify -d $d $tmp
nixops deploy -d $d
[ $reboot = yes ] && nixops reboot -d $d
nixops ssh-for-each -d $d \
"rm -rf /var/run/kubernetes /var/lib/kubernetes /var/lib/etcd /var/lib/kubelet /var/lib/cfssl"
rm -rf $tmp
}
cat << EOF
************************************************************************
*** ***
*** WARNING: This will irrevokably destroy the running cluster! ***
*** ***
************************************************************************
EOF
echo "Are you sure you want to tear down $d? (YES/no)"
read a
case $a in
YES) teardown ;;
*) echo "Bailing out." ;;
esac