grlx.ingredients.user
The user ingredient handles user operations on sprouts.
user.absent
Removes a user if it exists
Parameters
parameter | type | required | description |
---|---|---|---|
name | string | yes | the name of the user to be removed |
user.absent:
- name: supersprout
user.exists
Validates if a user exists
Parameters
parameter | type | required | description |
---|---|---|---|
name | string | yes | The username to check |
user.exists:
- name: sproutuser
user.present
Creates a new user if it does not exist
Parameters
parameter | type | required | description |
---|---|---|---|
name | string | yes | The username of the user |
uid | string | no | The UID assigned to the user |
gid | string | no | The GID to the user |
groups | list, string | no | A list groups the user is part of |
shell | string | no | The user login shell, /bin/false by default |
home | string | no | The path to the user’s home directory if one is required |
user.present:
- name: sproutuser
- uid: "1003"
- gid: "1003"
- groups:
- wheel
- media
- sudo
- shell: /bin/bash
- home: /var/sproutuser