user_secondary_groups

Define secondary groups for a user.

⚙️ Compatible targets: Linux

Parameters

NameDocumentation
loginUser login.

This parameter is required.
groupsComma separated secondary groups name.

This parameter is required.
forceRemove user from non-listed groups, "true" or "false" (defaults to "false").

Choices:
  • true
  • false

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
  • ❌ Error: user_secondary_groups_${login}_error

Example

method: user_secondary_groups
params:
  login: VALUE
  force: 'true'
  groups: VALUE

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