Skip to content

Commit

Permalink
feat: use json_query to avoid index
Browse files Browse the repository at this point in the history
Fixes #19

Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Feb 20, 2024
1 parent fc8cb25 commit e3cfad2
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check

- name: Install ansible lint
run: pip install ansible-lint --disable-pip-version-check
run: pip install ansible-lint jmespath --disable-pip-version-check

- name: Download migrated collection artifacts
uses: actions/download-artifact@v1
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ New Roles
---------

- opi.dpu.bmc_fw_update - Firmware update of DPU BMC
- opi.dpu.update_bmc_password - Update Password of DPU BMC for a given user.
4 changes: 4 additions & 0 deletions changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ objects:
description: Firmware update of DPU BMC
name: bmc_fw_update
version_added: 1.0.0
update_bmc_password:
description: Update Password of DPU BMC for a given user.
name: update_bmc_password
version_added: 1.0.0
plugins:
become: {}
cache: {}
Expand Down
3 changes: 3 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ releases:
- description: Firmware update of DPU BMC
name: bmc_fw_update
namespace: null
- description: Update Password of DPU BMC for a given user.
name: update_bmc_password
namespace: null
release_date: '2024-02-20'
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
python-dateutil>=2.8.2
jmespath>=1.0.1
antsibull-changelog>=0.25.0
antsibull-docs>=2.7.0
ansible-lint>=6.22.2
2 changes: 1 addition & 1 deletion roles/bmc_fw_update/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

- name: Print BMC Version
ansible.builtin.debug:
msg: "{{ get_bmc_facts_after.redfish_facts.firmware.entries[0].Version }}"
msg: "{{ bmc_firmware_version }}"

- name: Validate fw image changed from before
ansible.builtin.assert:
Expand Down
2 changes: 1 addition & 1 deletion roles/get_bmc_facts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

- name: Extract BMC firmware version from inventory
ansible.builtin.set_fact:
bmc_firmware_version: "{{ result.redfish_facts.firmware.entries[0].Version }}"
bmc_firmware_version: "{{ result.redfish_facts.firmware | community.general.json_query('entries[?Id==`BMC_Firmware`].Version') }}"

0 comments on commit e3cfad2

Please sign in to comment.