Hardware Classification¶
Hardware classification in DRP is the process of automatically assigning workflows, profiles, and
parameters to machines based on their hardware characteristics. The classify content pack implements
a flexible rule engine that evaluates ordered test/action pairs against each machine and applies the
first matching set of actions. Classification typically runs early in the provisioning workflow, after
inventory collection, and determines which downstream workflow the machine will follow.
How the Classify Content Pack Works¶
The classifier reads its rules from the classify/classification-data parameter, which contains an
ordered list of test/action pairs. Each entry specifies a test (a condition to evaluate) and a list
of actions to apply if the test passes. An optional continue: true flag allows evaluation to
continue past the first matching rule.
The preferred approach is the per-stage (v2) pattern used by the universal pipeline elements. Each classify stage in a Pipeline Element references a named parameter (classify/classification-data-parameter) that holds its own ruleset. The universal Pipeline Elements (universal-discover, universal-hardware, etc.) include pre-built classification stages with these parameters already wired up — configure classification by setting those parameters on the global profile rather than creating new classify workflows.
The classifier also supports a simpler v1 (global) mode where a single classify/classification-data parameter contains all rules. This is legacy and not recommended for new deployments using the universal pipeline.
- v1 (global) — A single
classify/classification-dataparameter on the global profile. Simple but does not compose with pipeline elements. - v2 (per-stage) — Stage-level indirection via
classify/classification-data-parameter. Supports multiple independent classification passes and pipeline composition. Used by all universal Pipeline Elements.
Built-in Tests¶
The classifier provides a set of built-in test functions:
| Test | Description |
|---|---|
always |
Always matches; use as a default/catch-all |
has_mac <mac> |
Matches if the machine has the specified MAC address |
in_subnet <cidr> |
Matches if the machine's address is in the specified subnet |
has_inventory_value <field> <value> |
Matches if inventory/data[field] equals value |
Custom test and action functions can be added via the classify/custom-functions parameter, which
lists template names to load at classification time. This allows site-specific classification logic
without modifying the core content pack.
Universal Hardware Auto-Classifier¶
The recommended approach for hardware classification is to use the universal pipeline's built-in auto-classifier. The universal-hardware Pipeline Element runs a universal-hardware-classification stage that evaluates the universal/hardware-classification-list parameter to determine which classifier stages to run.
The default classifier (universal-hardware-classification-base) automatically adds profiles named universal-hw-<value> based on inventory data. For example, a machine with a Dell manufacturer entry will have the profile universal-hw-dell added. Operators create profiles with these names and populate them with parameters — no classifier rule authoring is required.
To configure hardware classification with the universal pipeline:
# See what classification stages are configured (default: universal-hardware-classification-base)
drpcli profiles get global param universal/hardware-classification-list
# Add a custom classification stage to run after the base classifier
drpcli profiles set global param universal/hardware-classification-list \
to '["universal-hardware-classification-base", "my-site-hardware-classifier"]'
The auto-classifier profiles are named universal-hw-<inventory-value> (e.g., universal-hw-dell, universal-hw-supermicro). Create these profiles with the parameters appropriate for each hardware class and the classifier will apply them automatically during universal-hardware execution.
Triggering Classification¶
In the universal pipeline, classification stages are embedded within each Pipeline Element — universal-discover, universal-hardware, universal-linux-install, etc. Classification runs automatically as part of normal pipeline execution. Manually triggering classification outside the pipeline is legacy behavior and should transition to the pipeline approach.
# For testing: manually run classification on a machine using the pipeline
drpcli machines workflow <machine-uuid> universal-discover
Classification and Workflow Selection¶
The change_workflow action is the primary mechanism for directing machines to the correct provisioning
path. Combined with the flexiflow content pack's ability to select stages based on parameter values,
classification creates a fully automated, policy-driven provisioning pipeline where machine hardware
characteristics determine the entire provisioning sequence without manual operator intervention.