Files
rollcall/deploy/install.sh
T
Ilker ManapandClaude Fable 5.1 c81b498df1
CI / agent (push) Successful in 3s
CI / site (push) Successful in 2s
CI / go (push) Failing after 29s
compute image: dbus for slurmd's systemd scope; controller slurm.conf sync timer
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-27 02:12:08 +01:00

45 lines
2.7 KiB
Bash

#!/bin/sh
# Install the rollcall binary on pxe-server. Run as root from this directory.
# Prereqs: PostgreSQL running locally with role+db "rollcall";
# /etc/rollcall/config.json present (see config.example.json).
set -eu
cd "$(dirname "$0")"
getent passwd rollcall >/dev/null || useradd --system --no-create-home --shell /usr/sbin/nologin --user-group rollcall
install -d -m 0750 -o root -g rollcall /etc/rollcall
install -d /srv/rollcall/image
[ -x ./rollcall ] && install -m 0755 rollcall /usr/local/bin/rollcall
install -m 0644 rollcall.service /etc/systemd/system/
[ -e /etc/rollcall/config.json ] || { echo "write /etc/rollcall/config.json first (see config.example.json)" >&2; exit 1; }
chown root:rollcall /etc/rollcall/config.json && chmod 0640 /etc/rollcall/config.json
# master key is created by the service on first start; the dir must be writable for that
chown rollcall:rollcall /etc/rollcall
# rollcall writes per-MAC pxelinux configs
chgrp rollcall /srv/tftp/pxelinux.cfg && chmod 2775 /srv/tftp/pxelinux.cfg
install -m 0644 /usr/lib/syslinux/modules/bios/poweroff.c32 /srv/tftp/poweroff.c32
sed "s/@AGENT_TOKEN@/$(jq -r .agent_token /etc/rollcall/config.json)/g" pxelinux-default > /srv/tftp/pxelinux.cfg/default && chmod 0644 /srv/tftp/pxelinux.cfg/default
[ -e /srv/tftp/rollcall ] || ln -s /srv/rollcall/image /srv/tftp/rollcall
[ -d /srv/tftp/efi64 ] && ln -sfn ../rollcall /srv/tftp/efi64/rollcall
# stateless images: <images_dir>/<name>/..., reachable by pxelinux as images/<name>/
install -d /srv/rollcall/images
[ -e /srv/tftp/images ] || ln -s /srv/rollcall/images /srv/tftp/images
[ -d /srv/tftp/efi64 ] && ln -sfn ../images /srv/tftp/efi64/images
# overlay templates (server-only secrets such as munge.key live next to them and are kept)
install -d -m 0750 -o root -g rollcall /etc/rollcall/overlays
cp -a overlays/. /etc/rollcall/overlays/
chgrp -R rollcall /etc/rollcall/overlays
# dnsmasq host export + reload trigger
install -d -m 0755 /var/lib/rollcall
install -d -m 0755 -o rollcall -g rollcall /var/lib/rollcall/dnsmasq
install -m 0644 rollcall-dnsmasq.path rollcall-dnsmasq.service /etc/systemd/system/
# optional: this host is also the Slurm controller -> keep its slurm.conf rendered from the profile
install -m 0644 rollcall-controller-sync.service rollcall-controller-sync.timer /etc/systemd/system/
systemctl daemon-reload
systemctl enable --now rollcall-dnsmasq.path >/dev/null 2>&1 || true
if systemctl list-unit-files slurmctld.service >/dev/null 2>&1 && [ -d /etc/slurm ]; then
systemctl enable --now rollcall-controller-sync.timer >/dev/null 2>&1 || true
fi
systemctl enable --now rollcall.service
systemctl restart rollcall.service
sleep 1
systemctl --no-pager status rollcall.service | head -5