diff options
Diffstat (limited to 'ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule')
24 files changed, 174 insertions, 111 deletions
diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/backplane/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/backplane/converge.yml index adb6fcf5f..9aab189c2 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/backplane/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/backplane/converge.yml @@ -4,9 +4,9 @@ connection: local gather_facts: true vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - PCIeSSDBackPlane @@ -23,22 +23,44 @@ - 404 - -1 idrac_gather_facts_uri_return_content: true - diff_data: {} - exclude_keys: [] tasks: + - name: Collecting PCIeSSDBackPlane information from API + ansible.builtin.uri: + url: "https://{{ hostname }}/redfish/v1/Chassis/Oem/Dell/DellPCIeSSDBackPlanes" + validate_certs: "{{ validate_certs }}" + ca_path: "{{ ca_path | default(omit) }}" + method: "{{ idrac_gather_facts_uri_method }}" + user: "{{ username }}" + password: "{{ password }}" + headers: "{{ idrac_gather_facts_uri_headers }}" + body_format: "{{ idrac_gather_facts_uri_body_format }}" + status_code: "{{ idrac_gather_facts_uri_status_code }}" + return_content: "{{ idrac_gather_facts_uri_return_content }}" + register: backplane_result_url + no_log: true + + - name: Validate whether PCIeSSDBackPlane information exists + ansible.builtin.assert: + that: + - "{{ backplane_result_url.json.Members | length > 0 }}" + fail_msg: "PCIeSSDBackPlane information does not exist" + + - name: Set PCIeSSDBackPlane facts + ansible.builtin.set_fact: + api_response: "{{ backplane_result_url.json.Members | ansible.utils.remove_keys(target=['@odata.context', '@odata.id', '@odata.type']) }}" + - name: Gather Facts for the PCIeSSDBackPlane component ansible.builtin.include_role: name: "idrac_gather_facts" - - name: Assert backplane dict for length + - name: Check whether output differs + ansible.builtin.set_fact: + result_diff: "{{ backplane | symmetric_difference(api_response) }}" + + - name: Assert the differences in List ansible.builtin.assert: + fail_msg: "The response from the role does not match" + success_msg: "The response from the role matches" that: - - "{{ backplane | length > 0 }}" - - - name: Call assertion - ansible.builtin.include_tasks: ../../tests/asserts/backplane_assert.yml - with_items: "{{ backplane }}" - loop_control: - loop_var: backplane_data - when: backplane | length > 0 + - "{{ (result_diff | length) == 0 }}" diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/bios/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/bios/converge.yml index 491d49d42..6d8bf0b66 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/bios/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/bios/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - BIOS diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/controller/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/controller/converge.yml index e7059f6a7..8e6ade139 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/controller/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/controller/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - Controller diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/default/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/default/converge.yml index 3d3f3ed1d..58d622a57 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/default/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/default/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - System @@ -68,10 +68,8 @@ - name: Response filter ansible.builtin.set_fact: api_response: - "{{ system_result.json | json_query(jquery) | combine(os_result.json.Attributes) | + "{{ system_result.json.Oem.Dell.DellSystem | combine(os_result.json.Attributes) | ansible.utils.remove_keys(target=['@odata.context', '@odata.id', '@odata.type']) }}" - vars: - jquery: "Oem.Dell.DellSystem" - name: Set the keys diff ansible.builtin.set_fact: diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/enclosure/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/enclosure/converge.yml index f83d84ac7..c43f9390a 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/enclosure/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/enclosure/converge.yml @@ -4,9 +4,9 @@ connection: local gather_facts: true vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - Enclosure diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/enclosureemm/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/enclosureemm/converge.yml index 9bddda5a7..e240180b1 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/enclosureemm/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/enclosureemm/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - EnclosureEMM diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/fan/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/fan/converge.yml index bdd47a873..7b17ce7dd 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/fan/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/fan/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - Fan diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/firmware/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/firmware/converge.yml index 88047ce5c..a1fa26117 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/firmware/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/firmware/converge.yml @@ -4,9 +4,9 @@ connection: local gather_facts: true vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - Firmware diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/hostnic/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/hostnic/converge.yml index 1ab1f4911..c7dff509f 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/hostnic/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/hostnic/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - HostNIC diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/idrac/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/idrac/converge.yml index 2b8788274..19e8bf7f5 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/idrac/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/idrac/converge.yml @@ -4,9 +4,9 @@ connection: local gather_facts: true vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - IDRAC diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/license/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/license/converge.yml index b1fe0419b..8e5609448 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/license/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/license/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - License diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/memory/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/memory/converge.yml index 5a3909481..b21c6ecdc 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/memory/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/memory/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - Memory diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/negative/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/negative/converge.yml index b191098a8..6062027e6 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/negative/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/negative/converge.yml @@ -8,8 +8,8 @@ name: idrac_gather_facts vars: hostname: "randomHostname" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false ignore_errors: true ignore_unreachable: true @@ -24,9 +24,9 @@ ansible.builtin.import_role: name: idrac_gather_facts vars: - hostname: "{{ lookup('env', 'hostname') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" username: "randomUsername" - password: "{{ lookup('env', 'password') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: ["Bios"] ignore_errors: true @@ -42,8 +42,8 @@ ansible.builtin.import_role: name: idrac_gather_facts vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" password: "randomPassword" validate_certs: false target: ["Bios"] @@ -56,30 +56,35 @@ that: - idrac_gather_facts_connection.status == -1 + - name: Set computer system id + ansible.builtin.set_fact: + system_id: "randomSystemID" + - name: To check for wrong system id ansible.builtin.import_role: name: idrac_gather_facts vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false - computer_system_id: "randomSystemID" + computer_system_id: "{{ system_id }}" ignore_errors: true register: idrac_gather_facts_error - name: Asserting after performing operation with invalid system id ansible.builtin.assert: that: - - "{{ computer_system_id not in system_ids }}" + - "{{ computer_system_id is not in system_ids}}" + when: system_ids is defined - name: To check for wrong manager id ansible.builtin.import_role: name: idrac_gather_facts vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false manager_id: "randomManagerID" target: ["Firmware"] diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/nic/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/nic/converge.yml index 70d00f200..c12fee4af 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/nic/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/nic/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - NIC diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/passensor/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/passensor/converge.yml index 93de081d3..c4d86a62b 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/passensor/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/passensor/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - PresenceAndStatusSensor diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/pciedevice/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/pciedevice/converge.yml index b87459d13..924a8fd39 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/pciedevice/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/pciedevice/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - PCIeDevice diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/physicaldisk/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/physicaldisk/converge.yml index a5b66a7f9..ef2414535 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/physicaldisk/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/physicaldisk/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - PhysicalDisk @@ -27,18 +27,60 @@ api_system: "/redfish/v1/Systems/System.Embedded.1" tasks: + - name: Get Storage information. + ansible.builtin.uri: &uri_params + url: "https://{{ hostname }}{{ api_system }}/Storage" + validate_certs: "{{ validate_certs }}" + ca_path: "{{ ca_path | default(omit) }}" + method: "{{ idrac_gather_facts_uri_method }}" + user: "{{ username }}" + password: "{{ password }}" + headers: "{{ idrac_gather_facts_uri_headers }}" + body_format: "{{ idrac_gather_facts_uri_body_format }}" + status_code: "{{ idrac_gather_facts_uri_status_code }}" + return_content: "{{ idrac_gather_facts_uri_return_content }}" + register: idrac_gather_facts_controllers_result + + - name: Get all storage controller ids. + ansible.builtin.set_fact: + storage_ids_list: "{{ idrac_gather_facts_controllers_result.json.Members | map('dict2items') | flatten | map(attribute='value') }}" + + - name: Get physical disk information using API. + ansible.builtin.uri: + url: "https://{{ hostname }}{{ item }}?$expand=*($levels=1)" + <<: *uri_params + loop: "{{ storage_ids_list }}" + no_log: true + register: idrac_gather_facts_disk_result + + - name: Count the number of drives in drives_result.results + ansible.builtin.set_fact: + drives_count: "{{ idrac_gather_facts_disk_result.results | map(attribute='json.drives') | list | length }}" + + - name: Validate whether physical disk information exists + ansible.builtin.assert: + that: + - "{{ drives_count | int > 0 }}" + fail_msg: "Physical Disk information does not exist" + + - name: Set Physical Disk facts + ansible.builtin.set_fact: + api_response: + "{{ disk_result.results | selectattr('json', 'defined') | map(attribute='json') | selectattr('Drives', 'defined') | + map(attribute='Drives') | flatten | ansible.utils.remove_keys(target=['@odata.context', '@odata.id', '@odata.type', + 'Actions', 'Assembly', 'Links', 'DellDriveSMARTAttributes', 'DellNVMeSMARTAttributes', 'Operations@odata.count']) }}" + - name: Gather Facts for the Physical Disk component ansible.builtin.include_role: name: "idrac_gather_facts" - - name: Assert physical disk dict for length + - name: Check whether output differs + ansible.builtin.set_fact: + result_diff: "{{ physical_disk | symmetric_difference(api_response) }}" + + - name: Assert the differences in List ansible.builtin.assert: + fail_msg: "The response from the role does not match" + success_msg: "The response from the role matches" that: - - "{{ physical_disk | length > 0 }}" - - - name: Call assertion - ansible.builtin.include_tasks: ../../tests/asserts/physicaldisk_assert.yml - with_items: "{{ physical_disk }}" - loop_control: - loop_var: pd_data - when: physical_disk | length > 0 + - "{{ (result_diff | length) == 0 }}" diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/powersupply/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/powersupply/converge.yml index 1fdb5a278..0f648b875 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/powersupply/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/powersupply/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - PowerSupply diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/secureboot/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/secureboot/converge.yml index e4585165e..88fdc4ea6 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/secureboot/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/secureboot/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - SecureBoot diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsbattery/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsbattery/converge.yml index feee7473e..ab19c7cd2 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsbattery/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsbattery/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - Sensors_Battery diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsintrusion/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsintrusion/converge.yml index 274319cff..4fca00ba1 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsintrusion/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsintrusion/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - Sensors_Intrusion diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsvoltage/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsvoltage/converge.yml index 16435ef11..378022256 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsvoltage/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/sensorsvoltage/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - Sensors_Voltage diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/systemmetrics/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/systemmetrics/converge.yml index acd31a108..418aa2b78 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/systemmetrics/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/systemmetrics/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - SystemMetrics @@ -88,13 +88,9 @@ register: response_power_supply no_log: true - - name: Set query - ansible.builtin.set_fact: - jq: "[*].Id" - - name: Get Power Supply Metrics ids ansible.builtin.set_fact: - psu_ids: "{{ power_result.json.Members | json_query(jq) }}" + psu_ids: "{{ power_result.json.Members | map(attribute='Id') | list }}" - name: Call assertion for Power metrics ansible.builtin.include_tasks: ../../tests/asserts/psmetrics_assert.yml diff --git a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/virtualdisk/converge.yml b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/virtualdisk/converge.yml index 27fd2b829..5c3486634 100644 --- a/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/virtualdisk/converge.yml +++ b/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/virtualdisk/converge.yml @@ -3,9 +3,9 @@ hosts: all gather_facts: false vars: - hostname: "{{ lookup('env', 'hostname') }}" - username: "{{ lookup('env', 'username') }}" - password: "{{ lookup('env', 'password') }}" + hostname: "{{ lookup('env', 'IDRAC_IP') }}" + username: "{{ lookup('env', 'IDRAC_USER') }}" + password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" validate_certs: false target: - VirtualDisk |