-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.yml
32 lines (28 loc) · 912 Bytes
/
main.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
31
32
---
# tasks file for bmc_session
- name: Create session
community.general.redfish_command:
category: Sessions
command: CreateSession
baseuri: "{{ inventory_hostname }}"
username: "{{ dpu_bmc_username }}"
password: "{{ dpu_bmc_password }}"
delegate_to: "{{ bmc_session_delegate }}"
register: result
- name: Extract session details from login result
ansible.builtin.set_fact:
bmc_session_token: "{{ result.session.token }}"
bmc_session_uri: "{{ result.session.uri }}"
- name: Print Session Tokens
ansible.builtin.debug:
msg:
- "{{ bmc_session_token }}"
- "{{ bmc_session_uri }}"
- name: Delete session
community.general.redfish_command:
category: Sessions
command: DeleteSession
baseuri: "{{ inventory_hostname }}"
auth_token: "{{ bmc_session_token }}"
session_uri: "{{ bmc_session_uri }}"
delegate_to: "{{ bmc_session_delegate }}"