-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpower_state_XD670.yml
30 lines (25 loc) · 1007 Bytes
/
power_state_XD670.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
29
30
---
- hosts: xds
gather_facts: yes
connection: local
name: version 1.0 Get Power State of HPE Cray XD670 model nodes
vars:
bmc_username: "{{ inputs[inventory_hostname].user }}"
bmc_password: "{{ inputs[inventory_hostname].password }}"
baseuri: "{{ ansible_ssh_host }}"
tasks:
- name: Power states of the nodes will be uploaded to the below csv file
set_fact:
output_file: "Power_State_CrayXD670_{{ ansible_date_time.date }}_{{ ansible_date_time.time }}.csv"
run_once: True
- name: Getting Power State of Cray XD670 Server nodes
get_power_state:
category: Get_Power_State
command: Get_PS
baseuri: "{{ baseuri }}"
username: "{{ bmc_username }}"
password: "{{ bmc_password }}"
output_file_name: "{{ output_file }}"
register: system_fw_update_output
- name: Writing Power status details to {{output_file}} file
shell: echo {{system_fw_update_output.msg}} >> {{ output_file }}