Skip to main content

Local Development and Sandbox (Vagrant) — This page covers: ⬆ índice

Local Development and Sandbox (Vagrant)

This page covers:

  • local development (Docker) from your machine
  • a local Vagrant VM that you can register in Ansible inventory and then manage with the normal remote commands

Production server install is documented separately in Production Install Runbook.

Local development (Docker)

1) Generate env (once per checkout / after env changes)

./infra env generate
./infra env check

2) Start services

From the repo root:

./infra list
./infra up <project>
./infra logs <project>
./infra status <project>

From inside a specific project folder (preferred when working on that service), use its run.sh if present:

./run.sh help
./run.sh up
./run.sh logs

3) Stop / reset

./infra down <project>
./infra clean <project> # add --data to wipe data

Sandbox (Vagrant + VirtualBox)

The sandbox provisions a local Debian VM. It does not run bootstrap or deploy by itself anymore. Instead, you add that VM to the normal Ansible inventory and then use the regular remote commands against it.

What it changes locally (important)

./infra sandbox up will:

  • regenerate Vagrantfile in the repo root
  • create .vagrant/ (VM state)
  • create (or start) a local Debian VM
  • for a fresh VM, enable root password auth on SSH port 22 (only for first bootstrap convenience)
  • if the VM was already bootstrapped/hardened (externaladmin + non-22 SSH), the wizard will try to point Vagrant at the hardened SSH endpoint to avoid vagrant up hanging

Run it only when you are not simultaneously deploying to a real server, and preferably with a clean git worktree.

Run the sandbox

./infra sandbox up
./infra sandbox add
./infra init remote 192.168.56.10 all
# later updates:
./infra remote deploy 192.168.56.10 <project>

Stop the VM (non-destructive):

./infra sandbox down

Destroy the VM:

./infra sandbox destroy

Full purge (destroy VM + remove Vagrantfile and .vagrant/):

./infra sandbox down --purge

Notes

  • The wizard may prompt you for an external admin password if it is not set in your environment.
  • ./infra sandbox add registers the VM in deployment/ansible/inventory using the same inventory flow as ./infra server add.
  • After remote bootstrap, the inventory entry may need to be updated to hardened SSH defaults; the existing remote flow already does that.
  • If the sandbox fails (Vagrant/VirtualBox quirks), start by re-running ./infra sandbox down --purge and then ./infra sandbox up.
  • If you want a destructive rebuild (fresh VM), use ./infra sandbox recreate instead of sandbox down.