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>
This commit is contained in:
22
infra/build-machines/haskell/scripts/install-agent.sh
Executable file
22
infra/build-machines/haskell/scripts/install-agent.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user