zester
GuidesModules

group.absent

Ensures a group does not exist on the system.

Source: pkg/state/modules/group.go


Parameters

ParameterTypeRequiredDefaultDescription
namestringNoState IDGroup name to remove. If omitted, the state ID is used as the group name.

All states also accept the full set of requisite parameters and Salt-parity state attributes — see Dependencies & Requisites.


Check Behavior

  1. Group lookup — looks up the group by name.
  2. If the group does not exist, the state reports no changes needed.
  3. If the group exists, the state needs changes.

Apply Behavior

  1. Deletes the group via groupdel.

Revert Behavior

No-op. Group deletion cannot be reverted because the original group data (GID, members) is not preserved.


Examples

Direct Execution

# Remove a group
zester 'web-01' group.absent oldgroup

# Remove a group from all peels
zester '*' group.absent tempgroup

State File

Simple group removal:

oldgroup:
  group.absent: []

Remove group after removing users:

decommission_team:
  group.absent:
    - name: oldteam
    - require:
      - "user.absent:alice"
      - "user.absent:bob"

On this page