DevOps runbooks
DevOps runbooks that are versioned, approved, and recorded.
A DevOps runbook is the written, step-by-step procedure for a recurring operational task: deploying a release, running a migration, recovering a service. Shortspan turns it into something you can execute - versioned like code, gated by a second person where it matters, and recorded every time it runs.
Definition
What is a runbook in DevOps?
A runbook is a written, repeatable procedure for one operational task - deploying a service, applying a database migration, rotating a credential, restarting something that has stopped responding. In DevOps it does the job a checklist does in a cockpit: the steps are decided calmly in advance, so whoever runs them at 3 a.m. does not have to improvise.
A useful runbook names its owner and the situation it is for, lists what must be true before starting, gives each step as an exact command with what success looks like, and says how to roll back. Because a runbook is meant to be executed rather than read, it has to stay accurate - which is why teams increasingly keep runbooks under version control and run them from tooling instead of copying commands out of a wiki.
| Topic | Runbook | Playbook | Wiki page |
|---|---|---|---|
| Answers | How do I do this one task? | How do we respond to this situation? | How does this system work? |
| Level of detail | Exact commands, in order, with expected results | Roles, decisions, communication, and which runbooks to use | Whatever the author chose to write |
| Example | Deploy the API | Production outage response | Architecture overview |
| If it is out of date | The procedure fails, or does damage | The response is slower | Someone is misinformed |
Example
An example DevOps runbook: deploying a web app
Here is a complete deploy runbook for a Laravel application on a single server. Each line is one step: one program with its arguments. The constraint is deliberate - every step is explicit, can be reviewed line by line, and can be checked before anything runs.
/usr/bin/git -C /var/www/app pull --ff-only/usr/local/bin/composer --working-dir=/var/www/app install --no-dev --no-interaction/usr/bin/npm --prefix /var/www/app ci/usr/bin/npm --prefix /var/www/app run build/usr/bin/php /var/www/app/artisan migrate --force/usr/bin/php /var/www/app/artisan queue:restart/usr/bin/curl -fsS https://app.example.com/upSteps are executed directly, not handed to a shell, so there is no cd, no &&, and no NAME=value prefix. Tools are pointed at the directory instead (git -C, npm --prefix), each step starts fresh, and the last step turns a failed health check into a failed run.
shortspan runbook show deploy-apishortspan runbook check deploy-apishortspan runbook run deploy-api→ deploy-api requires approval before it can run. Requested. Approvers have been notified. Execution: 4f9c2a71-...show prints the steps without running anything - read it first, especially for a runbook you did not write. check verifies the server before you commit to a run: that the sudo rule allows each exact command, that the run-as account can reach the paths it names, and, for a git pull, that the deploy key works, by running git ls-remote. run executes the steps in order, reports each as it goes, and stops at the first failure.
Production changes
Runbook automation with version control and approval workflows
A production change needs two guarantees: the procedure that runs is the one that was reviewed, and someone other than the operator agreed to run it now. Shortspan builds both into the runbook rather than leaving them to a ticket.
Every save is a version
Each edit stores a snapshot of the whole runbook with its author and time, so history survives even if the current version is rewritten entirely.
Rollback adds, never deletes
Restoring an older version creates a new version equal to it. The history is append-only, so “we reverted the deploy runbook on the 14th” stays visible.
Approval is per execution
Mark a runbook as requiring approval and running it creates a pending execution and emails the project’s approvers. The approval names that one execution: approving one run does not approve the next, and an approved run that is never started expires unused.
Every run is recorded
Each execution records who ran it, which version, when, whether approval was required and who granted it, and how it ended - with each step’s status, exit code, duration, and the tail of its output, redacted on your machine and again before it is stored.
No secrets in the steps
Steps can reference stored secrets and registered targets, brokered at the moment the step runs and audited individually. A runbook is not a way to obtain access you could not otherwise have: it runs with your permissions.
| Capability | Free | Pro | Team | Enterprise |
|---|---|---|---|---|
| Runbooks | 10 | Unlimited | Unlimited | Unlimited |
| CLI runbook execution | ||||
| Credential & runbook version history | ||||
| Restore previous versions | ||||
| Team members & invites |
In practice
How to write a runbook step that runs
A step is one program with its arguments, split into words and executed directly. Shell habits do not carry over, so translate them:
| Instead of | Write |
|---|---|
cd /var/www/app then git pull | /usr/bin/git -C /var/www/app pull |
php artisan migrate --force | /usr/bin/php /var/www/app/artisan migrate --force |
npm run build | /usr/bin/npm --prefix /var/www/app run build |
NODE_OPTIONS=… npm run build | A script that sets the variable, allowed on its own |
a && b, a | b, a > file | Separate steps, or a script |
Nothing carries between steps - not a directory, not a variable. For anything longer than a few commands, a script is simpler: install /usr/local/bin/deploy.sh on the server, allow it, and make it the runbook’s only step.
Checklist
What makes a good runbook
Write for whoever runs it at 3 a.m.
State what each step does and what “it worked” looks like, not only what to type.
One owner, one trigger
Name who maintains it and the exact situation it is for. A runbook for “problems with the API” is a playbook in disguise.
Preconditions before step one
Backups taken, maintenance window announced, the right release tag. Check them first, not halfway through.
A way back from every risky step
If a step cannot be undone, say so, and require approval for the runbook.
No credentials in the text
Reference stored secrets. A password pasted into a runbook is readable by everyone who can read the runbook, forever, in its history.
Run it, then fix it
A runbook that has not run since its last edit is a hypothesis. Update it straight after every incident that used it.
Why teams change
A command sequence in chat is not an operational control.
Deployment, maintenance, and recovery steps often survive as shell history, private notes, or messages from the last incident. That makes the next execution depend on memory and leaves reviewers unable to tell which version actually ran.
Shortspan stores a runbook as a versioned project resource beside the servers and credentials it uses. The current version can be inspected and checked before use, execution can require approval, and each run produces a record tied to the person, the version, the approval, and the outcome - without writing secret values into the steps.
What Shortspan adds
Control around the workflow, not another workflow beside it.
Versioned plans
Keep snapshots of operational steps so a reviewed procedure does not silently change underneath an approval.
Execution approval
Require a second person before a sensitive runbook proceeds, with the decision attached to that one execution.
Checked before it runs
shortspan runbook check verifies the sudo rule, paths, and deploy key on the server without running a step.
The workflow
From registered resource to accountable use.
- 01
Write the procedure
Create the steps in the console, or start from the free runbook template, and attach the runbook to its project and server.
- 02
Review and gate it
Read the version, run
checkagainst the target, and decide whether execution needs a second person’s approval. - 03
Run it and keep the record
Execute from the CLI. Who ran which version, who approved it, and how each step ended stay available for review.
Operational outcomes
Make the secure path the understandable path.
- Operational knowledge that does not leave with one engineer
- The procedure that runs is the one that was reviewed
- Four-eyes approval for production changes
- A record of every run, step by step
Common questions
Know where the boundary is.
- What is the difference between a runbook and a playbook?
- A runbook executes one specific procedure, step by step, with exact commands. A playbook coordinates the response to a situation - who decides, who communicates, and which runbooks to run.
- Can a runbook run on a remote server?
- Yes. A runbook runs either locally, on the machine running the CLI as you, or on a registered SSH target, where each step runs as
sudo -n -u <run-as> -- <step>and is held to the target’s allow-list of executables. - Does every run need approval?
- Only runbooks marked as requiring approval. For those, each execution is approved individually: approving one run does not approve the next.
- Can I roll back a change to a runbook?
- Yes. Restoring a previous version creates a new version equal to it, so the rollback itself appears in the history and nothing is deleted.
- Can a runbook use secrets?
- Steps can reference stored secrets and registered targets. They are brokered when the step runs and audited individually, so no plaintext credential is stored in the runbook.
- Are runbooks a replacement for Ansible or Terraform?
- No. Runbooks are focused operational procedures run through an approved, recorded workflow. They complement infrastructure-as-code and configuration management rather than replace them.
Read the implementation details
Documentation for this workflow
Related solutions
Connect the next part of the workflow
Start with one project and one access problem.
Create a workspace free, or tell us what your team needs to broker, approve, and review.