Spec ID: 2-inventory-bootstrap
Stage: 1 of 8
Status: ✅ Approved
Author: Treize (Lead)
GitHub Issue: #2
Establish the Ansible inventory structure and verify basic connectivity to the Raspberry Pi 5. This is the foundation for all subsequent Ansible automation.
Before any Ansible automation can run, we need:
- A working
ansible.cfgwith sensible defaults - An inventory that describes our Pi 5 target
- Verified SSH connectivity from the control machine to the Pi
- A structure that can scale to multiple hosts later (even though we start with one)
Create the standard Ansible inventory layout with production/development separation, group and host variables, and a simple ping playbook to verify connectivity.
ansible.cfg # Ansible configuration
inventories/
production/
hosts.yml # Host inventory (pi_runners group)
group_vars/
all.yml # Variables for all hosts
pi_runners.yml # Variables for pi_runners group
host_vars/
pi5-runner.yml # Host-specific variables
playbooks/
ping.yml # Connectivity test playbook
ansible.cfg:
- Inventory path:
inventories/production - Roles path:
roles - Host key checking: strict by default after first SSH trust is established from WSL
- Retry files disabled (no clutter)
hosts.yml:
all:
children:
pi_runners:
hosts:
pi5-runner:
ansible_host: "{{ pi5_ip }}"
ansible_user: "{{ pi5_ssh_user }}"group_vars/pi_runners.yml:
runner_user: actions-runner
runner_home: /opt/actions-runner
cache_base: /opt/runner-cache-
ansible.cfgexists with documented configuration - Inventory follows standard Ansible layout (
inventories/{env}/hosts.yml) -
group_vars/andhost_vars/directories established -
ansible-playbook playbooks/ping.yml -i inventories/productionsucceeds - Sensitive value placeholders documented (IP, token locations)
- Second run produces identical results (idempotent by nature)
- Creating the
actions-runneruser (Stage 2) - Installing any packages on the Pi (Stage 2+)
- Docker, runner, or hooks setup (Stages 3–6)
- Development inventory population (future)
-
Requires:
- Fresh Raspberry Pi 5 with:
- Raspberry Pi OS Lite (64-bit, Bookworm) installed
- SSH enabled
- Network connectivity
- Known IP address or hostname
- SSH key access configured for the control node
- Fresh Raspberry Pi 5 with:
-
Enables:
- Stage 2: Common base role (SSH hardening, user creation)
- All subsequent stages (they all use this inventory)
| Role | Agent |
|---|---|
| Implement | Heero |
| Review | Treize |
| Validate | Noin |
# From Ubuntu WSL
cd /mnt/c/ws/PerformanceNode
# Test connectivity
ANSIBLE_CONFIG=$PWD/ansible.cfg ansible-playbook -i inventories/production playbooks/ping.ymlThis stage assumes SSH is already configured on the Pi. For the current target:
- Inventory alias:
pi5-runner - Pi hostname:
PiTester - SSH host:
192.168.27.222 - SSH user:
fortinbra
If the repository is stored on the Windows filesystem and accessed from WSL via /mnt/c/..., run Ansible with ANSIBLE_CONFIG=$PWD/ansible.cfg so Ansible uses the repo-local configuration explicitly.
The runner registration token will be needed in Stage 4. This stage only establishes the pattern:
- Sensitive values marked with comments:
# Set via --extra-vars or vault - Actual vault setup deferred until needed