�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
m Z d d
l m Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bysa
---
module: purefa_pgsnap
version_added: '2.6'
short_description: Manage protection group snapshots on Pure Storage FlashArrays
description:
- Create or delete protection group snapshots on Pure Storage FlashArray.
- Recovery of replicated snapshots on the replica target array is enabled.
author:
- Pure Storage Ansible Team (@sdodsley) <[email protected]>
options:
name:
description:
- The name of the source protection group.
type: str
required: true
suffix:
description:
- Suffix of snapshot name.
state:
description:
- Define whether the protection group snapshot should exist or not.
Copy (added in 2.7) will create a full read/write clone of the
snapshot.
type: str
choices: [ absent, present, copy ]
default: present
eradicate:
description:
- Define whether to eradicate the snapshot on delete or leave in trash.
type: bool
default: 'no'
restore:
description:
- Restore a specific volume from a protection group snapshot.
type: str
version_added: 2.7
overwrite:
description:
- Define whether to overwrite the target volume if it already exists.
type: bool
default: 'no'
version_added: 2.8
target:
description:
- Volume to restore a specified volume to.
- If not supplied this will default to the volume defined in I(restore)
type: str
version_added: 2.8
now:
description: Whether to initiate a snapshot of the protection group immediately
type: bool
default: False
version_added: 2.9
apply_retention:
description: Apply retention schedule settings to the snapshot
type: bool
default: False
version_added: 2.9
remote:
description: Force immeadiate snapshot to remote targets
type: bool
default: False
version_added: 2.9
extends_documentation_fragment:
- purestorage.fa
s
- name: Create protection group snapshot foo.ansible
purefa_pgsnap:
name: foo
suffix: ansible
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
state: present
- name: Delete and eradicate protection group snapshot named foo.snap
purefa_pgsnap:
name: foo
suffix: snap
eradicate: true
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
state: absent
- name: Restore volume data from local protection group snapshot named foo.snap to volume data2
purefa_pgsnap:
name: foo
suffix: snap
restore: data
target: data2
overwrite: true
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
state: copy
- name: Restore remote protection group snapshot arrayA:pgname.snap.data to local copy
purefa_pgsnap:
name: arrayA:pgname
suffix: snap
restore: data
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
state: copy
- name: Create snapshot of existing pgroup foo with suffix and force immeadiate copy to remote targets
purefa_pgsnap:
name: pgname
suffix: force
now: True
apply_retention: True
remote: True
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
state: copy
t
( t
AnsibleModule( t
get_systemt purefa_argument_spec( t datetimec C` s1 y | j | j d � SWn t k
r, d SXd S( s Return Protection Group or Nonet nameN( t
get_pgroupt paramst Exceptiont None( t modulet array( ( sU /usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_pgsnap.pyR � s
c C` s_ yF | j | j d � } x) | d D] } | | j d k r$ | Sq$ WWn t k
rZ d SXd S( s&