Debian Codegraph @

ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/tasks/main.yml

raw symbols SCIP
1 ---
2 - name: IDRAC Gather facts
3 module_defaults:
4 ansible.builtin.uri:
5 validate_certs: "{{ validate_certs }}"
6 ca_path: "{{ ca_path | default(omit) }}"
7 method: "{{ idrac_gather_facts_uri_method }}"
8 user: "{{ username | default(lookup('env', 'IDRAC_USERNAME')) }}"
9 password: "{{ password | default(lookup('env', 'IDRAC_PASSWORD')) }}"
10 timeout: "{{ https_timeout }}"
11 force_basic_auth: true
12 headers: "{{ idrac_gather_facts_uri_headers }}"
13 body_format: "{{ idrac_gather_facts_uri_body_format }}"
14 status_code: "{{ idrac_gather_facts_uri_status_code }}"
15 return_content: "{{ idrac_gather_facts_uri_return_content }}"
16 block:
17 - name: Check whether atleast one of 'IDRAC_USERNAME' or username is provided
18 ansible.builtin.fail:
19 msg: Ensure the value for environment variable 'IDRAC_USERNAME'
20 or the argument 'username' is set.
21 when: username is not defined and not lookup('env', 'IDRAC_USERNAME')
22
23 - name: Check whether atleast one of 'IDRAC_PASSWORD' or password is provided
24 ansible.builtin.fail:
25 msg: Ensure the value for environment variable 'IDRAC_PASSWORD'
26 or the argument 'password' is set.
27 when: password is not defined and not lookup('env', 'IDRAC_PASSWORD')
28
29 - name: Set default facts
30 ansible.builtin.set_fact:
31 idrac: {}
32 system: {}
33 bios: {}
34 controller: []
35 cpu: []
36 enclosure: []
37 enclosure_emm: []
38 fan: []
39 firmware: []
40 hostnic: []
41 license: []
42 memory: []
43 nic: []
44 backplane: []
45 power_supply: []
46 presence_and_status_sensor: []
47 sensor_battery: {}
48 intrusion_sensor: {}
49 voltages: []
50 virtual_disk: []
51 pcie_device: {}
52 physical_disk: []
53 power_metrics: []
54 thermal_metrics: []
55 memory_metrics: []
56 secure_boot: {}
57 idrac_gather_facts_error: {}
58
59 - name: Get connection
60 ansible.builtin.uri:
61 url: https://{{ hostname }}:{{ https_port }}/redfish/v1/Systems
62 register: idrac_gather_facts_connection
63 delegate_to: "{{ idrac_gather_facts_delegate }}"
64
65 - name: Fail when hostname or certificate is incorrect or invalid.
66 ansible.builtin.fail:
67 msg: "{{ idrac_gather_facts_connection.msg }}"
68 when: idrac_gather_facts_connection.status == -1
69
70 - name: Fail when credentials are incorrect or invalid.
71 ansible.builtin.fail:
72 msg: The authentication credentials included with this request
73 are missing or invalid.
74 when: idrac_gather_facts_connection.status == 401
75
76 - name: Get System, Manager and Chassis resource id.
77 ansible.builtin.include_tasks: __get_resource_id.yml
78
79 - name: Get target facts in loop
80 ansible.builtin.include_tasks: "{{
81 idrac_gather_facts_target_yml_map[item] }}"
82 loop: "{{ target }}"