GuidesModules
group.absent
Ensures a group does not exist on the system.
Source: pkg/state/modules/group.go
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No | State ID | Group 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
- Group lookup — looks up the group by name.
- If the group does not exist, the state reports no changes needed.
- If the group exists, the state needs changes.
Apply Behavior
- 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 tempgroupState 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"