Software >> Automation >> Ansible >> Modules >> user >> Examples

 

user


Online help: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html
Offline help:

Syntax:

user:
  name[:|=] Name of the user account to create/modify/remove.
  password[:|=] This is to set the password of a user.
  comment[:|=] To set the GECOS/comment of a user
  append[:|=] To assign a user to a list of groups. Default is no, which means the new group’s list will overwrite the current group lists, which are assigned to the user.
  expires Expiry time in epoch format. This will be ignored in the unsupported platform.
  force[:|=] This is to force the deletion of the user, when used with state=absent.
  home[:|=] To set the user’s home directory
  group[:|=] The primary group of a user can be set by this.
  groups[:|=] Secondary groups can be set by this. If empty string like (‘ ‘) is mentioned then all secondary groups will be removed,
  remove[:|=] To remove user associated directories when used with state=absent.
  shell[:|=] To set the user’s working default shell.
  state[:|=] To specify whether the user should be present or absent.
  system[:|=] When setting to yes and state=present. This makes the user a system user.
  uid[:|=] To set the UID of the user.