Add Board Name and BIOS Version to data collection - #1
Conversation
Expose the ansible_board_name and ansible_bios_version facts, which are gathered by Ansible but were not surfaced anywhere in the output. - html_fancy: add optional (hidden by default) "Board Name" and "BIOS Version" overview columns, and rows in the hardware detail table. - markdown / markdown_split: add the matching detail rows. Both fields are useful for hardware inventory: board name distinguishes machines that share a product name, and BIOS version is needed to track firmware update campaigns.
There was a problem hiding this comment.
Pull request overview
This PR extends ansible-cmdb’s output templates to display two additional Ansible facts—ansible_board_name and ansible_bios_version—so users can distinguish similar product-name hardware and track firmware versions across fleets.
Changes:
- Add “Board Name” and “BIOS Version” as optional (hidden-by-default) overview columns in the
html_fancytemplate. - Add matching “Board name” and “BIOS version” rows to the hardware detail sections in
html_fancy,markdown, andmarkdown_split. - Use safe defaults (
default=''/.get(..., '')) so missing facts render blank instead of failing.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/ansiblecmdb/data/tpl/markdown.tpl | Adds Board name and BIOS version lines to the Hardware section using .get(..., ''). |
| src/ansiblecmdb/data/tpl/markdown_split_detail.tpl | Adds Board name and BIOS version lines to the Hardware section in split-detail Markdown output. |
| src/ansiblecmdb/data/tpl/html_fancy_defs.html | Adds two hidden-by-default overview columns and corresponding col_* accessors; adds two rows in the hardware detail table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge order for the 11 open PRsI merged all eleven locally to check they compose. Only two conflicts arise, and both have a resolution that is not the obvious one — details below so you don't have to rediscover them. Suggested order
The two conflicts are inherent pairwise (#1↔#2 and #6↔#10 touch the same lines), so no ordering avoids them — but nothing else collides, and reordering within the clean groups is safe. Conflict A — #1 vs #2,
|
Surfaces two facts that Ansible already gathers but that ansible-cmdb never displayed:
ansible_board_nameandansible_bios_version.Why
ansible_product_nameis identical across visibly different hardware.What changed
html_fancy: two new overview columns,Board NameandBIOS Version. Both arevisible: False, so the default view is unchanged — they're opt-in via the column toggles or-c.html_fancy: matching rows in the hardware detail table, next to Product serial.markdownandmarkdown_split: matching detail rows.All use
default='', so hosts without the facts render blank rather than erroring.Testing
Rendered
html_fancy,markdown, andmarkdown_splitagainst the bundledexample/inventory. New fields populate with real values (A06,5.06,6.00,VirtualBox) and render empty for hosts lacking the facts.Note: the vendored
lib/yaml*andlib/makodon't import on Python 3.10+ (collections.Hashablewas removed), so this was rendered against system PyYAML/Mako. Unrelated to this change.Note for the maintainer
I've opened a companion PR adding the
ansible_cmdlinefact. Both insert into the same column list, so whichever merges second will need a trivial one-line rebase. Happy to combine them into one PR if you'd prefer.