-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: jagadeeshnv <Jagadeesh_N_V@Dell.com> Co-authored-by: felixs88 <Felix_S@Dell.com>
- Loading branch information
1 parent
106b2b8
commit 7df6adc
Showing
30 changed files
with
2,684 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
- hosts: hosts | ||
connection: local | ||
name: Dell OpenManage Ansible iDRAC Redfish Storage Controller service. | ||
gather_facts: False | ||
|
||
tasks: | ||
- name: Assign dedicated hot spare. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
volume_id: | ||
- "Disk.Virtual.0:RAID.Slot.1-1" | ||
target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" | ||
tags: | ||
- assign_dedicated_hot_spare | ||
|
||
- name: Assign global hot spare. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" | ||
tags: | ||
- assign_global_hot_spare | ||
|
||
- name: Set controller encryption key. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "SetControllerKey" | ||
controller_id: "RAID.Slot.1-1" | ||
key: "PassPhrase@123" | ||
key_id: "mykeyid123" | ||
tags: | ||
- set_controller_key | ||
|
||
- name: Rekey in LKM mode. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "ReKey" | ||
controller_id: "RAID.Slot.1-1" | ||
key: "NewPassPhrase@123" | ||
key_id: "newkeyid123" | ||
old_key: "OldPassPhrase@123" | ||
tags: | ||
- rekey_lkm | ||
|
||
- name: Rekey in SEKM mode. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "ReKey" | ||
controller_id: "RAID.Slot.1-1" | ||
mode: "SEKM" | ||
tags: | ||
- rekey_sekm | ||
|
||
- name: Remove controller key. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "RemoveControllerKey" | ||
controller_id: "RAID.Slot.1-1" | ||
tags: | ||
- remove_controller_key | ||
|
||
- name: Reset controller configuration. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "ResetConfig" | ||
controller_id: "RAID.Slot.1-1" | ||
tags: | ||
- reset_config |
128 changes: 128 additions & 0 deletions
128
examples/idrac_redfish_storage_controller_job_tracking.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
--- | ||
- hosts: hosts | ||
connection: local | ||
name: iDRAC Redfish storage controller service with job tracking. | ||
gather_facts: False | ||
vars: | ||
retries_count: 100 | ||
polling_interval: 10 | ||
all_ctrl_task_tags: | ||
- assign_dedicated_hot_spare | ||
- assign_global_hot_spare | ||
- set_controller_key | ||
- rekey_lkm | ||
- rekey_sekm | ||
- remove_controller_key | ||
- reset_config | ||
|
||
# Use a single tag to run each task with job tracker | ||
tasks: | ||
- name: Assign dedicated hot spare. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
volume_id: | ||
- "Disk.Virtual.0:RAID.Slot.1-1" | ||
target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" | ||
register: result | ||
tags: | ||
- assign_dedicated_hot_spare | ||
|
||
- name: Assign global hot spare. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" | ||
register: result | ||
tags: | ||
- assign_global_hot_spare | ||
|
||
- name: Set controller encryption key. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "SetControllerKey" | ||
controller_id: "RAID.Slot.1-1" | ||
key: "PassPhrase@123" | ||
key_id: "mykeyid123" | ||
register: result | ||
tags: | ||
- set_controller_key | ||
|
||
- name: Rekey in LKM mode. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "ReKey" | ||
controller_id: "RAID.Slot.1-1" | ||
key: "NewPassPhrase@123" | ||
key_id: "newkeyid123" | ||
old_key: "OldPassPhrase@123" | ||
register: result | ||
tags: | ||
- rekey_lkm | ||
|
||
- name: Rekey in SEKM mode. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "ReKey" | ||
controller_id: "RAID.Slot.1-1" | ||
mode: "SEKM" | ||
register: result | ||
tags: | ||
- rekey_sekm | ||
|
||
- name: Remove controller key. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "RemoveControllerKey" | ||
controller_id: "RAID.Slot.1-1" | ||
register: result | ||
tags: | ||
- remove_controller_key | ||
|
||
- name: Reset controller configuration. | ||
idrac_redfish_storage_controller: | ||
baseuri: "{{ baseuri }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
command: "ResetConfig" | ||
controller_id: "RAID.Slot.1-1" | ||
register: result | ||
tags: | ||
- reset_config | ||
|
||
- name: "iDRAC Job tracking" | ||
uri: | ||
url: "https://{{ baseuri }}{{ result.task.uri }}" | ||
user: "{{ username }}" | ||
password: "{{ password }}" | ||
method: "GET" | ||
use_proxy: yes | ||
status_code: 200, 202 | ||
return_content: yes | ||
validate_certs: no | ||
force_basic_auth: yes | ||
headers: | ||
Content-Type: "application/json" | ||
Accept: "application/json" | ||
register: result | ||
until: result.json.JobState == 'Completed' | ||
retries: "{{ retries_count }}" | ||
delay: "{{ polling_interval }}" | ||
tags: "{{ all_ctrl_task_tags }}" | ||
|
||
- name: "iDRAC job result." | ||
set_fact: | ||
job_details: "{{ result.json }}" | ||
failed_when: result.json.Message == "Failed" | ||
changed_when: result.json.Message != "Failed" | ||
tags: "{{ all_ctrl_task_tags }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.