Files
the-custodian/infra/build-machines/haskell/scripts/install-agent.sh
tegwick 9bc761c2b5 feat(railiance): implement CUST-WP-0032 Haskell build machine infra
Packer build definition, cloud-init autoinstall, GHCup toolchain script,
boot-time registration agent (state-hub + autossh dual tunnel), systemd
unit, key injection, remote-build Makefile, smoke test, and deployment
README. All 15 tasks complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 12:01:30 +02:00

23 lines
765 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Copy agent artefacts (provisioned by Packer file provisioner)
install -m 0755 /tmp/build-agent.py /usr/local/bin/build-agent
install -m 0644 /tmp/build-agent.service /etc/systemd/system/build-agent.service
install -m 0600 /tmp/build-agent.env.template /etc/build-agent.env.template
# Placeholder env file — operator fills this in before first boot
if [ ! -f /etc/build-agent.env ]; then
cp /etc/build-agent.env.template /etc/build-agent.env
fi
# Install autossh
apt-get install -y -qq autossh
# Enable agent service (starts on boot, after network-online)
systemctl daemon-reload
systemctl enable build-agent.service
# SSH host key generation (deterministic at first boot, not baked in image)
dpkg-reconfigure openssh-server