Automated setup for Raspberry Pi 4B using Ansible. Installs Docker, configures Cloudflare Tunnel, sets up GitHub Actions runner, and manages secrets.
- Raspberry Pi OS Lite (64-bit) installed
- Docker available on the target Raspberry Pi
- Ansible installed on the machine running the playbook
- For remote deployment: SSH access configured to the Raspberry Pi
- For local self-testing on the Pi itself: no SSH key is required when using
--local
-
Configure services (edit
iac-toolbox.ymlat the repository root):- Set Cloudflare tunnel name and domains
- Configure optional features (Cloudflare Tunnel, GitHub Runner)
-
Run install script:
./scripts/install.shSecrets (API tokens, passwords) are injected as environment variables by the CLI from ~/.iac-toolbox/credentials. Advanced users running install.sh directly can export the required variables before invoking the script.
./scripts/setup.sh remains as a compatibility wrapper.
- If using Cloudflare Tunnel (manual step):
ssh pi@raspberrypi.local
cloudflared tunnel login
# Then re-run: ansible-playbook -i inventory/all.yml playbooks/main.yml --tags cloudflare- Docker Engine - Container runtime with Docker Compose
- HashiCorp Vault - Secrets management with auto-unseal
- Cloudflare Tunnel - Secure external access (optional)
- GitHub Actions Runner - Self-hosted ARM64 runner
- Secrets - Managed via HashiCorp Vault
Configuration is split across two layers:
iac-toolbox.yml- Application settings (domains, ports, feature flags)- Environment variables - Secrets and connection details (injected by the CLI from
~/.iac-toolbox/credentials)
The iac-toolbox.yml file is automatically discovered in the following order:
- Path specified by
IAC_TOOLBOX_CONFIGenvironment variable (highest priority) infrastructure/iac-toolbox.ymlin the project directory~/.iac-toolbox/iac-toolbox.yml(user home directory)
To specify a custom location:
export IAC_TOOLBOX_CONFIG=/path/to/your/iac-toolbox.yml
./scripts/install.shIf no configuration file is found, role defaults will be used (all services enabled).
Common entry points:
./scripts/install.sh
./scripts/install.sh --vault
./scripts/install.sh --ansible-only
./scripts/install.sh --terraform-onlySelf-test against the same Raspberry Pi running the repo:
./scripts/install.sh --vault --local
./scripts/uninstall-vault.sh --localRun specific components directly with Ansible:
cd ansible-configurations
ansible-playbook -i inventory/all.yml playbooks/main.yml --tags docker
ansible-playbook -i inventory/all.yml playbooks/main.yml --tags vault
ansible-playbook -i inventory/all.yml playbooks/main.yml --tags github-runner
ansible-playbook -i inventory/all.yml playbooks/main.yml --tags cloudflareDeploy HashiCorp Vault for secrets management:
./scripts/install.sh --vaultOr, when testing directly on the target Pi itself:
./scripts/install.sh --vault --localAfter deployment:
- Access Vault UI at:
https://vault.iac-toolbox.com - Root token and unseal key are displayed in Ansible output
- Credentials saved to:
~/vault/data/vault-init.jsonon Raspberry Pi - Vault is automatically unsealed by the playbook before KV and audit setup continue
Cleanup Vault (if needed):
./scripts/uninstall-vault.shOr locally on the Pi:
./scripts/uninstall-vault.sh --localThis repository is a monorepo containing the following packages:
| Package | Path | Description |
|---|---|---|
| Ansible Automation | ansible-configurations/ |
Ansible playbooks and roles for Raspberry Pi provisioning |
| CLI Wizard | cli/ |
TypeScript/Ink-based terminal wizard that guides users through the provisioning flow |
| Terraform | terraform/ |
Terraform configurations (Grafana alerts) |
| Scripts | scripts/ |
Shell scripts for installation and setup |
Each package has its own CI workflow scoped to its directory. See individual package READMEs for details.
- docs/PROJECT_PLAN.md - Project architecture and overview
- docs/01-vault-setup.md - HashiCorp Vault setup and usage guide
- cli/README.md - CLI wizard documentation