Skip to content

user

!user

Category: access

Manage a Linux user account via useradd/usermod/userdel. Linux-only.

Parameters

NameTypeRequiredDescription
userstringyesUsername to manage.
uidintnoDesired numeric UID.
systemboolnoCreate a system user (useradd -r), only when no uid given.
gidstringnoPrimary group name or GID.
groupslistnoSupplementary group names; compared against id -Gn.
appendboolnoWhen modifying groups, add to existing rather than replacing.
create_homeboolnoCreate the home directory (-m vs -M). Default true.
create_user_groupboolnoCreate a group with the same name as the user (-U vs -N). Default true.
gecosstringnoGECOS/comment field (-c).
shellstringnoLogin shell (-s).
removeboolnoRemove the user instead of creating.
cleanupboolnoWhen removing, also delete the home directory (userdel -r).

Examples

- !user
  user: deploy
  uid: 2000
  groups:
    - www-data
    - docker
  append: true
  shell: /bin/bash