Solve Issue #63: Add Support for Token Authentication and User/Pass Authentication in BMC Firmware Update#89
Conversation
|
@abhashsolanki18 thanks for fixing this |
305b124 to
689cb7e
Compare
Signed-off-by: abhash abhashsolanki18@gmail.com Signed-off-by: root <root@localhost.localdomain>
|
@glimchb i have rebased the commits now it should pass the ci. |
glimchb
left a comment
There was a problem hiding this comment.
- looks like linter fails on your changes, please fix
- i saw one place at the end when you don;t give neither user/pass nor auth token... looks like a bug...
Signed-off-by: Abhash Solanki <abhashsolanki18@gmail.com>
|
@glimchb |
roles/bmc_fw_update/tasks/main.yml
Outdated
| when: | ||
| - bmc_fw_update_reboot is true | ||
| - not bmc_fw_update_image_file is search(bmc_fw_update_got_fw_version | regex_search('[0-9-.]+')) | ||
| - not bmc_fw_update_image_file is search(bmc_fw_update_got_fw_version | regex_search('[0-9-.]+'))" |
This commit resolves multiple YAML linting issues in the `bmc_fw_update` task file. - Removed extra blank lines - Ensured all tasks are named - Improved task key order - Prefixed variable names appropriately These changes should ensure the playbook passes `yamllint` and `ansible-lint` checks. Signed-off-by: Abhash Solanki <abhashsolanki18@gmail.com>
|
Invalid workflow file: .github/workflows/docker-publish.yml#L13 @glimchb what is the error about? failing while executing docker workflow as well as openSSF workflow |
will check it |
Signed-off-by: Abhash Solanki <abhashsolanki18@gmail.com>
Signed-off-by: Abhash Solanki <abhashsolanki18@gmail.com>
| - name: Store current fw version | ||
| ansible.builtin.set_fact: | ||
| bmc_fw_update_cur_fw_version: "{{ vars.get_bmc_facts_all_fw_versions[bmc_fw_update_inventory_name] }}" | ||
| bmc_fw_update_cur_fw_version: "{{ get_bmc_facts_before.get_bmc_facts_all_fw_versions[bmc_fw_update_inventory_name] }}" |
There was a problem hiding this comment.
this doesn't work in my setup for some reason, let's try to understand why?
TASK [get_bmc_facts : Print all Versions] ***************************************************************************************************************************************************
task path: /opt/roles/get_bmc_facts/tasks/main.yml:54
ok: [172.22.4.2] => {
"msg": {
"6d53cf4d_bmc_firmware": "bf-24.01-5-0-gdd4a6159ce7.1704982350.6715245",
"bluefield_fw_erot": "4-15",
"dpu_atf": "",
"dpu_board": "",
"dpu_bsp": "",
"dpu_nic": "",
"dpu_node": "",
"dpu_ofed": "",
"dpu_os": "",
"dpu_sys_image": "",
"dpu_uefi": ""
}
}
TASK [bmc_fw_update : Store current fw version] *********************************************************************************************************************************************
task path: /opt/roles/bmc_fw_update/tasks/main.yml:24
fatal: [172.22.4.2]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'get_bmc_facts_all_fw_versions'. 'dict object' has no attribute 'get_bmc_facts_all_fw_versions'\n\nThe error appears to be in '/opt/roles/bmc_fw_update/tasks/main.yml': line 24, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Store current fw version\n ^ here\n"
}
| - name: Print BMC Version | ||
| ansible.builtin.debug: | ||
| msg: "{{ get_bmc_facts_all_fw_versions }}" | ||
| msg: "{{ get_bmc_facts_before.get_bmc_facts_all_fw_versions }}" |
There was a problem hiding this comment.
this doesn't work in my setup for some reason, let's try to understand why?
TASK [bmc_fw_update : Store current fw version] *********************************************************************************************************************************************
task path: /opt/roles/bmc_fw_update/tasks/main.yml:24
ok: [172.22.4.2] => {
"ansible_facts": {
"bmc_fw_update_cur_fw_version": "bf-24.01-5-0-gdd4a6159ce7.1704982350.6715245"
},
"changed": false
}
TASK [bmc_fw_update : Print BMC Version] ****************************************************************************************************************************************************
task path: /opt/roles/bmc_fw_update/tasks/main.yml:28
fatal: [172.22.4.2]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'get_bmc_facts_all_fw_versions'. 'dict object' has no attribute 'get_bmc_facts_all_fw_versions'\n\nThe error appears to be in '/opt/roles/bmc_fw_update/tasks/main.yml': line 28, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Print BMC Version\n ^ here\n"
}
|
@abhashsolanki18 I tested your changes and they fail, please fix I used for user/pass flow: I hit errors, so I had to make those changes: diff --git a/roles/bmc_fw_update/defaults/main.yml b/roles/bmc_fw_update/defaults/main.yml
index ba5ffaf..ba8a611 100644
--- a/roles/bmc_fw_update/defaults/main.yml
+++ b/roles/bmc_fw_update/defaults/main.yml
@@ -8,5 +8,5 @@ bmc_fw_update_reboot: true
bmc_fw_update_job_wait: true
bmc_fw_update_inventory_name: bmc_firmware
bmc_fw_update_image_file: /tmp/bf3-bmc-24.04-5_opn.fwpkg
-bmc_fw_update_image_url: https://content.mellanox.com/BlueField/BMC/24.04-5-Apr-2024/{{ bmc_fw_update_image_file | basename }}
+bmc_fw_update_image_url: https://www.mellanox.com/downloads/BlueField/BMC/24.04-5-Apr-2024/{{ bmc_fw_update_image_file | basename }}
https_port: 443
diff --git a/roles/bmc_fw_update/tasks/main.yml b/roles/bmc_fw_update/tasks/main.yml
index e37647c..93b8d05 100644
--- a/roles/bmc_fw_update/tasks/main.yml
+++ b/roles/bmc_fw_update/tasks/main.yml
@@ -23,11 +23,11 @@
- name: Store current fw version
ansible.builtin.set_fact:
- bmc_fw_update_cur_fw_version: "{{ get_bmc_facts_before.get_bmc_facts_all_fw_versions[bmc_fw_update_inventory_name] }}"
+ bmc_fw_update_cur_fw_version: "{{ vars.get_bmc_facts_all_fw_versions[bmc_fw_update_inventory_name] }}"
- name: Print BMC Version
ansible.builtin.debug:
- msg: "{{ get_bmc_facts_before.get_bmc_facts_all_fw_versions }}"
+ msg: "{{ get_bmc_facts_all_fw_versions }}"
- name: Check if firmware image exists locally {{ bmc_fw_update_image_file }}
ansible.builtin.stat:once fixed, I can test the same with token: |
|
|
||
| - name: Store fw version we installed | ||
| ansible.builtin.set_fact: | ||
| bmc_fw_update_got_fw_version: "{{ vars.get_bmc_facts_all_fw_versions[bmc_fw_update_inventory_name] }}" |
There was a problem hiding this comment.
this doesn't work in my setup for some reason, let's try to understand why?
will find out whats going wrong |
Issue Addressed: Resolves #63
Changes Made:
User/Password Authentication Block: For handling authentication using username and password.
Token Authentication Block: For handling authentication using tokens.
Details:
Updated the community.general.redfish_info task to support both authentication methods.
Ensured compatibility with existing configurations and backward compatibility.
@glimchb Please review these changes. Your feedback is appreciated!