Let’s talk about tags and how they can be useful for Inventory and Reporting.
If you have been following along with the Feature Friday series you already heard about using tags to find currently defined classes, variables and bundles, but they are also very useful for reporting.
In CFEngine Enterprise the inventory
and attribute_name
tags are special. A variable or class tagged with inventory
becomes visible in the Inventory subsystem in Mission Portal with the name given in the attribute_name
tag.
For example, if we define a string variable and tag it with inventory
and attribute_name=Responsible Person
:
vars:
"owner"
string => "Nick Anderson",
meta => { "inventory", "attribute_name=Responsible person" };
Responsible Person
will show up in Mission Portal as Inventory for the host:
Outside of Enterprise, you can leverage tags in creating your own reports, like the host info report in the Masterfiles Policy Framework which includes inventory
tagged variables sourced by variablesmatching_as_data()
.
Happy Friday! 🎉