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>
23 lines
765 B
Bash
Executable File
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
|