-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-redfish01.yml
28 lines (23 loc) · 1.02 KB
/
playbook-redfish01.yml
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
---
- name: A playbook to demo automating against RedFish APIs using community.general collection
hosts: redfish_apis # group name
connection: local # we need to run HTTP(s) to talk to the RedFish APIs
gather_facts: false
# collections:
# - community.general # to update / install, "ansible-galaxy collection install community.general"
tasks:
- name: Get CPU inventory
community.general.redfish_info:
category: Systems
command: GetCpuInventory
baseuri: "{{ baseuri }}" # baseurl of OOB controller
username: "{{ username }}" # un of OOB controller
password: "{{ password }}" # pw of OOB controller
register: result
- name: Display the _info we just collected
debug:
msg: "{{ result.redfish_facts.cpu.entries | to_nice_json }}" # "pretty print" JSON
- name: copy json to a file
copy:
content: "{{ result | to_nice_json }}"
dest: outputfile.json