Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fw_inventory_after.redfish_facts.firmware.entries[0].Version : use name instead of [0] #19

Closed
glimchb opened this issue Feb 20, 2024 · 0 comments · Fixed by #26 or #1
Closed

fw_inventory_after.redfish_facts.firmware.entries[0].Version : use name instead of [0] #19

glimchb opened this issue Feb 20, 2024 · 0 comments · Fixed by #26 or #1
Assignees

Comments

@glimchb
Copy link
Member

glimchb commented Feb 20, 2024

from #2

use https://docs.ansible.com/ansible/latest/collections/community/general/json_query_filter.html

example verbose log:

ok: [10.10.10.1 -> localhost] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "auth_token": null,
            "baseuri": "10.10.10.1",
            "category": [
                "Update"
            ],
            "command": [
                "GetFirmwareInventory"
            ],
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "timeout": null,
            "update_handle": null,
            "username": "root"
        }
    },
    "redfish_facts": {
        "firmware": {
            "entries": [
                {
                    "Id": "BMC_Firmware",
                    "Manufacturer": "",
                    "Name": "Software Inventory",
                    "SoftwareId": "0x0018",
                    "Status": {
                        "Conditions": [],
                        "Health": "OK",
                        "HealthRollup": "OK",
                        "State": "Enabled"
                    },
                    "Updateable": true,
                    "Version": "BF-23.10-5"
                },
                {
                    "Id": "Bluefield_FW_ERoT",
                    "Manufacturer": "NVIDIA",
                    "Name": "Software Inventory",
                    "SoftwareId": "0xFF00",
                    "Status": {
                        "Conditions": [],
                        "Health": "OK",
                        "HealthRollup": "OK",
                        "State": "Enabled"
                    },
                    "Updateable": true,
                    "Version": "00.02.0127.0000_n02"
                },
                {
                    "Id": "golden_image_arm",
                    "Name": "Software Inventory",
                    "SoftwareId": "",
                    "Status": {
                        "Conditions": [],
                        "Health": "OK",
                        "HealthRollup": "OK",
                        "State": "Enabled"
                    },
                    "Updateable": true,
                    "Version": "no valid golden_image_arm!!!!"
                },
                {
                    "Id": "golden_image_nic",
                    "Name": "Software Inventory",
                    "SoftwareId": "",
                    "Status": {
                        "Conditions": [],
                        "Health": "OK",
                        "HealthRollup": "OK",
                        "State": "Enabled"
                    },
                    "Updateable": true,
                    "Version": "no valid golden_image_nic!!!!"
                }
            ],
            "ret": true
        }
    }
}

TASK [get_bmc_facts : Extract BMC firmware version from inventory] **************************************************************************************************************************
task path: /home/user/ansible-opi-dpu/roles/get_bmc_facts/tasks/main.yml:17
ok: [10.10.10.1] => {
    "ansible_facts": {
        "bmc_firmware_version": "BF-23.10-5"
    },
    "changed": false
}
@glimchb glimchb self-assigned this Feb 20, 2024
glimchb added a commit to glimchb/ansible-opi-dpu that referenced this issue Feb 20, 2024
glimchb added a commit to glimchb/ansible-opi-dpu that referenced this issue Feb 20, 2024
glimchb added a commit to glimchb/ansible-opi-dpu that referenced this issue Feb 20, 2024
glimchb added a commit to glimchb/ansible-opi-dpu that referenced this issue Feb 21, 2024
glimchb added a commit to glimchb/ansible-opi-dpu that referenced this issue Feb 21, 2024
glimchb added a commit to glimchb/ansible-opi-dpu that referenced this issue Feb 21, 2024
glimchb added a commit that referenced this issue Feb 23, 2024
Fixes #19

Signed-off-by: Boris Glimcher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant