system
Manages system-level settings that don’t fit the other stdlib modules — login banners (/etc/motd, /etc/issue, /etc/issue.net), marker-gated reboots, and the system locale. Each declaration performs exactly one operation, selected by which param is set. Idempotent: re-applying a converged declaration reports no change.
Category: System & core
States
| State | Meaning |
|---|---|
present | The banner has the declared content, the locale equals locale, or (for reboot) a reboot is scheduled when the marker indicates one is needed. |
absent | The banner file is emptied. Valid for the banner op only — reboot and locale reject absent. |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
banner | string | Banner to manage: motd, issue, or issue_net. Selects the banner op. | |
content | string | yes | Banner contents (required with banner; use "" for an empty file). Banner op only. |
reboot | bool | Set true to select the reboot op (schedules a reboot only when the marker indicates one is needed). false is rejected. | |
when_file | string | Reboot marker file checked before scheduling. Reboot op only. Default: /var/run/reboot-required. | |
delay | int | Minutes before the scheduled reboot (0–60; 0 reboots now). Reboot op only. Default: 1. | |
locale | string | POSIX locale identifier (e.g. en_US.UTF-8). Selects the locale op. |
Examples
Set the login banner
system:
login-motd:
state: present
banner: motd
content: |
Authorized access only.
All activity is logged.Reboot when a kernel update flags one
Schedules a reboot only when the marker file is present; otherwise no-op.
system:
apply-pending-reboot:
state: present
reboot: true
delay: 5
when_file: /var/run/reboot-requiredSet the system locale
system:
system-locale:
state: present
locale: en_US.UTF-8Notes
- Behaviour is distribution-agnostic; Linux has the full provider, other operating systems get a reduced one.
- Exactly one of
banner/reboot/localemust be set per declaration. rebootis marker-gated: thewhen_filemarker is checked first, then a host reboot-hint tool (needs-restarting -ron RHEL/Rocky/Fedora); hosts with neither (e.g. Alpine) rely on the marker alone.rebootandlocalesupportstate: presentonly;absentapplies tobanner(empties the file).- Out of scope (planned, #22): reboot disconnect-tolerance, Arch reboot-hint detection, Debian’s
/etc/default/localedual-file, per-LC_*overrides, andabsentsemantics for reboot/locale.