Skip to content

johncchampion/ots_deploy_backup_ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Backup ONTAP Select Deploy Configuration Data

17 April 2023

Description

This is an Ansible playbook and set of tasks to generate and download a configuration backup of the ONTAP 9 Select Deploy data. It uses the REST API to invoke a backup with an automatically generated name, retrieve the file download link, download the file, and optionally delete the backup on the Deploy server.

Disclaimer

The playbook and associated components are provided as-is and are intended to provide an example of utilizing the ONTAP collection in Ansible. Fully test in a non-production enviornment before implementing. Feel free to utilize/modify any portion of code for your specific needs.

Requirements

  • ONTAP Select 9.8 Deploy or later
  • Ansible 2.9.7 or later
  • This playbook - copied to the desired location
  • Account running playbook requires write permissions (to create a directory for the downloaded backup)

Dev/Test Environment

  • CentOS 8.2
  • Ansible 2.12.1
  • ONTAP Select v9.12.1

Usage

  • Edit the playbook and set the 'deploy_url' and 'deploy_pw' vars to match your environment.
  • Remove the 'DELETE' text if you do not wish to delete the backup from the Deploy server.
  • The 'playbook_dir' is the path the playbook is run:
  vars:
    - deploy_login: "admin"
    - deploy_pw: "Netapp1!"
    - deploy_url: "https://10.0.0.201/api/v3"
    - deploy_backup_pw: "{{ deploy_pw }}"
    - deploy_backup_dir: "{{ playbook_dir }}/backups/"
    - deploy_delete_backup: "DELETE"
  • Example: ansible-playbook pb_ots_deploy_backup"

Workflow

  1. Generate a backup with internally generated name
  2. Monitor the backup job until success or failure - exit on failure
  3. Retrieve download URL for the generated backup file
  4. Create backup directory if it does not exist (account requires write permissions)
  5. Download backup file
  6. Optional: Delete the backup file on the Deploy server

About

Backup ONTAP Select Deploy Configuration Data Using Ansible

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published