Restart a server after its updates, and check that it came back

An update run can name a second Semaphore playbook that restarts the server
once the updates are in and it says a restart is due. The run keeps the
maintenance window up, follows the restart, waits for the server to report
again and checks from its uptime (or its restart flag clearing) that it did
start again. A server that only needs a restart has a Restart button on the
Updates page, and a patch plan can carry the restart playbook too.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-10 23:45:52 +01:00
1 parent 97df28c6dc
commit e4f3a54189
19 files changed
+10275 -87

No files matched your search

+7 -1
View File
@@ -655,6 +655,7 @@ Updates on a schedule, one server at a time (services/patchPlans.ts). A plan onl
| `limit_from` | text NOT NULL, default `name` | What ansible's `--limit` is for each server: its name here, or its host name. |
| `stop_on_failure`, `only_with_updates`, `silence_dependents` | bool NOT NULL, default true | Stop at the first failure; leave out a server with nothing waiting; silence what depends on a server while it is updated. |
| `window_minutes` | integer NOT NULL, default 90 | The longest a server is under maintenance. |
| `restart_project_id`, `restart_template_id`, `restart_template_name` | integer, integer, text | A second Semaphore playbook (same integration) that restarts a server that says a restart is due after its updates — and one that only needs a restart; all null = none. |
| `last_run_date` | text | The local day it last started on, so it starts once a day even across a restart. |
| `created_by`, `created_at` | | |
@@ -700,7 +701,12 @@ A playbook run in Semaphore for one server, wrapped in a maintenance window and
| `template_name`, `host_limit` | text NOT NULL | The template's name and ansible's `--limit` it was run with (never empty: an update run is for one server). |
| `task_id`, `task_status` | integer, text | Semaphore's run number and its own word for how it is going. |
| `window_id`, `window_created` | integer, bool | The maintenance window put round it, and whether this run made it (a window that was already there is extended and left to run out). |
| `status` | text NOT NULL | `running`, `waiting_for_host`, `done`, `failed` or `cancelled`. |
| `status` | text NOT NULL | `running`, `waiting_for_host`, `restarting`, `waiting_for_restart`, `done`, `failed` or `cancelled` (the first four are "under way"). |
| `kind` | text NOT NULL, default `update` | `update`, or `restart` (the template is a restart playbook and nothing else is done). |
| `restart_project_id`, `restart_template_id`, `restart_template_name` | integer, integer, text | The playbook that restarts the server once the updates are in, if one was chosen. |
| `restart_task_id`, `restart_task_status` | integer, text | Semaphore's run number for the restart, and its word for how it is going. |
| `restart_started_at`, `restart_ended_at` | text | ISO — when the restart playbook was started and when it finished. |
| `restarted` | bool NOT NULL, default 0 | The server was seen to have started again (from its reported uptime, or its restart flag clearing). |
| `message` | text | What it says now, in words. |
| `started_by` | text | |
| `started_at`, `task_ended_at`, `host_reported_at`, `finished_at` | text | ISO. |