user_secondary_groups
Define secondary groups for a user.
⚙️ Compatible targets: Linux
Parameters
Name | Documentation |
---|---|
login | User login. This parameter is required. |
groups | Comma separated secondary groups name. This parameter is required. |
force | Remove user from non-listed groups, "true" or "false" (defaults to "false"). Choices:
This parameter is optional. |
Outcome conditions
You need to replace ${login}
with its actual canonified value.
- ✅ Ok:
user_secondary_groups_${login}_ok
- ☑️ Already compliant:
user_secondary_groups_${login}_kept
- 🟨 Repaired:
user_secondary_groups_${login}_repaired
- ☑️ Already compliant:
- ❌ Error:
user_secondary_groups_${login}_error
Example
method: user_secondary_groups
params:
groups: VALUE
login: VALUE
force: 'true'
Documentation
Make sure that a user belong to the listed groups
Behavior
Ensure that the user belongs in the given secondary group, if force
is set,
the user will be force to only be part of the listed groups
.
Examples
-name: bob must be in the printers group
method: user_secondary_groups
params:
login: bob
groups: printers
force: false
-name: jenkins must only be part of jenkins and docker
method: user_secondary_groups
params:
login: jenkins
groups: jenkins,docker
force: true