Files
rollcall/lab/pve-vbmc/install.sh
T
Ilker ManapandClaude Fable 5.1 1f2178e99a
CI / agent (push) Successful in 3s
CI / site (push) Successful in 2s
CI / go (push) Failing after 32s
lab: noautologin on the commissioning cmdline; note on persisting BMC addresses in netplan
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-27 10:31:52 +01:00

20 lines
1.1 KiB
Bash

#!/bin/sh
# Run on pxe-server as root from the directory containing these files.
# Expects /etc/pve-vbmc/config.json to exist already (see config.example.json).
set -eu
cd "$(dirname "$0")"
getent passwd pve-vbmc >/dev/null || useradd --system --no-create-home --shell /usr/sbin/nologin --user-group pve-vbmc
install -m 0755 pve_vbmc.py /usr/local/bin/pve_vbmc.py
install -m 0755 pve-vbmc-addrs.sh /usr/local/bin/pve-vbmc-addrs.sh
install -m 0644 pve-vbmc@.service pve-vbmc-addrs.service /etc/systemd/system/
chgrp pve-vbmc /etc/pve-vbmc/config.json && chmod 0640 /etc/pve-vbmc/config.json
systemctl daemon-reload
systemctl enable --now pve-vbmc-addrs.service
# NOTE: on netplan/systemd-networkd hosts a later reconfigure flushes addresses added by the
# service (seen in the lab: the BMCs stopped answering). Also list the BMC addresses under the
# pxenet interface in /etc/netplan/*.yaml so they survive.
for v in $(python3 -c 'import json;print(" ".join(str(b["vmid"]) for b in json.load(open("/etc/pve-vbmc/config.json"))["bmcs"]))'); do
systemctl enable --now "pve-vbmc@$v.service"
done
systemctl --no-pager --type=service | grep pve-vbmc