summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/powerflex/playbooks/modules
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/dellemc/powerflex/playbooks/modules')
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/device.yml90
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/fault_set.yml67
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/info.yml80
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/mdm_cluster.yml148
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/protection_domain.yml124
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/replication_consistency_group.yml234
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/replication_pair.yml82
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/sdc.yml64
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/sds.yml149
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/snapshot.yml130
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/snapshot_policy.yml215
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/storagepool.yml61
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/volume.yml133
13 files changed, 1577 insertions, 0 deletions
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/device.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/device.yml
new file mode 100644
index 000000000..34bbb12b5
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/device.yml
@@ -0,0 +1,90 @@
+---
+- name: Device Operations
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+
+ tasks:
+ - name: Add a device
+ dellemc.powerflex.device:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ current_pathname: "/dev/sdb"
+ sds_name: "node1"
+ media_type: "HDD"
+ device_name: "device2"
+ storage_pool_name: "pool1"
+ protection_domain_name: "domain1"
+ external_acceleration_type: "ReadAndWrite"
+ state: "present"
+
+ - name: Add a device with force flag
+ dellemc.powerflex.device:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ current_pathname: "/dev/sdb"
+ sds_name: "node1"
+ media_type: "HDD"
+ device_name: "device2"
+ storage_pool_name: "pool1"
+ protection_domain_name: "domain1"
+ external_acceleration_type: "ReadAndWrite"
+ force: true
+ state: "present"
+
+ - name: Get device details using device_id
+ dellemc.powerflex.device:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ device_id: "d7fe088900000000"
+ state: "present"
+
+ - name: Get device details using (current_pathname, sds_name)
+ dellemc.powerflex.device:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ current_pathname: "/dev/sdb"
+ sds_name: "node0"
+ state: "present"
+
+ - name: Get device details using (current_pathname, sds_id)
+ dellemc.powerflex.device:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ current_pathname: "/dev/sdb"
+ sds_id: "5717d71800000000"
+ state: "present"
+
+ - name: Remove a device using device_id
+ dellemc.powerflex.device:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ device_id: "76eb7e2f00010000"
+ state: "absent"
+
+ - name: Remove a device using (current_pathname, sds_name)
+ dellemc.powerflex.device:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ current_pathname: "/dev/sdb"
+ sds_name: "node1"
+ state: "absent"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/fault_set.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/fault_set.yml
new file mode 100644
index 000000000..ee61b3733
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/fault_set.yml
@@ -0,0 +1,67 @@
+---
+- name: Fault set Operations
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ host_port: 443
+ fault_set_name: "sample_fault_set_name_1"
+ protection_domain_name: "Ansible-PD1"
+
+ tasks:
+ - name: Create fault set
+ dellemc.powerflex.fault_set:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ fault_set_name: "{{ fault_set_name }}"
+ protection_domain_name: "{{ protection_domain_name }}"
+
+ - name: Get fault set details using name and protection domain
+ register: result
+ dellemc.powerflex.fault_set:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ fault_set_name: "{{ fault_set_name }}"
+ protection_domain_name: "{{ protection_domain_name }}"
+
+ - name: Get fault set details using ID
+ dellemc.powerflex.fault_set:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ fault_set_id: "{{ result.fault_set_details.id }}"
+ state: "present"
+
+ - name: Rename fault set details using ID
+ dellemc.powerflex.fault_set:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ fault_set_id: "{{ result.fault_set_details.id }}"
+ fault_set_new_name: "fault_set_new_name"
+ state: "present"
+
+ - name: Delete fault set
+ dellemc.powerflex.fault_set:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ fault_set_name: "fault_set_new_name"
+ protection_domain_name: "{{ protection_domain_name }}"
+ state: "absent"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/info.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/info.yml
new file mode 100644
index 000000000..b1a16785a
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/info.yml
@@ -0,0 +1,80 @@
+---
+- name: Gatherfacts Module Operations on PowerFlex
+ hosts: localhost
+ connection: local
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ host_port: 443
+ tasks:
+ - name: Get detailed list of PowerFlex Entities
+ dellemc.powerflex.info:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ gather_subset:
+ - vol
+ - storage_pool
+ - protection_domain
+ - sdc
+ - sds
+ - snapshot_policy
+ - device
+ - rcg
+ - replication_pair
+ - fault_set
+
+ - name: Get specific volume details
+ dellemc.powerflex.info:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ gather_subset:
+ - vol
+ filters:
+ - filter_key: "name"
+ filter_operator: "equal"
+ filter_value: "ansible_test"
+
+ - name: Get specific fault set list
+ dellemc.powerflex.info:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ gather_subset:
+ - fault_set
+ filters:
+ - filter_key: "name"
+ filter_operator: "equal"
+ filter_value: "node4"
+
+ - name: Get managed device, deployments, service templates
+ dellemc.powerflex.info:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ gather_subset:
+ - managed_device
+ - deployment
+ - service_template
+
+ - name: Get deployment with filter, sort, pagination
+ dellemc.powerflex.info:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ gather_subset:
+ - deployment
+ filters:
+ - filter_key: "name"
+ filter_operator: "contains"
+ filter_value: "partial"
+ sort: name
+ limit: 10
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/mdm_cluster.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/mdm_cluster.yml
new file mode 100644
index 000000000..bdc44bdfa
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/mdm_cluster.yml
@@ -0,0 +1,148 @@
+---
+- name: MDM cluster Operations
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ host_port: 443
+
+ tasks:
+ - name: Get MDM cluster
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ state: "present"
+
+ - name: Rename MDM cluster with check_mode
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ mdm_id: "1c13c3847c971201"
+ mdm_new_name: "node_renamed"
+ state: "present"
+ check_mode: true
+
+ - name: Rename MDM cluster
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ mdm_id: "1c13c3847c971201"
+ mdm_new_name: "node_renamed"
+ state: "present"
+
+ - name: Remove standby MDM
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ mdm_name: "mdm_node1"
+ state: "absent"
+
+ - name: Add standby MDM
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ mdm_name: "mdm_standby_node"
+ standby_mdm:
+ mdm_ips:
+ - "10.x.x.x"
+ role: "TieBreaker"
+ management_ips:
+ - "10.x.x.x"
+ port: 9011
+ state: "present"
+
+ - name: Change MDM cluster owner
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ mdm_name: "node_renamed"
+ is_primary: true
+ state: "present"
+
+ - name: Change virtual IP interface
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ mdm_name: "mdm_manager_node"
+ virtual_ip_interfaces:
+ - "ens224"
+ - "ens256"
+ state: "present"
+
+ - name: Clear virtual IP interface
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ mdm_name: "mdm_manager_node"
+ clear_interfaces: true
+ state: "present"
+
+ - name: Change Performance profile
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ performance_profile: "Compact"
+ state: "present"
+
+ - name: Switch cluster mode to FiveNodes
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ cluster_mode: "FiveNodes"
+ mdm:
+ - mdm_name: "mdm_manger_node"
+ mdm_type: "Secondary"
+ - mdm_name: "mdm_tiebreaker_node"
+ mdm_type: "TieBreaker"
+ mdm_state: "present-in-cluster"
+ state: "present"
+
+ - name: Switch cluster mode to ThreeNodes
+ dellemc.powerflex.mdm_cluster:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ cluster_mode: "ThreeNodes"
+ mdm:
+ - mdm_name: "mdm_manger_node"
+ mdm_type: "Secondary"
+ - mdm_name: "mdm_tiebreaker_node"
+ mdm_type: "TieBreaker"
+ mdm_state: "absent-in-cluster"
+ state: "present"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/protection_domain.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/protection_domain.yml
new file mode 100644
index 000000000..5911a90aa
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/protection_domain.yml
@@ -0,0 +1,124 @@
+---
+- name: Protection domain Operations
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ host_port: 443
+
+ tasks:
+ - name: Create Protection Domain
+ register: result
+ dellemc.powerflex.protection_domain:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ protection_domain_name: "domain_1"
+ network_limits:
+ rebuild_limit: 10240
+ rebalance_limit: 10240
+ vtree_migration_limit: 10240
+ overall_limit: 20480
+ bandwidth_unit: "KBps"
+ rf_cache_limits:
+ page_size: 32
+ pass_through_mode: "Write"
+ state: "present"
+
+ - name: Get Protection Domain
+ dellemc.powerflex.protection_domain:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ protection_domain_name: "domain_1"
+ state: "present"
+
+ - name: Set Protection Domain id
+ ansible.builtin.set_fact:
+ pd_id: "{{ result.protection_domain_details.id }}"
+
+ - name: Get Protection Domain using ID
+ dellemc.powerflex.protection_domain:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ protection_domain_id: "{{ pd_id }}"
+ state: "present"
+
+ - name: Modify Protection Domain using ID
+ register: result
+ dellemc.powerflex.protection_domain:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ is_active: false
+ protection_domain_id: "{{ pd_id }}"
+ protection_domain_new_name: "domain_1_renamed"
+ network_limits:
+ rebuild_limit: 12
+ rebalance_limit: 12
+ overall_limit: 22
+ bandwidth_unit: "GBps"
+ rf_cache_limits:
+ is_enabled: false
+ page_size: 16
+ max_io_limit: 128
+ pass_through_mode: "Write"
+ state: "present"
+
+ - name: Modify Protection Domain using ID - Idempotecny
+ register: result
+ dellemc.powerflex.protection_domain:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ is_active: false
+ protection_domain_id: "{{ pd_id }}"
+ protection_domain_new_name: "domain_1_renamed"
+ network_limits:
+ rebuild_limit: 12
+ rebalance_limit: 12
+ overall_limit: 22
+ bandwidth_unit: "GBps"
+ rf_cache_limits:
+ is_enabled: false
+ page_size: 16
+ max_io_limit: 128
+ pass_through_mode: "Write"
+ state: "present"
+
+ - name: Delete Protection Domain using ID
+ register: result
+ dellemc.powerflex.protection_domain:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ protection_domain_id: "{{ pd_id }}"
+ state: "absent"
+
+ - name: Delete Protection Domain - Idempotecny
+ register: result
+ dellemc.powerflex.protection_domain:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ protection_domain_name: "domain_1_renamed"
+ state: "absent"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/replication_consistency_group.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/replication_consistency_group.yml
new file mode 100644
index 000000000..043808f53
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/replication_consistency_group.yml
@@ -0,0 +1,234 @@
+---
+- name: Replication consistency group operations on PowerFlex array.
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ remote_hostname: '**.**.**.**'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ rcg_name: "rcg_test"
+ rcg_id: "aadc17d900000002"
+
+ tasks:
+ - name: Get RCG details by name
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+
+ - name: Get RCG details by id
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_id: "{{ rcg_id }}"
+ state: "present"
+
+ - name: Create an RCG snapshot - check mode
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ create_snapshot: true
+ check_mode: true
+
+ - name: Create an RCG snapshot
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ create_snapshot: true
+
+ - name: Create an RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rpo: 120
+ protection_domain_name: "domain1"
+ activity_mode: "Active"
+ remote_peer:
+ hostname: "{{ remote_hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ protection_domain_name: "domain1"
+
+ - name: Modify RCG rpo
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rpo: 50
+
+ - name: Modify RCG target volume access mode
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ target_volume_access_mode: "ReadOnly"
+
+ - name: Pause RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: 'pause'
+ pause_mode: "StopDataTransfer"
+
+ - name: Resume RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: 'resume'
+
+ - name: Freeze RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: 'freeze'
+
+ - name: UnFreeze RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: 'unfreeze'
+
+ - name: Set RCG as consistent
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ is_consistent: true
+
+ - name: Inactivate RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ activity_mode: "InActive"
+
+ - name: Rename RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ new_rcg_rename: "rename_rcg"
+
+ - name: Delete RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ state: "absent"
+
+ - name: Failover RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: "failover"
+
+ - name: Restore RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: "restore"
+
+ - name: Switchover RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: "switchover"
+
+ - name: Reverse RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: "reverse"
+
+ - name: Force switchover RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: "switchover"
+ force: true
+
+ - name: Synchronize RCG
+ register: result
+ dellemc.powerflex.replication_consistency_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ rcg_name: "{{ rcg_name }}"
+ rcg_state: "sync"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/replication_pair.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/replication_pair.yml
new file mode 100644
index 000000000..b24313843
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/replication_pair.yml
@@ -0,0 +1,82 @@
+---
+- name: Replication pair operations on PowerFlex array.
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ remote_hostname: '**.**.**.**'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ rcg_name: "test_rcg"
+ rcg_id: "aadc17d900000002"
+
+ tasks:
+ - name: Get replication pair details by name
+ register: result
+ dellemc.powerflex.replication_pair:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ pair_name: "test_pair"
+
+ - name: Add replication pair to RCG
+ register: result
+ dellemc.powerflex.replication_pair:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ pairs:
+ - source_volume_name: "ans_test_vol"
+ target_volume_name: "ans_env8_vol"
+ copy_type: "OnlineCopy"
+ name: "test_pair"
+ rcg_name: "test_rcg"
+ remote_peer:
+ hostname: "{{ remote_hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+
+ - name: Pause Replication pair
+ register: result
+ dellemc.powerflex.replication_pair:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ pair_name: "test_pair"
+ pause: true
+
+ - name: Resume Replication pair
+ register: result
+ dellemc.powerflex.replication_pair:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ pair_name: "test_pair"
+ pause: false
+
+ - name: Delete replication pair
+ register: result
+ dellemc.powerflex.replication_pair:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ pair_name: "test_pair"
+ state: "absent"
+
+ - name: Delete replication pair - Idemotency
+ register: result
+ dellemc.powerflex.replication_pair:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ pair_name: "test_pair"
+ state: "absent"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/sdc.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/sdc.yml
new file mode 100644
index 000000000..b796f02da
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/sdc.yml
@@ -0,0 +1,64 @@
+---
+- name: SDC Operations
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ sdc_name: test_sdc
+
+ tasks:
+ - name: Get sdc details using sdc ip
+ register: result
+ dellemc.powerflex.sdc:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ sdc_ip: "1.1.1.1"
+ state: "present"
+
+ - name: Set sdc id
+ ansible.builtin.set_fact:
+ sdc_id: "{{ result.sdc_details.id }}"
+
+ - name: Rename sdc using sdc id
+ dellemc.powerflex.sdc:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ sdc_id: "{{ sdc_id }}"
+ sdc_new_name: "{{ sdc_name }}"
+ state: "present"
+
+ - name: Get sdc details using sdc name
+ dellemc.powerflex.sdc:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ sdc_name: "{{ sdc_name }}"
+ state: "present"
+
+ - name: Set performance profile of sdc using sdc name
+ dellemc.powerflex.sdc:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ sdc_name: "{{ sdc_name }}"
+ performance_profile: "HighPerformance"
+ state: "present"
+
+ - name: Remove sdc
+ dellemc.powerflex.sdc:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ sdc_name: "{{ sdc_name }}"
+ state: "absent"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/sds.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/sds.yml
new file mode 100644
index 000000000..30a9b0906
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/sds.yml
@@ -0,0 +1,149 @@
+---
+- name: SDS Operations
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ host_port: 443
+ sds_name_1: "sds_node_1"
+ sds_name_2: "sds_node_2"
+ sds_name_1_new: "sds_node1_new"
+ protection_domain_name: "Ansible-PD1"
+
+ tasks:
+ - name: Create SDS
+ register: result
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_name: "{{ sds_name_1 }}"
+ protection_domain_name: "{{ protection_domain_name }}"
+ sds_ip_list:
+ - ip: '**.**.**.**'
+ role: "all"
+ sds_ip_state: "present-in-sds"
+ state: "present"
+
+ - name: Create SDS with all parameters
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_name: "{{ sds_name_2 }}"
+ fault_set_name: "sample_fault_set"
+ protection_domain_name: "{{ protection_domain_name }}"
+ sds_ip_list:
+ - ip: '**.**.**.**'
+ role: "all"
+ sds_ip_state: "present-in-sds"
+ rmcache_enabled: true
+ rmcache_size: 210
+ state: "present"
+
+ - name: Get SDS details using name
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_name: "{{ sds_name_2 }}"
+ state: "present"
+
+ - name: Get SDS details using ID
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_id: "{{ result.sds_details }}"
+ state: "present"
+
+ - name: Modify SDS attributes using name
+ register: result
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_name: "{{ sds_name_1 }}"
+ sds_new_name: "{{ sds_name_1_new }}"
+ rfcache_enabled: false
+ rmcache_enabled: true
+ rmcache_size: 256
+ performance_profile: "HighPerformance"
+ state: "present"
+
+ - name: Modify SDS attributes using ID
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_id: "{{ result.sds_details }}"
+ sds_new_name: "{{ sds_name_1 }}"
+ rfcache_enabled: true
+ rmcache_enabled: true
+ rmcache_size: 210
+ performance_profile: "Compact"
+ state: "present"
+
+ - name: Add IP and role to an SDS
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_name: "{{ sds_name_1 }}"
+ sds_ip_list:
+ - ip: '**.**.**.**'
+ role: "sdcOnly"
+ sds_ip_state: "present-in-sds"
+ state: "present"
+
+ - name: Remove IP and role from an SDS
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_name: "{{ sds_name_1 }}"
+ sds_ip_list:
+ - ip: '**.**.**.**'
+ role: "sdcOnly"
+ sds_ip_state: "absent-in-sds"
+ state: "present"
+
+ - name: Delete SDS using name
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_name: "{{ sds_name_2 }}"
+ state: "absent"
+
+ - name: Delete SDS using ID
+ dellemc.powerflex.sds:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ port: "{{ host_port }}"
+ sds_id: "{{ result.sds_details }}"
+ state: "absent"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/snapshot.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/snapshot.yml
new file mode 100644
index 000000000..33975539c
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/snapshot.yml
@@ -0,0 +1,130 @@
+---
+- name: Snapshot Operations
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+
+ tasks:
+ - name: Create snapshot
+ register: result
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_name: "ansible_snapshot_1"
+ vol_name: "ansible_volume"
+ state: "present"
+
+ - name: Set snapshot id
+ ansible.builtin.set_fact:
+ snapshot_id: "{{ result.snapshot_details.id }}"
+
+ - name: Create snapshot with retention
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_name: "ansible_snapshot_2"
+ vol_name: "ansible_volume"
+ desired_retention: 2
+ state: "present"
+
+ - name: Get snapshot details using snapshot id
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_id: "{{ snapshot_id }}"
+ state: "present"
+
+ - name: Modify the retention
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_name: "ansible_snapshot_2"
+ desired_retention: 4
+ state: "present"
+
+ - name: Map snapshot to SDC
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_id: "{{ snapshot_id }}"
+ sdc:
+ - sdc_ip: '**.**.**.**'
+ - sdc_id: "663ac0d200000001"
+ allow_multiple_mappings: true
+ sdc_state: "mapped"
+ state: "present"
+
+ - name: Modify the attributes of SDC mapped to snapshot
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_id: "{{ snapshot_id }}"
+ sdc:
+ - sdc_ip: '**.**.**.**'
+ iops_limit: 11
+ bandwidth_limit: 4096
+ - sdc_id: "663ac0d200000001"
+ iops_limit: 20
+ bandwidth_limit: 2048
+ sdc_state: "mapped"
+ state: "present"
+
+ - name: Extend the size of snapshot
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_id: "{{ snapshot_id }}"
+ size: 16
+ state: "present"
+
+ - name: Unmap SDCs from snapshot
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_id: "{{ snapshot_id }}"
+ sdc:
+ - sdc_ip: '**.**.**.**'
+ - sdc_id: "663ac0d200000001"
+ sdc_state: "unmapped"
+ state: "present"
+
+ - name: Rename snapshot
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_id: "{{ snapshot_id }}"
+ snapshot_new_name: "ansible_renamed_snapshot"
+ state: "present"
+
+ - name: Delete snapshot
+ dellemc.powerflex.snapshot:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_id: "{{ snapshot_id }}"
+ remove_mode: "ONLY_ME"
+ state: "absent"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/snapshot_policy.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/snapshot_policy.yml
new file mode 100644
index 000000000..fd83a2a60
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/snapshot_policy.yml
@@ -0,0 +1,215 @@
+---
+- name: Snapshot Policy operations on powerflex array.
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ snapshot_policy_name: "Ansible_snap_policy_1"
+ source_volume_name1: "Ansible_volume_4"
+ source_volume_name2: "Ansible_volume_5"
+ snapshot_policy_name_new: "Ansible_snap_policy_1_new"
+
+ tasks:
+ - name: Create a snapshot policy in check mode
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name }}"
+ access_mode: "READ_WRITE"
+ secure_snapshots: false
+ auto_snapshot_creation_cadence:
+ time: 1
+ unit: "Hour"
+ num_of_retained_snapshots_per_level:
+ - 20
+ state: "present"
+ check_mode: true
+
+ - name: Create a snapshot policy
+ register: result
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name }}"
+ access_mode: "READ_WRITE"
+ secure_snapshots: false
+ auto_snapshot_creation_cadence:
+ time: 1
+ unit: "Hour"
+ num_of_retained_snapshots_per_level:
+ - 20
+ state: "present"
+
+ - name: Get snapshot policy details using name
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name }}"
+
+ - name: Get snapshot policy details using id
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_id: "{{ result.snapshot_policy_details.id }}"
+
+ - name: Modify a snapshot policy - check mode
+ register: result
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name }}"
+ auto_snapshot_creation_cadence:
+ time: 2
+ unit: "Hour"
+ num_of_retained_snapshots_per_level:
+ - 40
+ check_mode: true
+
+ - name: Modify a snapshot policy
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name }}"
+ auto_snapshot_creation_cadence:
+ time: 2
+ unit: "Hour"
+ num_of_retained_snapshots_per_level:
+ - 40
+
+ - name: Rename a snapshot policy
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name }}"
+ new_name: "{{ snapshot_policy_name_new }}"
+
+ - name: Add source volume - check mode
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ source_volume:
+ - name: "{{ source_volume_name1 }}"
+ - name: "{{ source_volume_name2 }}"
+ state: "present"
+ check_mode: true
+
+ - name: Add source volume
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ source_volume:
+ - name: "{{ source_volume_name1 }}"
+ - name: "{{ source_volume_name2 }}"
+ state: "present"
+
+ - name: Remove source volume - check mode
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ source_volume:
+ - name: "{{ source_volume_name1 }}"
+ auto_snap_removal_action: 'Remove'
+ state: "absent"
+ - name: "{{ source_volume_name2 }}"
+ auto_snap_removal_action: 'Remove'
+ state: "absent"
+ check_mode: true
+
+ - name: Remove source volume
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ source_volume:
+ - name: "{{ source_volume_name1 }}"
+ auto_snap_removal_action: 'Remove'
+ state: "absent"
+ - name: "{{ source_volume_name2 }}"
+ auto_snap_removal_action: 'Remove'
+ state: "absent"
+
+ - name: Pause snapshot policy - check mode
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ pause: true
+ check_mode: true
+
+ - name: Pause snapshot policy
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ pause: true
+
+ - name: Resume snapshot policy - check mode
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ pause: false
+ check_mode: true
+
+ - name: Resume snapshot policy
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ pause: false
+
+ - name: Delete snapshot policy - check mode
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ state: "absent"
+ check_mode: true
+
+ - name: Delete snapshot policy
+ dellemc.powerflex.snapshot_policy:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ snapshot_policy_name: "{{ snapshot_policy_name_new }}"
+ state: "absent"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/storagepool.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/storagepool.yml
new file mode 100644
index 000000000..7e7860a0a
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/storagepool.yml
@@ -0,0 +1,61 @@
+---
+- name: Storage Pool Module Operations on PowerFlex
+ hosts: localhost
+ connection: local
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ pool_name: "ansible_test_pool6"
+ protection_domain_name: "domain1"
+
+ tasks:
+ - name: Create a new Storage pool
+ register: result
+ dellemc.powerflex.storagepool:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ storage_pool_name: "{{ pool_name }}"
+ protection_domain_name: "{{ protection_domain_name }}"
+ media_type: "HDD"
+ state: "present"
+
+ - name: Set pool id
+ ansible.builtin.set_fact:
+ pool_id: "{{ result.storage_pool_details.id }}"
+
+ - name: Rename Storage pool by id
+ dellemc.powerflex.storagepool:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ storage_pool_id: "{{ pool_id }}"
+ storage_pool_new_name: "new_ansible_pool"
+ state: "present"
+
+ - name: Restore the name of Storage pool by id
+ dellemc.powerflex.storagepool:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ storage_pool_id: "{{ pool_id }}"
+ storage_pool_new_name: "{{ pool_name }}"
+ state: "present"
+
+
+ - name: Modify a Storage pool by name
+ dellemc.powerflex.storagepool:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ storage_pool_name: "ansible_test_pool"
+ protection_domain_name: "{{ protection_domain_name }}"
+ use_rmcache: true
+ use_rfcache: true
+ state: "present"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/volume.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/volume.yml
new file mode 100644
index 000000000..da5f255bb
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/volume.yml
@@ -0,0 +1,133 @@
+---
+- name: Volume operations on powerflex array.
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ protection_domain_name: "domain1"
+ storage_pool_name: "pool1"
+ snapshot_policy_name: "sample_snap_policy_1"
+ vol_name: "sample_ansible_volume_20"
+
+ tasks:
+ - name: Create a volume
+ register: result
+ dellemc.powerflex.volume:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ vol_name: "{{ vol_name }}"
+ storage_pool_name: "{{ storage_pool_name }}"
+ protection_domain_name: "{{ protection_domain_name }}"
+ snapshot_policy_name: "{{ snapshot_policy_name }}"
+ sdc:
+ - sdc_ip: '**.**.**.**'
+ - sdc_id: "663ac0d200000001"
+ allow_multiple_mappings: true
+ sdc_state: "mapped"
+ size: 8
+ state: "present"
+
+ - name: Set volume id
+ ansible.builtin.set_fact:
+ vol_id: "{{ result.volume_details.id }}"
+
+ - name: Get volume details using volume id
+ dellemc.powerflex.volume:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ vol_id: "{{ vol_id }}"
+ state: "present"
+
+ - name: Get volume details using volume name
+ dellemc.powerflex.volume:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ vol_name: "{{ vol_name }}"
+ state: "present"
+
+ - name: Modify the size
+ dellemc.powerflex.volume:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ vol_name: "{{ vol_name }}"
+ size: 16
+ state: "present"
+
+ - name: Map volume to SDC and remove snapshot policy
+ dellemc.powerflex.volume:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ vol_id: "{{ vol_id }}"
+ sdc:
+ - sdc_ip: '**.**.**.**'
+ - sdc_id: "663ac0d200000001"
+ allow_multiple_mappings: true
+ snapshot_policy_name: ""
+ auto_snap_remove_type: "remove"
+ sdc_state: "mapped"
+ state: "present"
+
+ - name: Modify the attributes of SDC mapped to volume
+ dellemc.powerflex.volume:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ vol_id: "{{ vol_id }}"
+ sdc:
+ - sdc_ip: '**.**.**.**'
+ iops_limit: 11
+ bandwidth_limit: 4096
+ - sdc_id: "663ac0d200000001"
+ iops_limit: 20
+ bandwidth_limit: 2048
+ allow_multiple_mappings: true
+ sdc_state: "mapped"
+ state: "present"
+
+ - name: Unmap SDCs from volume
+ dellemc.powerflex.volume:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ vol_id: "{{ vol_id }}"
+ sdc:
+ - sdc_ip: '**.**.**.**'
+ - sdc_id: "663ac0d200000001"
+ sdc_state: "unmapped"
+ state: "present"
+
+ - name: Rename volume
+ dellemc.powerflex.volume:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ vol_id: "{{ vol_id }}"
+ vol_new_name: "ansible_renamed_volume"
+ state: "present"
+
+ - name: Delete volume
+ dellemc.powerflex.volume:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ vol_id: "{{ vol_id }}"
+ delete_snapshots: true
+ state: "absent"