user — the users database

The user check examines the local passwd database, and asserts that users exist, have certain properties, or are missing.

Examples

Check that a user exists:

[[user]]
user = 'bethany'

Check that a user exists, has a specific login shell, and is a member of several groups:

[[user]]
user = 'bethany'
login_shell = '/usr/local/bin/fish'
groups = [ 'adm', 'storage' ]

Check that a user does not exist:

[[user]]
user = 'bethany'
state = 'missing'

List of parameters

parameterstructuredescription
usernumber, or stringID or name of a user on the local machine.
statestringState of this user. This can be 'present' or 'missing'.
login_shellstringThis user’s login shell, as a path.
groupsarray of stringsGroups this user should be in, as an array of group names.