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
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
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
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.group.html