user
Collection: builtin
Full Name: parallax.builtin.user
Aliases: ansible.builtin.user, user
Synopsis
Manage user
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | yes | Name of the user to manage | |
| state | string | present | Whether the account should exist or not | |
| uid | int | Optionally sets the UID of the user | ||
| gid | int | Optionally sets the user’s primary group | ||
| group | string | Optionally sets the user’s primary group | ||
| groups | []string | [] | List of groups user should belong to | |
| append | bool | false | If true, add groups to user’s current groups | |
| shell | string | Optionally set the user’s shell | ||
| home | string | Optionally set the user’s home directory | ||
| create_home | bool | true | Whether to create the home directory | |
| move_home | bool | false | If set to true when used with home, will try to move the user’s old home directory | |
| skeleton | string | Optionally set a home skeleton directory | ||
| password | string | Optionally set the user’s password to this crypted value | ||
| update_password | string | on_create | always will update passwords if they differ | |
| password_lock | bool | Lock the password | ||
| expires | int | An expiry time for the user in epoch | ||
| comment | string | Optionally sets the description of the user account | ||
| system | bool | false | When creating an account, make the user a system account | |
| force | bool | false | When used with state=absent, behavior is as with userdel –force | |
| remove | bool | false | When used with state=absent, behavior is as with userdel –remove | |
| login_class | string | Optionally sets the user’s login class | ||
| generate_ssh_key | bool | false | Whether to generate a SSH key for the user | |
| ssh_key_bits | int | 2048 | Optionally specify number of bits in SSH key to create | |
| ssh_key_type | string | rsa | Optionally specify the type of SSH key to generate | |
| ssh_key_file | string | Optionally specify the SSH key filename | ||
| ssh_key_comment | string | Optionally define the comment for the SSH key | ||
| ssh_key_passphrase | string | Set a passphrase for the SSH key |
Example
- name: Example user task
user:
name: <your_name>