Skip to content

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

StateMeaning
presentThe banner has the declared content, the locale equals locale, or (for reboot) a reboot is scheduled when the marker indicates one is needed.
absentThe banner file is emptied. Valid for the banner op only — reboot and locale reject absent.

Parameters

ParameterTypeRequiredDescription
bannerstringBanner to manage: motd, issue, or issue_net. Selects the banner op.
contentstringyesBanner contents (required with banner; use "" for an empty file). Banner op only.
rebootboolSet true to select the reboot op (schedules a reboot only when the marker indicates one is needed). false is rejected.
when_filestringReboot marker file checked before scheduling. Reboot op only. Default: /var/run/reboot-required.
delayintMinutes before the scheduled reboot (0–60; 0 reboots now). Reboot op only. Default: 1.
localestringPOSIX 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-required

Set the system locale

system:
  system-locale:
    state: present
    locale: en_US.UTF-8

Notes

  • Behaviour is distribution-agnostic; Linux has the full provider, other operating systems get a reduced one.
  • Exactly one of banner / reboot / locale must be set per declaration.
  • reboot is marker-gated: the when_file marker is checked first, then a host reboot-hint tool (needs-restarting -r on RHEL/Rocky/Fedora); hosts with neither (e.g. Alpine) rely on the marker alone.
  • reboot and locale support state: present only; absent applies to banner (empties the file).
  • Out of scope (planned, #22): reboot disconnect-tolerance, Arch reboot-hint detection, Debian’s /etc/default/locale dual-file, per-LC_* overrides, and absent semantics for reboot/locale.