Debian Codegraph @

ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/idrac-10668/converge.yml

raw symbols SCIP
1 ---
2 - name: Converge idrac_gather_facts for idrac
3 hosts: all
4 connection: local
5 gather_facts: true
6 vars:
7 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
8 username: "{{ lookup('env', 'IDRAC_USER') }}"
9 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
10 validate_certs: false
11 target:
12 - IDRAC
13 idrac_gather_facts_uri_method: "GET"
14 idrac_gather_facts_uri_headers:
15 Accept: "application/json"
16 Content-Type: "application/json"
17 OData-Version: "4.0"
18 idrac_gather_facts_uri_body_format: "json"
19 idrac_gather_facts_uri_status_code:
20 - 200
21 - 400
22 - 401
23 - 404
24 - -1
25 idrac_gather_facts_uri_return_content: true
26 diff_data: {}
27 exclude_keys: ["ServerOS.1.ServerPoweredOnTime", "SystemInfo.1.SysTime"]
28
29 tasks:
30 - name: Gather Facts for idrac component
31 ansible.builtin.include_role:
32 name: "idrac_gather_facts"
33
34 - name: Get System information.
35 ansible.builtin.uri:
36 url: "https://{{ hostname }}{{ api_manager }}/Oem/Dell/DellAttributes/System.Embedded.1"
37 validate_certs: "{{ validate_certs }}"
38 ca_path: "{{ ca_path | default(omit) }}"
39 method: "{{ idrac_gather_facts_uri_method }}"
40 user: "{{ username }}"
41 password: "{{ password }}"
42 headers: "{{ idrac_gather_facts_uri_headers }}"
43 body_format: "{{ idrac_gather_facts_uri_body_format }}"
44 status_code: "{{ idrac_gather_facts_uri_status_code }}"
45 return_content: "{{ idrac_gather_facts_uri_return_content }}"
46 register: response_sys_attr
47 ignore_errors: true
48 no_log: false
49
50 - name: Get Manager information.
51 ansible.builtin.uri:
52 url: "https://{{ hostname }}{{ api_manager }}/Oem/Dell/DellAttributes/iDRAC.Embedded.1"
53 validate_certs: "{{ validate_certs }}"
54 ca_path: "{{ ca_path | default(omit) }}"
55 method: "{{ idrac_gather_facts_uri_method }}"
56 user: "{{ username }}"
57 password: "{{ password }}"
58 headers: "{{ idrac_gather_facts_uri_headers }}"
59 body_format: "{{ idrac_gather_facts_uri_body_format }}"
60 status_code: "{{ idrac_gather_facts_uri_status_code }}"
61 return_content: "{{ idrac_gather_facts_uri_return_content }}"
62 register: response_mgr_attr
63 ignore_errors: true
64 no_log: true
65
66 - name: Get Lifecycle controller information.
67 ansible.builtin.uri:
68 url: "https://{{ hostname }}{{ api_manager }}/Oem/Dell/DellAttributes/LifecycleController.Embedded.1"
69 validate_certs: "{{ validate_certs }}"
70 ca_path: "{{ ca_path | default(omit) }}"
71 method: "{{ idrac_gather_facts_uri_method }}"
72 user: "{{ username }}"
73 password: "{{ password }}"
74 headers: "{{ idrac_gather_facts_uri_headers }}"
75 body_format: "{{ idrac_gather_facts_uri_body_format }}"
76 status_code: "{{ idrac_gather_facts_uri_status_code }}"
77 return_content: "{{ idrac_gather_facts_uri_return_content }}"
78 register: response_lc_attr
79 ignore_errors: true
80 no_log: true
81
82 - name: Set System, Manager, Lifecycle controller facts
83 ansible.builtin.set_fact:
84 api_idrac:
85 api_system_attributes: "{{ response_sys_attr.json.Attributes }}"
86 api_manager_attributes: "{{ response_mgr_attr.json.Attributes }}"
87 api_lifecycle_controller_attributes: "{{ response_lc_attr.json.Attributes }}"
88 when: response_sys_attr.status == 200 and response_mgr_attr.status == 200
89 and response_lc_attr.status == 200
90
91 - name: Call assertion For System Attributes
92 ansible.builtin.include_tasks: ../../tests/asserts/system_assert.yml
93 when: api_idrac is defined and idrac is defined
94
95 - name: Call assertion For LC Attributes
96 ansible.builtin.include_tasks: ../../tests/asserts/lc_assert.yml
97 when: api_idrac is defined and idrac is defined
98
99 - name: Call assertion For Manager Attributes
100 ansible.builtin.include_tasks: ../../tests/asserts/manager_assert.yml
101 when: api_idrac is defined and idrac is defined