dellemc.powerstore.protectionpolicy (3.2.0) — module

Perform Protection policy operations for PowerStore storage system

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

Authors: Arindam Datta (@dattaarindam) <ansible.team@dell.com>, P Srinivas Rao (@srinivas-rao5) <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 protection policy operations on PowerStore Storage System. This module supports create, modify, get and delete a protection policy.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: Create a protection policy with snapshot rule and replication rule
  dellemc.powerstore.protectionpolicy:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    description: "{{description}}"
    snapshotrules:
      - "Ansible_test_snap_rule_1"
    replicationrule: "ansible_replication_rule_1"
    snapshotrule_state: "present-in-policy"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify protection policy, change name
  dellemc.powerstore.protectionpolicy:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    new_name: "{{new_name}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify protection policy, add snapshot rule
  dellemc.powerstore.protectionpolicy:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    snapshotrules:
      - "Ansible_test_snaprule_1"
    snapshotrule_state: "present-in-policy"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify protection policy, remove snapshot rule, replication rule
  dellemc.powerstore.protectionpolicy:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    name: "{{name}}"
    snapshotrules:
      - "Ansible_test_to_be_removed"
    replicationrule: ""
    snapshotrule_state: "absent-in-policy"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of protection policy by name
  dellemc.powerstore.protectionpolicy:
    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 protection policy by ID
  dellemc.powerstore.protectionpolicy:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    protectionpolicy_id: "{{protectionpolicy_id}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete protection policy
  dellemc.powerstore.protectionpolicy:
    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 protection policy.
    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 protection policy.
    - For Delete operation only, it should be set to C(absent).
    - For all other operations like Create, Modify or Get details, 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

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

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

description:
    description:
    - String variable. Indicates the description of the protection policy.
    type: str

snapshotrules:
    description:
    - List of strings to specify the name or ids of snapshot rules which are to be added
      or removed, to or from, the protection policy.
    elements: str
    type: list

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

replicationrule:
    description:
    - The name or ids of the replcation rule which is to be added to the protection policy.
    - To remove the replication rule, an empty string has to be passed.
    type: str

snapshotrule_state:
    choices:
    - present-in-policy
    - absent-in-policy
    description:
    - String variable. Indicates the state of a snapshotrule in a protection policy.
    - When snapshot rules are specified, this variable is required.
    - Value C(present-in-policy) indicates to add to protection policy.
    - Value C(absent-in-policy) indicates to remove from protection policy.
    required: false
    type: str

protectionpolicy_id:
    description:
    - String variable. Indicates the id of the protection policy.
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'false'
  type: bool
protectionpolicy_details:
  contains:
    description:
      description: description about the protection policy.
      type: str
    id:
      description: The system generated ID given to the protection policy.
      type: str
    name:
      description: Name of the protection policy.
      type: str
    replication_rules:
      contains:
        id:
          description: The replication rule ID of the protection policy.
          type: str
        name:
          description: The replication rule name of the protection policy.
          type: str
      description: The replication rule details of the protection policy.
      type: complex
    snapshot_rules:
      contains:
        id:
          description: The snapshot rule ID of the protection policy.
          type: str
        name:
          description: The snapshot rule name of the protection policy.
          type: str
      description: The snapshot rules details of the protection policy.
      type: complex
    type:
      description: The type for the protection policy.
      type: str
  description: Details of the protection policy.
  returned: When protection policy exists
  sample:
    description: null
    id: bce845ea-78ba-4414-ada1-8130f3a49e74
    name: sample_protection_policy
    replication_rules:
    - id: 7ec83605-bed4-4e2b-8405-504a614db318
    - name: sample_replication_rule
    snapshot_rules: []
    type: Protection
  type: complex