-
Notifications
You must be signed in to change notification settings - Fork 0
/
redfish_vmedia_attach.yaml
56 lines (53 loc) · 1.46 KB
/
redfish_vmedia_attach.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
- hosts: managedHosts
gather_facts: false
collections:
- community.general
tasks:
- name: Check vmedia_url
tags: [always]
when: vmedia_url is not defined
run_once: true
fail:
msg: You must set vmedia_url.
- name: Attach media
tags: [attach]
delegate_to: localhost
uri:
method: POST
url: "{{ redfishBaseURL }}{{ redfishAttachVirtualMediaAction }}"
validate_certs: false
url_username: root
url_password: "{{ bmcPassword }}"
body_format: json
body:
Image: "{{ vmedia_url }}"
status_code:
- 200
- 204
register: result
ignore_errors: true
- name: Configure one-time boot from virtual media
tags: [configure-boot]
delegate_to: localhost
uri:
method: POST
url: '{{ redfishBaseURL }}{{ redfishOemImportConfigAction }}'
validate_certs: false
status_code:
- 200
- 202
body_format: json
body:
ShareParameters:
Target: ALL
ImportBuffer: >-
<SystemConfiguration>
<Component FQDD="iDRAC.Embedded.1">
<Attribute Name="ServerBoot.1#BootOnce">Enabled</Attribute>
<Attribute Name="ServerBoot.1#FirstBootDevice">VCD-DVD</Attribute>
</Component>
</SystemConfiguration>
register: boot
ignore_errors: true
- debug:
var: boot