-
Notifications
You must be signed in to change notification settings - Fork 8
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: bmc fw update, passwd and reset roles #2
Conversation
f31e900
to
28eb2fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vars defined here cannot be given as a role input, So only role vars that are used in the role as a constant can go here.
update_image_file: "/tmp/{{ firmware.bmc }}" | ||
register: result_update_task | ||
|
||
- name: Print TASK id for tracking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Printing the values will not help the user to get this at later stage, good to add under the facts ex: role_name_facts.Taskid , so that in case the job is not finished even after the retries/delay. user has an hold of the task id to take up next action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sachin-apa see the code above I just added ansible.builtin.set_fact
. Is that what you had in mind ?
roles/bmc_fw_update/tasks/main.yml
Outdated
ansible.builtin.debug: | ||
msg: "{{ fw_inventory_after.redfish_facts.firmware.entries[0].Version }}" | ||
|
||
- ansible.builtin.assert: { that: "fw_inventory_before.redfish_facts.firmware.entries[0].Version != fw_inventory_after.redfish_facts.firmware.entries[0].Version" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add changed_when and failed_when condition for users to understand if the firmware was updated. it helps to set the meta fields changed, failed etc that can be used to check later in the playbook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Define defaults for the roles if applicable. the default vars are not mandatory fields that can be changed as part of the role input.
- Add meta/argument_specs.yml to that helps in validation, documentation, changelog of a role.
- Add meta/main.yml with the details of the author and other data.
- Lets add the lint, sanity checks as it becomes hectic to fix it.
- Role vars, register and fact vars need to follow naming convention that prefix role_name_
0e8c65e
to
8ef7968
Compare
@@ -1,2 +1,7 @@ | |||
--- | |||
# vars file for bmc_fw_update | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be in vars...
9673f54
to
4f1004f
Compare
Dockerfile
Outdated
@@ -1,2 +1,2 @@ | |||
FROM python:3.11 | |||
RUN pip install --no-cache-dir ansible | |||
RUN pip install --no-cache-dir ansible==9.2 |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Click Remediation section below to solve this issue
12da53f
to
e35b625
Compare
so, I took a cursory look at the pull request. Just a few comments to get started:
|
One more comment: before I run any command on the DPU BMC, I need to check the server is up and running, by calling a redfish command on the server BMC. Otherwise, all my DPU BMCs will fail as the DPU has no power. I tend to leave all these external dependencies out the individual roles, rather than including them in my roles. |
|
||
- name: Get Firmware Inventory | ||
ansible.builtin.include_role: | ||
name: get_bmc_facts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_bmc_facts sounds general, not specific to FW (UpdateService/FirmwareInventory/BMC_Firmware), I assume that later it will just grow which will make it retrieve unnecessary information and would result in more and more redfish calls.
I would either:
- add options to it, specifying what we want to retrieve
- not separate it to a different role and call FW directly in this role
I prefer [2] since it this is not something that will change in the future we care about a specific FW version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- we should separate if we want to re-use it
- we can rename to fw facts to be more specific
roles/bmc_fw_update/tasks/main.yml
Outdated
ansible.builtin.debug: | ||
msg: "{{ fw_inventory_before.redfish_facts.firmware.entries[0].Version }}" | ||
|
||
- name: Download firmware image {{ firmware.bmc }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the role needs to recive a firmware location as a parameter, if it is a valid url then download it, if it is a file then we expect it to be present on the machine running (this makes more sense when installing a large cluster)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, I can open an issue on this, so somebody can also contribute that part ...
or if i have more time I can also do it myself...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened #16
c1e902a
to
dc34c32
Compare
a98d82c
to
a9630ab
Compare
Signed-off-by: Boris Glimcher <[email protected]>
Signed-off-by: Boris Glimcher [email protected]