maxhoesel.proxmox.pbs_token module – Manage user tokens on a Proxmox Backup Server

Note

This module is part of the maxhoesel.proxmox collection (version 5.1.1).

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 maxhoesel.proxmox. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: maxhoesel.proxmox.pbs_token.

New in maxhoesel.proxmox 4.0.0

Synopsis

  • Create, update and delete user API tokens on a Proxmox backup Server instance.

Requirements

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

  • proxmoxer >=1.2

  • 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 also use the PROXMOX_PASSWORD environment variable.

api_user

string / required

Specify the user to authenticate with.

comment

string

Comment for the token

enabled

boolean

Whether to enable the token. false means disabled.

Choices:

  • false

  • true

expire

integer

Token expiration data (seconds since UNIX epoch). 0 means no expiration date

name

aliases: token_name

string / required

Name of the token that will be part of the authid. Example: token1 results in the authid user@pbs!token1

state

string

present makes sure the user exists, absent makes sure the user is removed.

Choices:

  • "present" ← (default)

  • "absent"

userid

string / required

User that the token will be created for. Must be in user@realm format (e.g. john@pbs)

validate_certs

boolean

Validate SSL certificate of the PVE host upon connecting

Choices:

  • false ← (default)

  • true

Notes

Note

  • Check mode is supported.

Examples

- name: Create an API token for a user
  maxhoesel.proxmox.pbs_token:
    api_user: root@pam
    api_password: secret
    api_host: helldorado
    name: mytoken
    userid: john@pbs

Return Values

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

Key

Description

secret

string

API Token secret

Returned: When the token is created

tokenid

string

API Token identifier

Returned: always

Authors

  • Max Hösel (@maxhoesel)