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.

Example

method: user_secondary_groups
params:
  force: 'true'
  groups: VALUE
  login: 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