maxhoesel.proxmox.pbs_user module – Manage users 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_user.

New in maxhoesel.proxmox 4.0.0

Synopsis

  • Create, update and delete user accounts 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

User account comment

email

string

E-Mail Address of the user

enabled

boolean

Whether to enable the account. false means disabled.

Choices:

  • false

  • true

expire

integer

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

firstname

string

User First Name

lastname

string

User Last Name

password

string

Password for the user. Note that this module does not update the password by default! To force this behavior (this also causes the module to always return as changed), set password_update to True

password_update

aliases: update_password

boolean

Whether to force update the password of an existing user

Choices:

  • false ← (default)

  • true

state

string

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

Choices:

  • "present" ← (default)

  • "absent"

userid

aliases: name, id

string / required

User ID, in the format user@realm. Example: john@pbs

validate_certs

boolean

Validate SSL certificate of the PVE host upon connecting

Choices:

  • false ← (default)

  • true

Notes

Note

  • Check mode is supported.

  • Only PBS-Native users are currently supported (i.e. the @pbs realm)

Examples

- name: Ensure that the user john@pbs exists
  maxhoesel.proxmox.pbs_user:
    api_user: root@pam
    api_password: secret
    api_host: helldorado
    userid: john@pbs
    firstname: John
    lastname: Smith
    password: johnsverysecretpassword
    email: john@example.org
    state: present

- name: Ensure that the user john@smith does not exist
  maxhoesel.proxmox.pbs_user:
    api_user: root@pam
    api_password: secret
    api_host: helldorado
    userid: john@pbs
    state: absent

Authors

  • Max Hösel (@maxhoesel)