2.9 KiB
Node Onboarding Workflow
This document describes the process of onboarding a new Linux machine into the homelab platform.
Overview
The onboarding process consists of three main stages:
- Preparation: Setting up the runtime environment and dependencies.
- Discovery: Collecting hardware and software characteristics of the node.
- Inventory Generation: Creating the YAML configuration files for the node in the central inventory.
Prerequisites
- A fresh Linux machine (Debian/Ubuntu recommended).
- SSH access with sudo privileges.
- Tailscale account (if using Tailscale for networking).
Onboarding Steps
1. Node Preparation
Run the prepare-node.sh script on the target node. This script will install Docker, Tailscale, and create the /opt/homelab directory structure.
sudo ./scripts/bootstrap/prepare-node.sh
Manual Step: If you are using Tailscale, you must manually authenticate it after the script runs:
sudo tailscale up
2. Node Discovery
Run the discover-node.sh script to collect system information. It is recommended to redirect the output to a file.
./scripts/bootstrap/discover-node.sh > discovery-$(hostname).json
3. Inventory Generation
Copy the discovery JSON file to your management machine (where the homelab repository is located) and run the inventory generator.
./scripts/bootstrap/generate-node-inventory.py discovery-node-name.json
This will create a new directory in hosts/<hostname>/ with the following files:
host.yaml: Basic host identity and roles.capabilities.yaml: Hardware and software capabilities.paths.yaml: Runtime path definitions.networking.yaml: Networking configuration.
4. Finalization
- Review the generated YAML files in
hosts/<hostname>/. - Assign appropriate roles to the node in
hosts/<hostname>/host.yaml. - Commit the new host configuration to the repository.
- Run the deployment script to apply the initial configuration:
./scripts/deploy/deploy-node.sh <hostname>
Recovery Onboarding
If a node needs to be re-onboarded after a failure:
- Run
prepare-node.shagain. It is idempotent and will ensure the environment is correct. - Restore any critical data to
/opt/homelab/data/and/opt/homelab/backups/. - Re-run
discover-node.shif hardware has changed, or reuse the existing inventory if it hasn't.
Tailscale Assumptions
- Nodes are assumed to use Tailscale for management and inter-node communication.
- The
networking.yamlwill be populated with the Tailscale IP found during discovery. - If Tailscale is not used, manual adjustment of
networking.yamlandhost.yamlis required.
Troubleshooting
- Docker not starting: Check
journalctl -u docker. - Discovery fails: Ensure all required tools (lscpu, lsblk, ip, etc.) are installed.
- Inventory Generation error: Ensure
PyYAMLis installed on the management machine.