PXB Ansible Collection
Overview
The PXB Ansible Collection allows seamless automation of PXB operations through Ansible tool. This includes managing backup locations, schedules, cloud credentials, and cluster operations.
By integrating PXB with Ansible, administrators can reduce manual effort, minimize errors, and enhance operational consistency, making it an ideal solution for managing backup workflows in hybrid and multi-cloud environments.
Prerequisites
- PXB: 2.8.1 and above
- Ansible Core: 2.17.6 and above
- Python: 3.9 and above
- Python Library: requests
- Stork: 24.3.2 and above
Modules
PXB currently automates the task associated with the following modules:
- Backup location management: create, update, and delete backup locations for PXB.
- Backup Management: manually create and manage backups
- Schedule management: automate backup scheduling workflows
- Restore management: restore backups that were backed up earlier
- Resource collector: list all the resources in a cluster which PXB can back up
- Cloud credential management: configure and manage credentials for accessing cloud storage and services
- Cluster management: perform cluster-level operations directly through Ansible playbooks
- Back up only PVCs/PV: back up volume resources (PVC/PV) excluding the volume data with Volume Resource Only Policy (VROP)
Installation
-
To install the PX-Backup Ansible collection:
ansible-galaxy collection install purepx.px_backup -
To configure SSL certificates, refer to the following link:
https://github.com/portworx/px_backup_module/blob/main/ansible-collection/README.md -
For development and reference:
git clone https://github.com/portworx/px_backup_module.git
cd px_backup_modulenoteAnsible modules require a name for resource operations; UUID may be specified optionally:
- name: Create backup schedule
pxbackup.portworx.backup_schedule:
operation: CREATE
name: "weekly-backup" # using name as identifier, skipping the uuid,
cluster_name: "prod-cluster"
schedule_policy: "weekly-policy"- name: Update existing schedule
pxbackup.portworx.backup_schedule:
operation: UPDATE
name: "weekly-backup"
uid: "d35ccbafc7be55cd" # Specify uid in case of multiple objects exist with same name
suspend: true
suspend_note: "Maintenance window"
:::
For more information, refer to the following resources: