The group module is used to create and manage group settings, groups can be
either present or absent. User/Group names can be passed to the adduser,
deluser, and members parameters. adduser and deluser can be used
together but not with members.
In Windows, if no domain is specified in the user or group name (i.e.
DOMAIN\username) the module will assume a local user or group.
cheese:
group.present:
- gid: 7648
- system: True
- addusers:
- user1
- users2
- delusers:
- foo
cheese:
group.present:
- gid: 7648
- system: True
- members:
- foo
- bar
- user1
- user2
salt.states.group.absent(name)¶Ensure that the named group is absent
| Parameters: | name (str) – The name of the group to remove |
|---|
Example:
# Removes the local group `db_admin`
db_admin:
group.absent
salt.states.group.present(name, gid=None, system=False, addusers=None, delusers=None, members=None)¶Ensure that a group is present
| Parameters: |
|
|---|
Example:
# Adds DOMAIN\db_admins and Administrators to the local db_admin group
# Removes Users
db_admin:
group.present:
- addusers:
- DOMAIN\db_admins
- Administrators
- delusers:
- Users
# Ensures only DOMAIN\domain_admins and the local Administrator are
# members of the local Administrators group. All other users are
# removed
Administrators:
group.present:
- members:
- DOMAIN\domain_admins
- Administrator
Docs for previous releases are available on readthedocs.org.
Latest Salt release: 2018.3.3