community.general.proxmox_user_info – Retrieve information about one or more Proxmox VE users
Note
This plugin is part of the community.general collection (version 2.0.1).
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 | Choices/Defaults | 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 string | Restrict results to a specific authentication realm. aliases: realm | |
| user string | Restrict results to a specific user. aliases: name | |
| 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. |
Examples
- name: List existing users
community.general.proxmox_user_info:
api_host: helldorado
api_user: root@pam
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: root@pam
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 admin@pve
community.general.proxmox_user_info:
api_host: helldorado
api_user: root@pam
api_password: "{{ password | default(omit) }}"
api_token_id: "{{ token_id | default(omit) }}"
api_token_secret: "{{ token_secret | default(omit) }}"
userid: admin@pve
register: proxmox_user_admin
- name: Alternative way to retrieve information about admin@pve
community.general.proxmox_user_info:
api_host: helldorado
api_user: root@pam
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 | Returned | Description | ||
|---|---|---|---|---|
| proxmox_users list / elements=dictionary | always, but can be empty | List of users. | ||
| comment string | on success | Short description of the user. | ||
| domain string | on success | User's authentication realm, also the right part of the user ID. | ||
| email string | on success | User's email address. | ||
| enabled boolean | on success | User's account state. | ||
| expire integer | on success | Expiration date in seconds since EPOCH. Zero means no expiration. | ||
| firstname string | on success | User's first name. | ||
| groups list / elements=string | on success | List of groups which the user is a member of. | ||
| keys string | on success | User's two factor authentication keys. | ||
| lastname string | on success | User's last name. | ||
| tokens list / elements=dictionary | on success | List of API tokens associated to the user. | ||
| comment string | on success | Short description of the token. | ||
| expire integer | on success | Expiration date in seconds since EPOCH. Zero means no expiration. | ||
| privsep boolean | on success | Describe if the API token is further restricted with ACLs or is fully privileged. | ||
| tokenid string | on success | Token name. | ||
| user string | on success | User's login name, also the left part of the user ID. | ||
| userid string | on success | Proxmox user ID, represented as user@realm. | ||
Authors
- Tristan Le Guern (@Aversiste)
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/community/general/proxmox_user_info_module.html