From 37170ec8318f678ccf93081777b77f4c8884984d Mon Sep 17 00:00:00 2001 From: Nick Anderson Date: Fri, 19 Oct 2018 10:12:04 -0500 Subject: [PATCH] CFE-2927 Allow dmidefs inventory to be overridden via augments This change allows uses to override the default dmidecode attributes that are inventoried via augments. Being able to extend the inventoried attributes allows for more flexibility without having to maintain modifications to the vendored policy. Changelog: Title --- MPF.md | 34 ++++++++++++++++++++++++++++++++++ inventory/any.cf | 6 ++++++ 2 files changed, 40 insertions(+) diff --git a/MPF.md b/MPF.md index d3cb765f2d..e3236db22b 100644 --- a/MPF.md +++ b/MPF.md @@ -388,6 +388,40 @@ hosts. The following settings are defined in `controls/def.cf` can be set from an [augments file][Augments]. +### dmidecode inventory + +When dmidecode is present, some key system attributes are inventoried. The +inventoried attributes can be overridden by defining +`def.cfe_autorun_inventory_demidecode[dmidefs]` via augments. dmidecode queries +each key in dmidefs and tags the result with the value prefixed with +`attribute_name=` Note, as the dmidefs are overridden, you must supply all +desired inventory attributes. + +For example: + +```json +{ + "vars": { + "cfe_autorun_inventory_dmidecode": { + "dmidefs": { + "bios-vendor": "BIOS vendor", + "bios-version": "BIOS version", + "system-serial-number": "System serial number", + "system-manufacturer": "System manufacturer", + "system-version": "System version", + "system-product-name": "System product name", + "bios-release-date": "BIOS release date", + "chassis-serial-number": "Chassis serial number", + "chassis-asset-tag": "Chassis asset tag", + "baseboard-asset-tag": "Baseboard asset tag" + } + } + } +} +``` + +**History:** +- Introduced 3.13.0, 3.12.1, 3.10.5 ### mailto diff --git a/inventory/any.cf b/inventory/any.cf index 4f8da8dc14..882f4b7ec1 100644 --- a/inventory/any.cf +++ b/inventory/any.cf @@ -549,6 +549,12 @@ bundle agent cfe_autorun_inventory_dmidecode "system-uuid": "System UUID", }'); + # We override dmidefs from augments when we can. + + "dmidefs" -> { "CFE-2927" } + data => mergedata( "def.cfe_autorun_inventory_dmidecode[dmidefs]" ), + if => isvariable( "def.cfe_autorun_inventory_dmidecode[dmidefs]"); + # other dmidecode variables you may want: # baseboard-asset-tag # baseboard-manufacturer