summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/powerflex/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/dellemc/powerflex/playbooks')
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/info.yml57
-rw-r--r--ansible_collections/dellemc/powerflex/playbooks/modules/resource_group.yml71
2 files changed, 128 insertions, 0 deletions
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/info.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/info.yml
index b1a16785a..fac8af87e 100644
--- a/ansible_collections/dellemc/powerflex/playbooks/modules/info.yml
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/info.yml
@@ -78,3 +78,60 @@
filter_value: "partial"
sort: name
limit: 10
+
+ - name: Get the list of firmware repository
+ dellemc.powerflex.info:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ gather_subset:
+ - firmware_repository
+
+ - name: Get the list of firmware repository
+ dellemc.powerflex.info:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ gather_subset:
+ - firmware_repository
+ include_related: true
+ include_bundles: true
+ include_components: true
+
+ - name: Get the list of firmware repository with filter
+ dellemc.powerflex.info:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ gather_subset:
+ - firmware_repository
+ filters:
+ - filter_key: "createdBy"
+ filter_operator: "equal"
+ filter_value: "admin"
+ sort: createdDate
+ limit: 10
+ include_related: true
+ include_bundles: true
+ include_components: true
+ register: result_repository_out
+
+ - name: Get the list of available firmware repository
+ ansible.builtin.debug:
+ msg: "{{ result_repository_out.FirmwareRepository |
+ selectattr('state', 'equalto', 'available') }}"
+
+ - name: Get the list of software components in the firmware repository
+ ansible.builtin.debug:
+ msg: "{{ result_repository_out.FirmwareRepository |
+ selectattr('id', 'equalto', '8aaa80788b7') |
+ map(attribute='softwareComponents') | flatten }}"
+
+ - name: Get the list of software bundles in the firmware repository
+ ansible.builtin.debug:
+ msg: "{{ result_repository_out.FirmwareRepository |
+ selectattr('id', 'equalto', '8aaa80788b7') |
+ map(attribute='softwareBundles') | flatten }}"
diff --git a/ansible_collections/dellemc/powerflex/playbooks/modules/resource_group.yml b/ansible_collections/dellemc/powerflex/playbooks/modules/resource_group.yml
new file mode 100644
index 000000000..2cbc22e55
--- /dev/null
+++ b/ansible_collections/dellemc/powerflex/playbooks/modules/resource_group.yml
@@ -0,0 +1,71 @@
+---
+- name: Resource group operations on PowerFlex array.
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ vars:
+ hostname: 'x.x.x.x'
+ username: 'admin'
+ password: 'Password'
+ validate_certs: false
+ host_port: 443
+ resource_group_name_1: "ans_rg"
+ node_1: "vpi2170"
+ template_id: "c65d0172-8666-48ab-935e-9a0bf69ed66d"
+
+ tasks:
+ - name: Validate deployment of a resource group
+ register: result
+ dellemc.powerflex.resource_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ resource_group_name: "{{ resource_group_name_1 }}"
+ description: ans_rg
+ template_id: "{{ template_id }}"
+ firmware_repository_name: "PowerFlex 4.5.0.0"
+ validate: true
+
+ - name: Deploy a resource group
+ register: result
+ dellemc.powerflex.resource_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ resource_group_name: "{{ resource_group_name_1 }}"
+ description: ans_rg
+ template_id: "{{ template_id }}"
+ firmware_repository_name: "PowerFlex 4.5.0.0"
+
+ - name: Add a node to a resource group
+ dellemc.powerflex.resource_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ resource_group_name: "{{ resource_group_name_1 }}"
+ scaleup: true
+ clone_node: "{{ node_1 }}"
+ node_count: 2
+
+ - name: Modify a resource group
+ dellemc.powerflex.resource_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ resource_group_name: "{{ resource_group_name_1 }}"
+ new_resource_group_name: "new_resource_group_name"
+ description: "description new"
+
+ - name: Delete a resource group
+ register: result
+ dellemc.powerflex.resource_group:
+ hostname: "{{ hostname }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ validate_certs: "{{ validate_certs }}"
+ resource_group_name: "{{ resource_group_name_1 }}"
+ state: "absent"