Skip to main content
Version: 3.0

Portworx Backup Ansible Collection

Applicable to both Classic and Federated modes

Overview

The Portworx Backup Ansible Collection allows seamless automation of Portworx Backup operations through the Ansible tool. This includes managing backup locations, schedules, cloud credentials, and cluster operations.

By integrating Portworx Backup 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 later
  • Ansible Core: 2.17.6 and later
  • Python: 3.9 and later
  • Python Library: requests
  • Stork: 24.3.2 and later

Modules

Portworx Backup currently automates tasks associated with the following modules:

  1. Backup location management: create, update, and delete backup locations for PXB.
  2. Backup management: manually create and manage backups
  3. Schedule management: automate backup scheduling workflows
  4. Restore management: restore backups that were backed up earlier
  5. Resource collector: list all the resources in a cluster which Portworx Backup can back up
  6. Cloud credential management: configure and manage credentials for accessing cloud storage and services
  7. Cluster management: perform cluster-level operations directly through Ansible playbooks
  8. Back up only PVCs/PV: back up volume resources (PVC/PV) excluding the volume data with Volume Resource Only Policy (VROP)

Installation

  1. To install the PX-Backup Ansible collection:

    ansible-galaxy collection install purepx.px_backup
  2. To configure SSL certificates, see the following link:
    https://github.com/portworx/px_backup_module/blob/main/ansible-collection/README.md

  3. For development and reference:

    git clone https://github.com/portworx/px_backup_module.git
    cd px_backup_module
    note

    Ansible 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, see the following resources: