community.general.proxmox_tasks_info (8.5.0) — module

Retrieve information about one or more Proxmox VE tasks

| "added in version" 3.8.0 of community.general"

Authors: Andreas Botzner (@paginabianca) <andreas at botzner dot com>

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Retrieve information about one or more Proxmox VE tasks.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: List tasks on node01
  community.general.proxmox_tasks_info:
    api_host: proxmoxhost
    api_user: root@pam
    api_password: '{{ password | default(omit) }}'
    api_token_id: '{{ token_id | default(omit) }}'
    api_token_secret: '{{ token_secret | default(omit) }}'
    node: node01
  register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve information about specific tasks on node01
  community.general.proxmox_tasks_info:
    api_host: proxmoxhost
    api_user: root@pam
    api_password: '{{ password | default(omit) }}'
    api_token_id: '{{ token_id | default(omit) }}'
    api_token_secret: '{{ token_secret | default(omit) }}'
    task: 'UPID:node01:00003263:16167ACE:621EE230:srvreload:networking:root@pam:'
    node: node01
  register: proxmox_tasks

Inputs

    
node:
    description:
    - Node where to get tasks.
    required: true
    type: str

task:
    aliases:
    - upid
    - name
    description:
    - Return specific task.
    type: str

api_host:
    description:
    - Specify the target host of the Proxmox VE cluster.
    required: true
    type: str

api_user:
    description:
    - Specify the user to authenticate with.
    required: true
    type: str

api_password:
    description:
    - Specify the password to authenticate with.
    - You can use E(PROXMOX_PASSWORD) environment variable.
    type: str

api_token_id:
    description:
    - Specify the token ID.
    - Requires C(proxmoxer>=1.1.0) to work.
    type: str
    version_added: 1.3.0
    version_added_collection: community.general

validate_certs:
    default: false
    description:
    - If V(false), SSL certificates will not be validated.
    - This should only be used on personally controlled sites using self-signed certificates.
    type: bool

api_token_secret:
    description:
    - Specify the token secret.
    - Requires C(proxmoxer>=1.1.0) to work.
    type: str
    version_added: 1.3.0
    version_added_collection: community.general

Outputs

msg:
  description: Short message.
  returned: on failure
  sample: 'Task: UPID:xyz:xyz does not exist on node: proxmoxnode'
  type: str
proxmox_tasks:
  contains:
    endtime:
      description: Endtime of the task.
      returned: on success, can be absent
      type: int
    failed:
      description: If the task failed.
      returned: when status is defined
      type: bool
    id:
      description: ID of the task.
      returned: on success
      type: str
    node:
      description: Node name.
      returned: on success
      type: str
    pid:
      description: PID of the task.
      returned: on success
      type: int
    pstart:
      description: pastart of the task.
      returned: on success
      type: int
    starttime:
      description: Starting time of the task.
      returned: on success
      type: int
    status:
      description: Status of the task.
      returned: on success, can be absent
      type: str
    type:
      description: Type of the task.
      returned: on success
      type: str
    upid:
      description: UPID of the task.
      returned: on success
      type: str
    user:
      description: User that owns the task.
      returned: on success
      type: str
  description: List of tasks.
  elements: dict
  returned: on success
  type: list