Zero-downtime delivery · 6 / 10 ·
The playbook only touches the idle slot
The lab playbook does not stop the live slot. It reads state.json, picks the opposite of live, and renders compose for that slot only.
Six taught steps
- Read state. The first deploy pretends the other slot is live so the first step stays deterministic.
- Check the target port. If another process holds it, stop.
- Pull the image and start the idle slot.
- Run the health check.
- Patch the Caddy route.
- Stop the old slot and write the new state.
- Blue is serving. Green is empty.
- The playbook pulls the image onto the idle slot. Blue still answers.
- Green is healthy and still hidden from readers.
The playbook sketch lives in examples/titikterang/ansible.