dellemc.powerscale.synciqpolicy (3.0.0) — module

Manage SyncIQ policies on PowerScale

| "added in version" 1.3.0 of dellemc.powerscale"

Authors: Spandita Panigrahi (@panigs7) <ansible.team@dell.com>

Install collection

Install with ansible-galaxy collection install dellemc.powerscale:==3.0.0


Add to requirements.yml

  collections:
    - name: dellemc.powerscale
      version: 3.0.0

Description

Managing SyncIQ policies on PowerScale includes create a SyncIQ policy, modify a SyncIQ policy, get details of a SyncIQ policy, creating jobs on SyncIQ policy.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create SyncIQ policy
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    action: "copy"
    description: "Creating a policy"
    enabled: true
    policy_name: "New_policy"
    run_job: "on-schedule"
    schedule: "every 1 days at 12:00 PM"
    skip_when_source_unmodified: true
    rpo_alert: 100
    source_cluster:
      source_root_path: "<path_to_source>"
      source_exclude_directories: "<path_to_exclude>"
      source_include_directories: "<path_to_include>"
      source_network:
        pool: "pool0"
        subnet: "subnet0"
    target_cluster:
      target_host: "198.10.xxx.xxx"
      target_path: "<path_to_target>"
      target_certificate_id: "7sdgvejkiau7629903048hdjdkljsbwgsuasj7169823kkckll"
    target_snapshot:
      target_snapshot_archive: true
      target_snapshot_expiration: 90
      exp_time_unit: "day"
    accelerated_failback: false
    restrict_target_network: true
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify SyncIQ policy
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    policy_name: "New_policy"
    action: "sync"
    description: "Creating a policy"
    enabled: false
    run_job: "when-snapshot-taken"
    snapshot_sync_patten: "^snapshot\\-$latest"
    source_cluster:
      source_root_path: "<path_to_source>"
      source_exclude_directories: "<path_to_exclude>"
      source_include_directories: "<path_to_include>"
      source_network:
        pool: "pool1"
        subnet: "subnet1"
    target_cluster:
      target_host: "198.10.xxx.xxx"
      target_path: "<path_to_target>"
      target_certificate_id: "7sdgvejkiau7629903048hdjdkljsbwgsuasj716iuhywthsjk"
    target_snapshot:
      target_snapshot_archive: false
    accelerated_failback: true
    restrict_target_network: false
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Rename a SyncIQ policy
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    verify_ssl: "{{verify_ssl}}"
    policy_id: "d63b079d34adf2d2ec3ce92f15bfc730"
    new_policy_name: "Policy_Rename"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get SyncIQ policy details
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    verify_ssl: "{{verify_ssl}}"
    policy_name: "Policy_rename"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a job on SyncIQ policy
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    verify_ssl: "{{verify_ssl}}"
    policy_name: "Test_SSL"
    job_params:
      action: "run"
      source_snapshot: "TestSIQ-snapshot"
      wait_for_completion: false
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a resync_prep job on SyncIQ policy
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    verify_ssl: "{{verify_ssl}}"
    policy_name: "Test_SSL"
    job_params:
      action: "resync_prep"
      source_snapshot: "TestSIQ-snapshot"
      wait_for_completion: false
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Allow writes on target of SyncIQ policy
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    verify_ssl: "{{verify_ssl}}"
    policy_name: "Test_SSL"
    job_params:
      action: "allow_write"
      source_snapshot: "TestSIQ-snapshot"
      workers_per_node: 3
      wait_for_completion: false
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Disallow writes on target of SyncIQ policy
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    verify_ssl: "{{verify_ssl}}"
    policy_name: "Test_SSL"
    job_params:
      action: "allow_write_revert"
      source_snapshot: "TestSIQ-snapshot"
      workers_per_node: 3
      wait_for_completion: false
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete SyncIQ policy by policy name
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    verify_ssl: "{{verify_ssl}}"
    policy_name: "Policy_rename"
    state: "absent"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete SyncIQ policy by policy ID
  dellemc.powerscale.synciqpolicy:
    onefs_host: "{{onefs_host}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    verify_ssl: "{{verify_ssl}}"
    policy_id: "d63b079d34adf2d2ec3ce92f15bfc730"
    state: "absent"

Inputs

    
state:
    choices:
    - absent
    - present
    description:
    - The state option is used to determine whether the policy exists or not.
    required: true
    type: str

action:
    choices:
    - sync
    - copy
    description:
    - Indicates type of replication action to be performed on the source.
    type: str

enabled:
    description:
    - Indicates whether policy is enabled or disabled.
    type: bool

port_no:
    default: '8080'
    description:
    - Port number of the PowerScale cluster.It defaults to 8080 if not specified.
    required: false
    type: str

run_job:
    choices:
    - on-schedule
    - when-source-modified
    - when-snapshot-taken
    - manual
    description:
    - Types of scheduling a job on the policy.
    type: str

api_user:
    description:
    - username of the PowerScale cluster.
    required: true
    type: str

schedule:
    description:
    - Schedule set when I(run_policy) is C(on-schedule).
    - It must be in isidate format.
    - If the format is not proper an error will be thrown.
    type: str

job_delay:
    description:
    - If I(run_job) is set to C(when-source-modified), I(job_delay) is the duration to
      wait before triggering a job once there is modification on source.
    type: int

policy_id:
    description:
    - The I(policy_id) is auto generated at the time of creation.
    - For get/modify operations either I(policy_name) or I(policy_id) is needed.
    - Parameters I(policy_name) and I(policy_id) are mutually exclusive.
    type: str

rpo_alert:
    description:
    - If I(run_job) is set to C(on-schedule) it is set to time/date, an alert is created
      if the specified RPO for this policy is exceeded.
    - The default value is 0, which will not generate RPO alerts.
    type: int

job_params:
    description:
    - Specifies the parameters to create a job on SyncIQ policy.
    suboptions:
      action:
        choices:
        - run
        - resync_prep
        - allow_write
        - allow_write_revert
        description:
        - The action to be taken by this job.
        required: true
        type: str
      source_snapshot:
        description:
        - An optional snapshot to copy/sync from.
        type: str
      wait_for_completion:
        default: false
        description:
        - Specifies if the job should run synchronously or asynchronously. By default
          the job is created to run asynchronously.
        type: bool
      workers_per_node:
        description:
        - Specifies the desired workers per node. This parameter is valid for I(allow_write),
          and I(allow_write_revert) operation. This is an optional parameter and it defaults
          to 3.
        type: int
    type: dict

onefs_host:
    description:
    - IP address or FQDN of the PowerScale cluster.
    required: true
    type: str

verify_ssl:
    choices:
    - true
    - false
    description:
    - boolean variable to specify whether to validate SSL certificate or not.
    - C(true) - indicates that the SSL certificate should be verified.
    - C(false) - indicates that the SSL certificate should not be verified.
    required: true
    type: bool

description:
    description:
    - Description of the policy.
    type: str

policy_name:
    description:
    - The name of the policy.
    - Required at the time of policy creation, for the rest of the operations either I(policy_name)
      or I(policy_id) is required.
    type: str

api_password:
    description:
    - the password of the PowerScale cluster.
    required: true
    type: str

job_delay_unit:
    choices:
    - seconds
    - minutes
    - hours
    - days
    default: seconds
    description:
    - Unit for I(job_delay).
    type: str

rpo_alert_unit:
    choices:
    - minutes
    - hours
    - days
    - weeks
    - months
    - years
    default: minutes
    description:
    - Unit for I(rpo_alert).
    type: str

source_cluster:
    description:
    - Defines the details of I(source_cluster).
    suboptions:
      source_exclude_directories:
        description:
        - List of path to the directories that should be excluded while running a policy.
        - For example, if we want to exclude directory 'exclude1' at location '/ifs/source',
          then the I(source_exclude_directories) will be '/ifs/source/exclude1'.
        elements: str
        type: list
      source_include_directories:
        description:
        - List of path to the directories that should be included while running a policy
        - For example, if we want to include directory 'include1' at location '/ifs/source',
          then the I(source_exclude_directories) will be '/ifs/source/include1'.
        elements: str
        type: list
      source_network:
        description:
        - Run the policy only on nodes in the specified subnet and pool.
        suboptions:
          pool:
            description:
            - The pool to restrict replication policies to.
            type: str
          subnet:
            description:
            - The subnet to restrict replication policies to.
            type: str
        type: dict
      source_root_path:
        description:
        - The root directory on the source cluster where the files will be synced from.
        - Source root path should begin with /ifs. For example, if we want to create a
          synciq policy for the directory 'source' in the base path /ifs, then the I(source_root_path)
          will be '/ifs/source'.
        type: str
    type: dict

target_cluster:
    description:
    - Details of the target cluster.
    suboptions:
      target_certificate_id:
        description:
        - The ID of the target cluster certificate being used for encryption
        - This parameter is not supported by isi_sdk_8_1_1
        type: str
      target_certificate_name:
        description:
        - The name of the target cluster certificate being used for encryption
        - Parameters I(target_certficate_name) and I(target_certificate_id) are mutually
          exclusive
        - This parameter is not supported by isi_sdk_8_1_1
        type: str
      target_host:
        description:
        - Host IP or FQDN where we want to replicate the source.
        type: str
      target_path:
        description:
        - The directory location to have the replicated source data.
        type: str
    type: dict

new_policy_name:
    description:
    - The new name of the policy while renaming an existing policy.
    - I(policy_name) or I(policy_id) is required together with I(new_policy_name).
    type: str

target_snapshot:
    description:
    - Details of snapshots to be created at the target.
    suboptions:
      exp_time_unit:
        choices:
        - years
        - months
        - weeks
        - days
        default: years
        description:
        - Unit of I(target_snapshot) expiration time.
        type: str
      target_snapshot_archive:
        description:
        - Indicates whether to take snapshot of the target.
        type: bool
      target_snapshot_expiration:
        description:
        - Expiration time of snapshot.
        - Value 0 means no expiration.
        type: int
    type: dict

accelerated_failback:
    description:
    - If set to C(true), SyncIQ will perform failback configuration tasks during the next
      job run, rather than waiting to perform those tasks during the failback process.
    - Performing these tasks ahead of time will increase the speed of failback operations.
    - It defaults to C(true), if not specified.
    type: bool

snapshot_sync_pattern:
    description:
    - The naming pattern that a snapshot must match to trigger a sync when the schedule
      is C(when-snapshot-taken).
    type: str

restrict_target_network:
    description:
    - If set to C(true) then replication policies will connect only to nodes in the specified
      SmartConnect zone.
    - If set to C(false), replication policies are not restricted to specific nodes on
      the target cluster.
    type: bool

skip_when_source_unmodified:
    description:
    - If true and schedule is set , the policy will not run if no changes have been made
      to the contents of the source directory since the last job successfully completed.
    - Option modifiable when I(run_job) is C(on-schedule).
    type: bool

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'true'
  type: bool
synciq_policy_details:
  contains:
    action:
      description: Type of action for the policy
      type: str
    enabled:
      description: Indicates whether policy is enabled
      type: bool
    id:
      description: ID of the policy.
      type: str
    jobs:
      description: List of jobs running on the policy
      type: list
    name:
      description: The name of the policy.
      type: str
    schedule:
      description: Type of schedule chosen to run a policy
      type: str
    source_root_path:
      description: The path to the source directory to be replicated
      type: str
    target_host:
      description: The IP/FQDN of the host where source is replicated
      type: str
    target_path:
      description: The target directory where source is replicated
      type: str
  description: Details of the SyncIQ policy.
  returned: When SyncIQ policy exists
  sample:
    action: copy
    bandwidth: 100
    description: SyncIQ policy Description
    enabled: true
    encryption: false
    file_matching_pattern:
      or_criteria: null
    id: d63b079d34adf2d2ec3ce92f15bfc730
    job: []
    job_delay: 1.0 days
    name: SyncIQ_Policy
    next_run_time: '1700479390'
    schedule: when-source-modified
    source_root_path: /ifs
    target_certificate_id: 7sdgvejkiau7629903048hdjdkljsbwgsuasj7169823kkckll
    target_certificate_name: test
    target_host: 192.10.xxx.xxx
    target_path: /ifs/synciq
    target_snapshot_archive: false
  type: dict
target_synciq_policy_details:
  contains:
    failover_failback_state:
      description: The state of the policy with respect to sync failover/failback.
      type: str
    id:
      description: ID of the policy.
      type: str
    name:
      description: The name of the policy.
      type: str
  description: Details of the target SyncIQ policy.
  returned: When failover/failback is performed on target cluster
  sample:
    failover_failback_state: enabled
    id: d63b079d34adf2d2ec3ce92f15bfc730
    name: SyncIQ_Policy
  type: dict