Files
rollcall/deploy/rollcall-controller-sync.sh
T
Ilker ManapandClaude Fable 5.1 1452b79218
CI / agent (push) Successful in 3s
CI / site (push) Successful in 2s
CI / go (push) Failing after 30s
controller sync as a POSIX script (the unit's inline shell used bash-only syntax)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-27 02:12:54 +01:00

18 lines
650 B
Bash
Executable File

#!/bin/sh
# Render the profile's slurm.conf and, when it differs from the local one,
# install it and restart slurmctld. Runs from rollcall-controller-sync.timer.
set -eu
PROFILE=${PROFILE:-compute}
CONF=/etc/slurm/slurm.conf
new=$(mktemp)
trap 'rm -f "$new"' EXIT
/usr/local/bin/rollcall render "$PROFILE" etc/slurm/slurm.conf > "$new" || exit 0
if [ -f "$CONF" ] && grep -v '^# rendered by rollcall' "$new" | cmp -s - "$(grep -v '^# rendered by rollcall' "$CONF" > "$new.old" && echo "$new.old")"; then
rm -f "$new.old"
exit 0
fi
rm -f "$new.old"
install -m 0644 "$new" "$CONF"
systemctl try-restart slurmctld.service
echo "slurm.conf updated"