maxhoesel.proxmox.pbs_datastore module – Manage datastores on PBS

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_datastore.

New in maxhoesel.proxmox 4.0.0

Synopsis

  • Create, update and delete datastores on a Proxmox Backup Server

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 datastore (visible in UI)

gc_schedule

string

Run garbace collection job at specified schedule. Must be a calendar event (i.e daily, Tue 04:27)

keep_daily

integer

Number of daily backups to keep

keep_hourly

integer

Number of hourly backups to keep

keep_last

integer

Number of backups to keep

keep_monthly

integer

Number of monthly backups to keep

keep_weekly

integer

Number of weekly backups to keep

keep_yearly

integer

Number of yearly backups to keep

name

string / required

Name of the datastore

notify

dictionary

Datastore notification settings

gc

string

Garbage Collection notification setting

Choices:

  • "always"

  • "never"

  • "error"

sync

string

Sync Jobs notification setting

Choices:

  • "always"

  • "never"

  • "error"

verify

string

Verification notification setting

Choices:

  • "always"

  • "never"

  • "error"

notify_user

string

User ID to notify

path

string

Backing path for the datastore. Required when creating a new datastore

prune_schedule

string

Run prune job at specified schedule. Must be a calendar event (i.e daily, Tue 04:27)

state

string

Whether this datastore should be present or absent

Choices:

  • "present" ← (default)

  • "absent"

validate_certs

boolean

Validate SSL certificate of the PVE host upon connecting

Choices:

  • false ← (default)

  • true

verify_new

boolean

If enabled, all new backups will be verified right after completion

Choices:

  • false

  • true

Notes

Note

  • Check mode is supported.

Examples

- name: Create/Update a datastore
  maxhoesel.proxmox.pbs_datastore:
    api_user: root@pam
    api_password: secret
    api_host: helldorado
    name: test-datastore
    path: /mnt/somedisk/thisdirectory
    gc_schedule: daily
    prune_schedule: daily
    keep_daily: 7
    keep_weekly: 4
    keep_monthly: 6
    notify:
      gc: error
      verify: error
      sync: error
    verify_new: yes

Authors

  • Max Hösel (@maxhoesel)