Skip to content

Makefile

Melvin PETIT edited this page Aug 27, 2026 · 1 revision

Makefile

The Makefile holds no logic. Every target points at a script in scripts/, which is where the work happens. make on its own lists them.

First run, in order

Target What it does
make env Copies .env and the tfvars from their examples, generates a lab password
make preflight Checks tools, Azure login, quota, VM size and the SSH source range
make one-shot Runs preflight, creates the host, writes the inventory, installs DevStack
make connect SSH into the host with Horizon tunnelled to your browser
make demo Creates an instance with Terraform and logs into it
make stop Deallocates the host, which is what stops the billing

make one-shot is the whole first install, roughly an hour, most of it inside stack.sh. Add YES=1 to skip the confirmation prompt.

The pieces behind one-shot

Run them separately when something failed and you only want to retry one step.

Target What it does
make host terraform apply on the Azure stack
make inventory Writes the Ansible inventory from the Terraform outputs
make install Runs the playbook, waits for cloud-init first
make reset Wipes a broken DevStack so stack.sh can start over

make reset is not optional after a failure. DevStack has no partial rollback, and a retry on a dirty tree fails the same way.

Daily use

Target What it does
make start Boots the host again after a deallocate
make status Prints the power state
make tunnel Opens the SSH tunnel in the background
make demo-clean Destroys what the demo created, leaves the lab running
make destroy Destroys the host VM and its network, irreversible
make clean Removes local state, caches and the generated inventory

What to understand

Nothing is hardcoded. Every setting comes from .env, and a missing key stops the run rather than falling back to a default. Without that, a stranger cloning the repo would deploy into someone else's resource group.

Two Terraform stacks, not one. terraform/azure/ describes the machine that hosts the cloud. terraform/openstack/ describes what lives inside it. They have separate states and separate providers, because they are separate concerns.

OpenStack commands run on the host, not on your workstation. Keystone publishes a service catalog pointing at the private address of the VM, so a client on your laptop authenticates and then hangs on the first real call. Both demo.sh and the playbook go through SSH for this reason.

stop is not destroy. stop deallocates and keeps everything, and the lab is back in two minutes with start. destroy deletes the VM and the disk, and DevStack has to be reinstalled from scratch.

make demo is idempotent. Running it twice creates nothing the second time, because Terraform sees no drift. Run make demo-clean first when you want the creation to happen live in front of an audience.

Clone this wiki locally