community.general.proxmox_backup_info module – Retrieve information on Proxmox scheduled backups

Note

This module is part of the community.general collection (version 10.4.0).

You might already have this collection installed if you are using the ansible package. 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 community.general. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: community.general.proxmox_backup_info.

New in community.general 10.3.0

Synopsis

  • Retrieve information such as backup times, VM name, VM ID, mode, backup type, and backup schedule using the Proxmox Server API.

Requirements

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

  • proxmoxer

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

api_port

integer

added in community.general 9.1.0

Specify the target port of the Proxmox VE cluster.

Uses the PROXMOX_PORT environment variable if not specified.

api_token_id

string

added in community.general 1.3.0

Specify the token ID.

Requires proxmoxer>=1.1.0 to work.

api_token_secret

string

added in community.general 1.3.0

Specify the token secret.

Requires proxmoxer>=1.1.0 to work.

api_user

string / required

Specify the user to authenticate with.

backup_jobs

boolean

If true, the module will return all backup jobs information.

If false, the module will parse all backup jobs based on VM IDs and return a list of VMs’ backup information.

Mutually exclusive with vm_id and vm_name.

Choices:

  • false ← (default)

  • true

validate_certs

boolean

If false, SSL certificates will not be validated.

This should only be used on personally controlled sites using self-signed certificates.

Choices:

  • false ← (default)

  • true

vm_id

string

The ID of the Proxmox VM.

If defined, the returned list will contain backup jobs that have been parsed and filtered based on vm_id value.

Mutually exclusive with vm_name and backup_jobs.

vm_name

string

The name of the Proxmox VM.

If defined, the returned list will contain backup jobs that have been parsed and filtered based on vm_name value.

Mutually exclusive with vm_id and backup_jobs.

Attributes

Attribute

Support

Description

action_group

Action group: community.general.proxmox

Use group/community.general.proxmox in module_defaults to set defaults for this module.

check_mode

Support: full

This action does not modify state.

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: N/A

This action does not modify state.

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- name: Print all backup information by VM ID and VM name
  community.general.proxmox_backup_info:
    api_user: 'myUser@pam'
    api_password: '*******'
    api_host: '192.168.20.20'

- name: Print Proxmox backup information for a specific VM based on its name
  community.general.proxmox_backup_info:
    api_user: 'myUser@pam'
    api_password: '*******'
    api_host: '192.168.20.20'
    vm_name: 'mailsrv'

- name: Print Proxmox backup information for a specific VM based on its VM ID
  community.general.proxmox_backup_info:
    api_user: 'myUser@pam'
    api_password: '*******'
    api_host: '192.168.20.20'
    vm_id: '150'

- name: Print Proxmox all backup job information
  community.general.proxmox_backup_info:
    api_user: 'myUser@pam'
    api_password: '*******'
    api_host: '192.168.20.20'
    backup_jobs: true

Return Values

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

Key

Description

backup_info

list / elements=dictionary

The return value provides backup job information based on VM ID or VM name, or total backup job information.

Returned: on success, but can be empty

bktype

string

The type of the backup.

Returned: on success

Sample: "vzdump"

enabled

integer

1 if backup is enabled else 0.

Returned: on success

Sample: 1

id

string

The backup job ID.

Returned: on success

Sample: "backup-83831498-c631"

mode

string

The backup job mode such as snapshot.

Returned: on success

Sample: "snapshot"

next-run

string

The next backup time.

Returned: on success

Sample: "2024-12-28 11:30:00"

schedule

string

The backup job schedule.

Returned: on success

Sample: "sat 15:00"

storage

string

The backup storage location.

Returned: on success

Sample: "local"

vm_name

string

The VM name.

Returned: on success

Sample: "test01"

vmid

string

The VM ID.

Returned: on success

Sample: "100"

Authors

  • Marzieh Raoufnezhad (@raoufnezhad)

  • Maryam Mayabi (@mmayabi)