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 31309d9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
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'
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
python-dateutil>=2.8.2
antsibull-docs>=2.7.0
ansible-lint>=6.22.2
ansible-lint>=6.22.2
jmespath>=1.0.1
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') }}"

Check failure on line 19 in roles/get_bmc_facts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.15)

jinja[invalid]

You need to install "jmespath" prior to running json_query filter

Check failure on line 19 in roles/get_bmc_facts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.14)

jinja[invalid]

You need to install "jmespath" prior to running json_query filter

Check failure on line 19 in roles/get_bmc_facts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.16)

jinja[invalid]

You need to install "jmespath" prior to running json_query filter

Check failure on line 19 in roles/get_bmc_facts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.15)

jinja[invalid]

You need to install "jmespath" prior to running json_query filter

Check failure on line 19 in roles/get_bmc_facts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.16)

jinja[invalid]

You need to install "jmespath" prior to running json_query filter

Check failure on line 19 in roles/get_bmc_facts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.9, stable-2.14)

jinja[invalid]

You need to install "jmespath" prior to running json_query filter

Check failure on line 19 in roles/get_bmc_facts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.9, stable-2.15)

jinja[invalid]

You need to install "jmespath" prior to running json_query filter

Check failure on line 19 in roles/get_bmc_facts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.14)

jinja[invalid]

You need to install "jmespath" prior to running json_query filter

0 comments on commit 31309d9

Please sign in to comment.