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

feat: use json_query to avoid index #26

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,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') }}"
Loading