Add Ansible keepawake role to hold workstations awake for remote dispatch #213

Closed
opened 2026-06-04 08:43:06 +00:00 by coilysiren · 0 comments
Owner

Add an Ansible keepawake role to the mac workstation baseline so remote dispatch keeps running after Kai walks away from the desk, whether or not the laptop is plugged in.

Behavior

A root LaunchDaemon (me.coilysiren.keepawake) ticks every 60s and reconciles pmset disablesleep:

  • Default: hold the system awake. Power-source-agnostic, so it survives battery and lid-closed (the only state disablesleep covers).
  • Maintenance window release (keepawake_maint_hour, default 03): released 03:00-03:59 local so the macOS / ansible software-update + reboot cycle runs clean, then re-asserts at 04:00.
  • Battery floor release (keepawake_floor_pct, default 30): on battery below the floor, allow sleep so an unattended pack can't drain to zero.

Display sleep is left untouched. Every flip logs to /var/log/keepawake.log with its reason. Optional keepawake_schedule_wake adds a pmset repeat wake just before the window (off by default - single global schedule).

Scope

  • roles/keepawake/ - defaults, tasks, handlers, manager-script + plist templates.
  • playbooks/freshen.yml - role wired in with become: true, tags [keepawake, power].
  • ansible/README.md - layout entry + section.

Runtime window logic lives in the manager script (deterministic, self-contained) rather than ansible toggling at 3am, so it works even when the box is unreachable.

Add an Ansible `keepawake` role to the `mac` workstation baseline so remote dispatch keeps running after Kai walks away from the desk, whether or not the laptop is plugged in. ## Behavior A root LaunchDaemon (`me.coilysiren.keepawake`) ticks every 60s and reconciles `pmset disablesleep`: - **Default:** hold the system awake. Power-source-agnostic, so it survives battery and lid-closed (the only state `disablesleep` covers). - **Maintenance window release** (`keepawake_maint_hour`, default `03`): released `03:00-03:59` local so the macOS / ansible software-update + reboot cycle runs clean, then re-asserts at `04:00`. - **Battery floor release** (`keepawake_floor_pct`, default 30): on battery below the floor, allow sleep so an unattended pack can't drain to zero. Display sleep is left untouched. Every flip logs to `/var/log/keepawake.log` with its reason. Optional `keepawake_schedule_wake` adds a `pmset repeat wake` just before the window (off by default - single global schedule). ## Scope - `roles/keepawake/` - defaults, tasks, handlers, manager-script + plist templates. - `playbooks/freshen.yml` - role wired in with `become: true`, tags `[keepawake, power]`. - `ansible/README.md` - layout entry + section. Runtime window logic lives in the manager script (deterministic, self-contained) rather than ansible toggling at 3am, so it works even when the box is unreachable.
Sign in to join this conversation.
No description provided.