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
redfish: support boolean BIOS attributes #68254
redfish: support boolean BIOS attributes #68254
Conversation
Currently the redfish_config module will convert boolean bios_attribute_value settings to strings (type str). This will cause BMCs expecting booleans to error out. This PR will change the default type of bios_attribute_value to 'raw' in order to support strings and booleans. Additionally, it makes a minor tweak to set_bios_attributes() in redfish_utils.py to correctly serialize the python dict to JSON. Fixes ansible#68251
Thanks for opening the issue and providing the PR! LGTM shipit |
shipit |
@billdodd / @mraineri A few logistical questions: I created this PR for Also, I forgot to include a changelog fragment, just added with 9f00f2f. |
Good question. I just took a peek at the docs. It does look like the flow should start with devel and backport to previous releases:
See: https://docs.ansible.com/ansible/devel/community/development_process.html#backporting-merged-prs But note that devel is frozen right now while they do some migration activity. And once it is unfrozen, the PR will need to be made in the new Ansible Collections repo. More info on that: https://github.com/ansible-collections/overview/blob/master/README.rst |
The test
|
BTW - I think the change needed for devel is even simpler than the one for 2.9. It should just be to change the type for bios_attribute_value to raw. Should be no changes needed in redfish_utils.py and the new bios_attributes option already supports attribute values that are, for example, boolean or int. |
Hmm, I didn't know about this "freeze". Lemme at least get a new PR rolling for |
New PR for |
@jyundt Since this module has been migrated to the community.general collection, please open a PR for it there: https://github.com/ansible-collections/community.general/commits/master/plugins/modules/remote_management/redfish/redfish_config.py Once that PR has been merged open a backport PR and reference the merged PR in community.general. |
Currently the redfish_config module will convert boolean bios_attribute_value
settings to strings (type str). This will cause BMCs expecting booleans to
error out.
This PR will change the default type of bios_attribute_value to 'raw' in order
to support strings and booleans. Additionally, it makes a minor tweak to
set_bios_attributes() in redfish_utils.py to correctly serialize the python dict
to JSON.
Fixes #68251
SUMMARY
This fixes the behavior in Ansible 2.9 (also present in Ansible 2.8) that converts boolean based BIOS values to strings.
Note that I based this PR on
stable-2.9
and notdevel
. I think the changes introduced in #62764 will require slightly different change.Please let me know if I should rebase this PR on
devel
and create different PRs for backport requests for 2.8 and 2.9.Fixes #68251
Backport of #68382
ISSUE TYPE
COMPONENT NAME
redfish_config
redfish_utils.py
ADDITIONAL INFORMATION
Using the same ansible snippet from 68251, the playbook now works as expected:
cc @nlopez
(edit: fix formatting for ansible output.)