community.general.proxmox_user_info module – Retrieve information about one or more Proxmox VE users

Note

This module is part of the community.general collection (version 5.4.0).

You might already have this collection installed if you are using the ansible package. 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 community.general.

To use it in a playbook, specify: community.general.proxmox_user_info.

New in version 1.3.0: of community.general

Synopsis

  • Retrieve information about one or more Proxmox VE users

Requirements

The below requirements are needed on the host that executes this module.

  • proxmoxer

  • requests

Parameters

Parameter

Comments

api_host

string / required

Specify the target host of the Proxmox VE cluster.

api_password

string

Specify the password to authenticate with.

You can use PROXMOX_PASSWORD environment variable.

api_token_id

string

added in 1.3.0 of community.general

Specify the token ID.

api_token_secret

string

added in 1.3.0 of community.general

Specify the token secret.

api_user

string / required

Specify the user to authenticate with.

domain

aliases: realm

string

Restrict results to a specific authentication realm.

user

aliases: name

string

Restrict results to a specific user.

userid

string

Restrict results to a specific user ID, which is a concatenation of a user and domain parts.

validate_certs

boolean

If no, SSL certificates will not be validated.

This should only be used on personally controlled sites using self-signed certificates.

Choices:

  • no ← (default)

  • yes

Examples

- name: List existing users
  community.general.proxmox_user_info:
    api_host: helldorado
    api_user: [email protected]
    api_password: "{{ password | default(omit) }}"
    api_token_id: "{{ token_id | default(omit) }}"
    api_token_secret: "{{ token_secret | default(omit) }}"
  register: proxmox_users

- name: List existing users in the pve authentication realm
  community.general.proxmox_user_info:
    api_host: helldorado
    api_user: [email protected]
    api_password: "{{ password | default(omit) }}"
    api_token_id: "{{ token_id | default(omit) }}"
    api_token_secret: "{{ token_secret | default(omit) }}"
    domain: pve
  register: proxmox_users_pve

- name: Retrieve information about [email protected]
  community.general.proxmox_user_info:
    api_host: helldorado
    api_user: [email protected]
    api_password: "{{ password | default(omit) }}"
    api_token_id: "{{ token_id | default(omit) }}"
    api_token_secret: "{{ token_secret | default(omit) }}"
    userid: [email protected]
  register: proxmox_user_admin

- name: Alternative way to retrieve information about [email protected]
  community.general.proxmox_user_info:
    api_host: helldorado
    api_user: [email protected]
    api_password: "{{ password | default(omit) }}"
    api_token_id: "{{ token_id | default(omit) }}"
    api_token_secret: "{{ token_secret | default(omit) }}"
    user: admin
    domain: pve
  register: proxmox_user_admin

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

proxmox_users

list / elements=dictionary

List of users.

Returned: always, but can be empty

comment

string

Short description of the user.

Returned: on success

domain

string

User’s authentication realm, also the right part of the user ID.

Returned: on success

email

string

User’s email address.

Returned: on success

enabled

boolean

User’s account state.

Returned: on success

expire

integer

Expiration date in seconds since EPOCH. Zero means no expiration.

Returned: on success

firstname

string

User’s first name.

Returned: on success

groups

list / elements=string

List of groups which the user is a member of.

Returned: on success

keys

string

User’s two factor authentication keys.

Returned: on success

lastname

string

User’s last name.

Returned: on success

tokens

list / elements=dictionary

List of API tokens associated to the user.

Returned: on success

comment

string

Short description of the token.

Returned: on success

expire

integer

Expiration date in seconds since EPOCH. Zero means no expiration.

Returned: on success

privsep

boolean

Describe if the API token is further restricted with ACLs or is fully privileged.

Returned: on success

tokenid

string

Token name.

Returned: on success

user

string

User’s login name, also the left part of the user ID.

Returned: on success

userid

string

Proxmox user ID, represented as user@realm.

Returned: on success

Authors

  • Tristan Le Guern (@tleguern)