|
5 | 5 | set_fact: |
6 | 6 | _virtual_media_iso: "{{ virtual_media_iso | default(hostvars[item]['boot_iso']) }}" |
7 | 7 |
|
8 | | -- name: Dell - Power down machine prior to booting iso |
| 8 | +- name: "Dell - Power down machine prior to booting iso for {{ item }}" |
9 | 9 | shell: | |
10 | 10 | ipmitool -I lanplus -H {{ hostvars[item]['bmc_address'] }} -U {{ hostvars[item]['bmc_user'] }} -P {{ hostvars[item]['bmc_password'] }} chassis power off |
11 | 11 | ignore_errors: true |
12 | 12 | register: ipmi_poweroff |
13 | 13 |
|
14 | | -- name: Dell - Pause for power down |
| 14 | +- name: "Dell - Pause for power down for {{ item }}" |
15 | 15 | pause: |
16 | 16 | seconds: 10 |
17 | 17 | when: not ipmi_poweroff.failed |
|
35 | 35 | status_code: 202 |
36 | 36 | return_content: yes |
37 | 37 |
|
38 | | -- name: Dell - Check for Virtual Media |
| 38 | +- name: "Dell - Check for Virtual Media for {{ item }}" |
39 | 39 | uri: |
40 | 40 | url: "https://{{ hostvars[item]['bmc_address'] }}/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD" |
41 | 41 | user: "{{ hostvars[item]['bmc_user'] }}" |
|
54 | 54 | - name: Block to rescue incase of stuck virtual media |
55 | 55 | when: check_virtual_media.json.Image |
56 | 56 | block: |
57 | | - - name: Dell - Eject any CD Virtual Media |
| 57 | + - name: "Dell - Eject any CD Virtual Media for {{ item }}" |
58 | 58 | uri: |
59 | 59 | url: "https://{{ hostvars[item]['bmc_address'] }}/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.EjectMedia" |
60 | 60 | user: "{{ hostvars[item]['bmc_user'] }}" |
|
71 | 71 |
|
72 | 72 | rescue: |
73 | 73 | # Use racadm to address the failed redfish unmount of old virtual media |
74 | | - - name: Force mount of a existing image |
| 74 | + - name: "Force mount of a existing image for {{ item }}" |
75 | 75 | raw: racadm remoteimage -c -u "" -p "" -l http://{{ http_store_host }}:{{ http_store_port }}/{{ _virtual_media_iso }} |
76 | 76 | delegate_to: "{{ hostvars[item]['bmc_address'] }}" |
77 | 77 | vars: |
78 | 78 | ansible_user: "{{ hostvars[item]['bmc_user'] }}" |
79 | 79 | ansible_password: "{{ hostvars[item]['bmc_password'] }}" |
80 | 80 | ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' |
81 | 81 |
|
82 | | - - name: Force unmount of the existing image |
| 82 | + - name: "Force unmount of the existing image for {{ item }}" |
83 | 83 | raw: racadm remoteimage -d |
84 | 84 | delegate_to: "{{ hostvars[item]['bmc_address'] }}" |
85 | 85 | vars: |
86 | 86 | ansible_user: "{{ hostvars[item]['bmc_user'] }}" |
87 | 87 | ansible_password: "{{ hostvars[item]['bmc_password'] }}" |
88 | 88 | ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' |
89 | 89 |
|
90 | | -- name: DELL - Insert Virtual Media |
| 90 | +- name: "DELL - Insert Virtual Media for {{ item }}" |
91 | 91 | community.general.redfish_command: |
92 | 92 | category: Manager |
93 | 93 | command: VirtualMediaInsert |
|
100 | 100 | - CD |
101 | 101 | - DVD |
102 | 102 | resource_id: iDRAC.Embedded.1 |
| 103 | + timeout: 60 |
103 | 104 | register: result |
104 | 105 | until: not result.failed |
105 | | - retries: 5 |
| 106 | + retries: 10 |
106 | 107 | delay: 30 |
107 | 108 |
|
108 | | -- name: DELL - Power ON |
| 109 | +- name: "DELL - Power ON for {{ item }}" |
109 | 110 | community.general.redfish_command: |
110 | 111 | category: Systems |
111 | 112 | command: PowerOn |
112 | 113 | baseuri: "{{ hostvars[item]['bmc_address'] }}" |
113 | 114 | username: "{{ hostvars[item]['bmc_user'] }}" |
114 | 115 | password: "{{ hostvars[item]['bmc_password'] }}" |
| 116 | + timeout: 60 |
115 | 117 | register: result |
116 | 118 | until: not result.failed |
117 | | - retries: 5 |
| 119 | + retries: 10 |
118 | 120 | delay: 30 |
0 commit comments