user

Collection: builtin

Full Name: parallax.builtin.user

Aliases: ansible.builtin.user, user

Synopsis

Manage user

Parameters

NameTypeRequiredDefaultDescription
namestringyesName of the user to manage
statestringpresentWhether the account should exist or not
uidintOptionally sets the UID of the user
gidintOptionally sets the user’s primary group
groupstringOptionally sets the user’s primary group
groups[]string[]List of groups user should belong to
appendboolfalseIf true, add groups to user’s current groups
shellstringOptionally set the user’s shell
homestringOptionally set the user’s home directory
create_homebooltrueWhether to create the home directory
move_homeboolfalseIf set to true when used with home, will try to move the user’s old home directory
skeletonstringOptionally set a home skeleton directory
passwordstringOptionally set the user’s password to this crypted value
update_passwordstringon_createalways will update passwords if they differ
password_lockboolLock the password
expiresintAn expiry time for the user in epoch
commentstringOptionally sets the description of the user account
systemboolfalseWhen creating an account, make the user a system account
forceboolfalseWhen used with state=absent, behavior is as with userdel –force
removeboolfalseWhen used with state=absent, behavior is as with userdel –remove
login_classstringOptionally sets the user’s login class
generate_ssh_keyboolfalseWhether to generate a SSH key for the user
ssh_key_bitsint2048Optionally specify number of bits in SSH key to create
ssh_key_typestringrsaOptionally specify the type of SSH key to generate
ssh_key_filestringOptionally specify the SSH key filename
ssh_key_commentstringOptionally define the comment for the SSH key
ssh_key_passphrasestringSet a passphrase for the SSH key

Example

- name: Example user task
  user:
    name: <your_name>