julien_lecomte.proxmox.token (1.0.2) — module

Adds, modifies, or removes a Proxmox user token.

Authors: Julien Lecomte (julien@lecomte.at)

Install collection

Install with ansible-galaxy collection install julien_lecomte.proxmox:==1.0.2


Add to requirements.yml

  collections:
    - name: julien_lecomte.proxmox
      version: 1.0.2

Description

Adds, modifies, or removes a Proxmox user token.

Returned values will exist in a variable named 'token'.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create token 'example'
  julien_lecomte.proxmox.token:
    name: 'example'
    user: 'user01'

Inputs

    
name:
    description:
    - The token name.
    required: true
    type: str

user:
    description:
    - 'The user name with realm (eg: user@pam).'
    required: true
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Specify if the token should exist (present) or absent.
    type: str

expire:
    description:
    - Account expiration date (seconds since epoch). 0 means no expiration date (default
      on creation).
    type: int

comment:
    description:
    - Optionally sets the comment field.
    type: str

privsep:
    description:
    - Restrict API token privileges with separate ACLs (default), or give full privileges
      of corresponding user.
    type: bool

Outputs

comment:
  description: Comment field.
  returned: when token exists
  type: str
expire:
  description: Token expiration date (seconds since epoch). 0 means no expiration
    date.
  returned: when token exists
  type: int
name:
  description: Proxmox token id.
  returned: always
  type: str
privsep:
  description: Whether API token privileges are separated or not.
  returned: when token exists
  type: bool
state:
  description: State ("absent" or "present").
  returned: always
  type: str
value:
  description: API token value
  returned: only on token creation
  type: str

See also