arillso.system.users role – Cross-platform user management
Note
This role is part of the arillso.system collection (version 0.0.36).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it use: ansible-galaxy collection install arillso.system
.
To use it in a playbook, specify: arillso.system.users
.
Entry point create_user_linux
– Linux user management
Synopsis
This role manages Linux users, their home directories, SSH keys,
and file permissions based on OS-specific variables.
Parameters
Parameter |
Comments |
---|---|
A list of users with their properties to be ensured on the system. |
|
If true, additional groups are appended to the existing group list instead of replacing it. Choices:
|
|
The comment or full name for the user account. Optional, but recommended for clarity. |
|
Determines if the home directory should be created if it does not exist. Default is true. Choices:
|
|
Account expiration time as an epoch timestamp. Optional. |
|
Forces certain actions, such as overwriting an existing SSH key or removing an account. Choices:
|
|
Primary group for the user. Optional, system default is used if not specified. |
|
List of additional groups the user will be added to. Optional. |
|
Home directory to create or manage. Optional if system default is used. |
|
Use local commands for user management. Optional. Choices:
|
|
Specifies the login class for the user (primarily BSD-specific). Optional. |
|
Moves the user’s home directory if it already exists. Optional. Choices:
|
|
Password for the user, optionally hashed. Recommended for security. |
|
Number of days after which the account is disabled once the password expires. Optional. |
|
Maximum number of days between password changes (Linux only). Optional. |
|
Minimum number of days between password changes (Linux only). Optional. |
|
Number of warning days before the password expires (Linux only). Optional. |
|
Specifies whether the password is locked. Optional. Choices:
|
|
Defines the user’s profile (primarily Solaris-specific). Optional. |
|
Removes the user and associated directories (only with state=absent). Optional. Choices:
|
|
Specifies the role of the user (primarily Solaris-specific). Optional. |
|
Sets the SELinux user type (only relevant on SELinux-enabled systems). Optional. |
|
The shell assigned to the user. Optional, defaults to system standard. |
|
Specifies a skeleton directory for the home directory. Requires create_home. Optional. |
|
Number of bits for the generated SSH key. Optional, default depends on ssh-keygen. |
|
Comment to be added to the generated SSH key. Optional. |
|
Path to the SSH key file (relative to the home directory). |
|
Indicates whether to generate SSH keys for the user. Default is false. Choices:
|
|
Passphrase for the generated SSH key. Optional. |
|
Specifies if the user is a system account. Default is false. Choices:
|
|
The numeric user id for the user. Optional for system-generated IDs. |
|
Maximum allowed UID value (Linux-specific). Optional. |
|
Minimum allowed UID value (Linux-specific). Optional. |
|
Sets the umask for the user (Linux only). Optional. |
|
Determines whether to update the password if it differs from the current one. Optional. |
|
The username of the account. |
Entry point create_user_windows
– Windows user management
Synopsis
This section manages Windows user accounts, setting properties,
managing group memberships, and editing registry settings for user configurations.
Parameters
Parameter |
Comments |
---|---|
A list of users with their properties to be ensured on the system. |
|
If true, additional groups are appended to the existing group list instead of replacing it. Choices:
|
|
The comment or full name for the user account. Optional, but recommended for clarity. |
|
Determines if the home directory should be created if it does not exist. Default is true. Choices:
|
|
Account expiration time as an epoch timestamp. Optional. |
|
Forces certain actions, such as overwriting an existing SSH key or removing an account. Choices:
|
|
Primary group for the user. Optional, system default is used if not specified. |
|
List of additional groups the user will be added to. Optional. |
|
Home directory to create or manage. Optional if system default is used. |
|
Use local commands for user management. Optional. Choices:
|
|
Specifies the login class for the user (primarily BSD-specific). Optional. |
|
Moves the user’s home directory if it already exists. Optional. Choices:
|
|
Password for the user, optionally hashed. Recommended for security. |
|
Number of days after which the account is disabled once the password expires. Optional. |
|
Maximum number of days between password changes (Linux only). Optional. |
|
Minimum number of days between password changes (Linux only). Optional. |
|
Number of warning days before the password expires (Linux only). Optional. |
|
Specifies whether the password is locked. Optional. Choices:
|
|
Defines the user’s profile (primarily Solaris-specific). Optional. |
|
Removes the user and associated directories (only with state=absent). Optional. Choices:
|
|
Specifies the role of the user (primarily Solaris-specific). Optional. |
|
Sets the SELinux user type (only relevant on SELinux-enabled systems). Optional. |
|
The shell assigned to the user. Optional, defaults to system standard. |
|
Specifies a skeleton directory for the home directory. Requires create_home. Optional. |
|
Number of bits for the generated SSH key. Optional, default depends on ssh-keygen. |
|
Comment to be added to the generated SSH key. Optional. |
|
Path to the SSH key file (relative to the home directory). |
|
Indicates whether to generate SSH keys for the user. Default is false. Choices:
|
|
Passphrase for the generated SSH key. Optional. |
|
Specifies if the user is a system account. Default is false. Choices:
|
|
The numeric user id for the user. Optional for system-generated IDs. |
|
Maximum allowed UID value (Linux-specific). Optional. |
|
Minimum allowed UID value (Linux-specific). Optional. |
|
Sets the umask for the user (Linux only). Optional. |
|
Determines whether to update the password if it differs from the current one. Optional. |
|
The username of the account. |
Entry point main
– Cross-platform user management
Synopsis
This role manages user accounts on both Linux and Windows systems.
It applies OS-specific configurations and handles user attributes,
such as home directories, SSH keys, and permissions.
Parameters
Parameter |
Comments |
---|---|
Whether to exclusively manage the ‘authorized_keys’ file. Default is ‘no’. Default: |
|
Default primary group for users. Not set by default. |
|
A list of users with their properties to be ensured on the system. |
|
If true, additional groups are appended to the existing group list instead of replacing it. Choices:
|
|
The comment or full name for the user account. Optional, but recommended for clarity. |
|
Determines if the home directory should be created if it does not exist. Default is true. Choices:
|
|
Account expiration time as an epoch timestamp. Optional. |
|
Forces certain actions, such as overwriting an existing SSH key or removing an account. Choices:
|
|
Primary group for the user. Optional, system default is used if not specified. |
|
List of additional groups the user will be added to. Optional. |
|
Home directory to create or manage. Optional if system default is used. |
|
Use local commands for user management. Optional. Choices:
|
|
Specifies the login class for the user (primarily BSD-specific). Optional. |
|
Moves the user’s home directory if it already exists. Optional. Choices:
|
|
Password for the user, optionally hashed. Recommended for security. |
|
Number of days after which the account is disabled once the password expires. Optional. |
|
Maximum number of days between password changes (Linux only). Optional. |
|
Minimum number of days between password changes (Linux only). Optional. |
|
Number of warning days before the password expires (Linux only). Optional. |
|
Specifies whether the password is locked. Optional. Choices:
|
|
Defines the user’s profile (primarily Solaris-specific). Optional. |
|
Removes the user and associated directories (only with state=absent). Optional. Choices:
|
|
Specifies the role of the user (primarily Solaris-specific). Optional. |
|
Sets the SELinux user type (only relevant on SELinux-enabled systems). Optional. |
|
The shell assigned to the user. Optional, defaults to system standard. |
|
Specifies a skeleton directory for the home directory. Requires create_home. Optional. |
|
Number of bits for the generated SSH key. Optional, default depends on ssh-keygen. |
|
Comment to be added to the generated SSH key. Optional. |
|
Path to the SSH key file (relative to the home directory). |
|
Indicates whether to generate SSH keys for the user. Default is false. Choices:
|
|
Passphrase for the generated SSH key. Optional. |
|
Specifies if the user is a system account. Default is false. Choices:
|
|
The numeric user id for the user. Optional for system-generated IDs. |
|
Maximum allowed UID value (Linux-specific). Optional. |
|
Minimum allowed UID value (Linux-specific). Optional. |
|
Sets the umask for the user (Linux only). Optional. |
|
Determines whether to update the password if it differs from the current one. Optional. |
|
The username of the account. |
|
List of default secondary groups for users. Defaults to an empty list. Default: |
|
Default home directory path for users. Default is ‘/home’. Default: |
|
Default permissions for users’ home directories. Default is ‘0755’. Default: |
|
A list of users with their properties to be ensured on the system. |
|
If true, additional groups are appended to the existing group list instead of replacing it. Choices:
|
|
The comment or full name for the user account. Optional, but recommended for clarity. |
|
Determines if the home directory should be created if it does not exist. Default is true. Choices:
|
|
Account expiration time as an epoch timestamp. Optional. |
|
Forces certain actions, such as overwriting an existing SSH key or removing an account. Choices:
|
|
Primary group for the user. Optional, system default is used if not specified. |
|
List of additional groups the user will be added to. Optional. |
|
Home directory to create or manage. Optional if system default is used. |
|
Use local commands for user management. Optional. Choices:
|
|
Specifies the login class for the user (primarily BSD-specific). Optional. |
|
Moves the user’s home directory if it already exists. Optional. Choices:
|
|
Password for the user, optionally hashed. Recommended for security. |
|
Number of days after which the account is disabled once the password expires. Optional. |
|
Maximum number of days between password changes (Linux only). Optional. |
|
Minimum number of days between password changes (Linux only). Optional. |
|
Number of warning days before the password expires (Linux only). Optional. |
|
Specifies whether the password is locked. Optional. Choices:
|
|
Defines the user’s profile (primarily Solaris-specific). Optional. |
|
Removes the user and associated directories (only with state=absent). Optional. Choices:
|
|
Specifies the role of the user (primarily Solaris-specific). Optional. |
|
Sets the SELinux user type (only relevant on SELinux-enabled systems). Optional. |
|
The shell assigned to the user. Optional, defaults to system standard. |
|
Specifies a skeleton directory for the home directory. Requires create_home. Optional. |
|
Number of bits for the generated SSH key. Optional, default depends on ssh-keygen. |
|
Comment to be added to the generated SSH key. Optional. |
|
Path to the SSH key file (relative to the home directory). |
|
Indicates whether to generate SSH keys for the user. Default is false. Choices:
|
|
Passphrase for the generated SSH key. Optional. |
|
Specifies if the user is a system account. Default is false. Choices:
|
|
The numeric user id for the user. Optional for system-generated IDs. |
|
Maximum allowed UID value (Linux-specific). Optional. |
|
Minimum allowed UID value (Linux-specific). Optional. |
|
Sets the umask for the user (Linux only). Optional. |
|
Determines whether to update the password if it differs from the current one. Optional. |
|
The username of the account. |
|
A list of users with their properties to be ensured on the system. |
|
If true, additional groups are appended to the existing group list instead of replacing it. Choices:
|
|
The comment or full name for the user account. Optional, but recommended for clarity. |
|
Determines if the home directory should be created if it does not exist. Default is true. Choices:
|
|
Account expiration time as an epoch timestamp. Optional. |
|
Forces certain actions, such as overwriting an existing SSH key or removing an account. Choices:
|
|
Primary group for the user. Optional, system default is used if not specified. |
|
List of additional groups the user will be added to. Optional. |
|
Home directory to create or manage. Optional if system default is used. |
|
Use local commands for user management. Optional. Choices:
|
|
Specifies the login class for the user (primarily BSD-specific). Optional. |
|
Moves the user’s home directory if it already exists. Optional. Choices:
|
|
Password for the user, optionally hashed. Recommended for security. |
|
Number of days after which the account is disabled once the password expires. Optional. |
|
Maximum number of days between password changes (Linux only). Optional. |
|
Minimum number of days between password changes (Linux only). Optional. |
|
Number of warning days before the password expires (Linux only). Optional. |
|
Specifies whether the password is locked. Optional. Choices:
|
|
Defines the user’s profile (primarily Solaris-specific). Optional. |
|
Removes the user and associated directories (only with state=absent). Optional. Choices:
|
|
Specifies the role of the user (primarily Solaris-specific). Optional. |
|
Sets the SELinux user type (only relevant on SELinux-enabled systems). Optional. |
|
The shell assigned to the user. Optional, defaults to system standard. |
|
Specifies a skeleton directory for the home directory. Requires create_home. Optional. |
|
Number of bits for the generated SSH key. Optional, default depends on ssh-keygen. |
|
Comment to be added to the generated SSH key. Optional. |
|
Path to the SSH key file (relative to the home directory). |
|
Indicates whether to generate SSH keys for the user. Default is false. Choices:
|
|
Passphrase for the generated SSH key. Optional. |
|
Specifies if the user is a system account. Default is false. Choices:
|
|
The numeric user id for the user. Optional for system-generated IDs. |
|
Maximum allowed UID value (Linux-specific). Optional. |
|
Minimum allowed UID value (Linux-specific). Optional. |
|
Sets the umask for the user (Linux only). Optional. |
|
Determines whether to update the password if it differs from the current one. Optional. |
|
The username of the account. |
|
Default SSH key bit length for users. Default is 2048. Default: |
|
Default SSH key type for users. Default is ‘rsa’. Default: |