dellemc.powerstore.snapshotrule (3.2.0) — module

Snapshot Rule operations on a PowerStore storage system

| "added in version" 1.0.0 of dellemc.powerstore"

Authors: Arindam Datta (@dattaarindam) <ansible.team@dell.com>

Install collection

Install with ansible-galaxy collection install dellemc.powerstore:==3.2.0


Add to requirements.yml

  collections:
    - name: dellemc.powerstore
      version: 3.2.0

Description

Performs all snapshot rule operations on PowerStore Storage System.

This modules supports get details of a snapshot rule, create new Snapshot Rule with Interval, create new Snapshot Rule with specific time and days_of_week. Modify Snapshot Rule. Delete Snapshot Rule.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of an existing snapshot rule by name
  dellemc.powerstore.snapshotrule:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of an existing snapshot rule by id
  dellemc.powerstore.snapshotrule:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshotrule_id: "{{snapshotrule_id}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create new snapshot rule by interval
  dellemc.powerstore.snapshotrule:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    interval: "{{interval}}"
    days_of_week:
      - Monday
    desired_retention: "{{desired_retention}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: Create new snapshot rule by time_of_day and days_of_week
  dellemc.powerstore.snapshotrule:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    desired_retention: "{{desired_retention}}"
    days_of_week:
      - Monday
      - Wednesday
      - Friday
    time_of_day: "{{time_of_day}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify existing snapshot rule to time_of_day and days_of_week
  dellemc.powerstore.snapshotrule:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    days_of_week:
      - Monday
      - Wednesday
      - Friday
      - Sunday
    time_of_day: "{{time_of_day}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify existing snapshot rule to interval
  dellemc.powerstore.snapshotrule:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    interval: "{{interval}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete an existing snapshot rule by name
  dellemc.powerstore.snapshotrule:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    state: "absent"

Inputs

    
name:
    description:
    - String variable. Indicates the name of the Snapshot rule.
    type: str

port:
    description:
    - Port number for the PowerStore array.
    - If not passed, it will take 443 as default.
    type: int

user:
    description:
    - The username of the PowerStore host.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    description:
    - String variable indicates the state of Snapshot rule.
    - For "Delete" operation only, it should be set to C(absent).
    - For all Create, Modify or Get details operation it should be set to C(present).
    required: true
    type: str

timeout:
    default: 120
    description:
    - Time after which the connection will get terminated.
    - It is to be mentioned in seconds.
    type: int

array_ip:
    description:
    - IP or FQDN of the PowerStore management system.
    required: true
    type: str

interval:
    choices:
    - Five_Minutes
    - Fifteen_Minutes
    - Thirty_Minutes
    - One_Hour
    - Two_Hours
    - Three_Hours
    - Four_Hours
    - Six_Hours
    - Eight_Hours
    - Twelve_Hours
    - One_Day
    description:
    - String variable. Indicates the interval between Snapshots.
    - When creating a Snapshot rule, specify either I(interval) or I(time_of_day), but
      not both.
    required: false
    type: str

new_name:
    description:
    - String variable. Indicates the new name of the Snapshot rule.
    - Used for renaming operation.
    type: str

password:
    description:
    - The password of the PowerStore host.
    required: true
    type: str

time_of_day:
    description:
    - String variable. Indicates the time of the day to take a daily Snapshot, with the
      format "hh:mm" in 24 hour time format.
    - When creating a Snapshot rule, specify either I(interval) or I(time_of_day) but
      not both.
    required: false
    type: str

days_of_week:
    choices:
    - Monday
    - Tuesday
    - Wednesday
    - Thursday
    - Friday
    - Saturday
    - Sunday
    description:
    - List of strings to specify days of the week on which the Snapshot rule should be
      applied. Must be applied for Snapshot rules where the I(time_of_day) parameter is
      set.
    - Optional for the Snapshot rule created with an interval. When I(days_of_week) is
      not specified for a new Snapshot rule, the rule is applied on every day of the week.
    elements: str
    type: list

delete_snaps:
    default: false
    description:
    - Boolean variable to specify whether all Snapshots previously created by this rule
      should also be deleted when this rule is removed.
    - C(true) specifies to delete all previously created Snapshots by this rule while
      deleting this rule.
    - C(false) specifies to retain all previously created Snapshots while deleting this
      rule.
    type: bool

validate_certs:
    aliases:
    - verifycert
    default: true
    description:
    - Boolean variable to specify whether to validate SSL certificate or not.
    - C(true) - indicates that the SSL certificate should be verified. Set the environment
      variable REQUESTS_CA_BUNDLE to the path of the SSL certificate.
    - C(false) - indicates that the SSL certificate should not be verified.
    type: bool

snapshotrule_id:
    description:
    - String variable. Indicates the ID of the Snapshot rule.
    type: str

desired_retention:
    description:
    - Integer variable. Indicates the desired Snapshot retention period.
    - It is required when creating a new Snapshot rule.
    required: false
    type: int

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'true'
  type: bool
snapshotrule_details:
  contains:
    days_of_week:
      description: List of string to specify days of the week on which the rule should
        be applied.
      type: list
    desired_retention:
      description: Desired snapshot retention period.
      type: int
    id:
      description: The system generated ID given to the snapshot rule.
      type: str
    interval:
      description: The interval between snapshots.
      type: str
    name:
      description: Name of the snapshot rule.
      type: str
    policies:
      contains:
        id:
          description: The protection policy ID in which the snapshot rule is selected.
          type: str
        name:
          description: Name of the protection policy in which the snapshot rule is
            selected.
          type: str
      description: The protection policies details of the snapshot rule.
      type: complex
    time_of_day:
      description: The time of the day to take a daily snapshot.
      type: str
  description: Details of the snapshot rule.
  returned: When snapshot rule exists
  sample:
    days_of_week:
    - Sunday
    - Thursday
    desired_retention: 24
    id: afa86b51-1171-498f-9786-2c78c33b4c14
    interval: Five_Minutes
    name: Sample_snapshot_rule
    policies: []
    time_of_day: null
  type: complex