Inventory templates
An inventory template declares typed input variables and ordered steps. Each step creates an object — for example, a tenant, site, device, VM, or IP address — and can reference objects created by earlier steps.
Where they live
Open Inventory → Templates. The list shows each template's name, slug, shape (variable and step counts), status, and last update; row actions are Run, Edit, Duplicate, and Delete. Below the list, Recent runs tracks executions across all templates.
| Status | Meaning |
|---|---|
draft | Being authored; duplicates are always created as drafts |
active | Ready to run |
archived | Kept for reference |
Variables
Variables are the template's typed inputs, filled in at run time:
| Value type | Notes |
|---|---|
string / integer / number / boolean | Scalar inputs |
json | Arbitrary JSON value |
resource_ref | Reference to an existing inventory object |
Each variable has a key, label, required flag, optional default and validation rules.
Steps
Each step creates one inventory object. Supported step resource types:
tenant, tenant_group, region, site_group, site, location, rack,
rack_role, rack_type, manufacturer, device_role, device_type,
platform, device, device_interface, cluster, cluster_type,
cluster_group, virtual_machine, vm_interface, ip_address.
A step's payload is a field/value map whose values may use placeholders:
{
"name": "{{device_name}}",
"status": "active",
"site_id": "{{steps.site.id}}",
"role_id": "{{device_role_id}}",
"device_type_id": "{{device_type_id}}"
}
{{variable_key}}— substituted from the run-time variable values.{{steps.<step_key>.id}}— the ID of an object created by an earlier step in the same run, so a device can land in the site the run just created.
Steps declare explicit dependencies (depends_on_step_keys) and a per-step
conflict policy for when a matching object already exists:
| Policy | Behaviour |
|---|---|
fail | Stop the step with an error |
skip | Leave the existing object untouched |
update_selected_fields | Update the existing object's templated fields |
The editor
Create Template opens a full-page editor with three sections — Details, Variables, Steps — validated live as you type: duplicate variable or step keys, missing required payload fields, and unknown or self-referencing dependencies are flagged per section. A sticky preview rail shows the resolved payloads (using default values) for every step.
Running a template
Run opens a two-stage dialog: fill in the variables, review the preview of
objects to be created, then start the run. Each run records per-step results —
status (success, failed, skipped), duration, created resource IDs, and
error messages — expandable under Recent runs. Run statuses: pending,
running, completed, completed_with_errors, failed.
Edit created objects in the inventory. Add a connection configuration to connect to devices and VMs, and assign access policies.
REST API
| Method | Path | Purpose |
|---|---|---|
GET / POST | /api/v1/inventory/templates | List / create templates |
GET / PUT / DELETE | /api/v1/inventory/templates/{id} | Read / update / delete |
POST | /api/v1/inventory/templates/{id}/preview-run | Server-side dry run |
POST | /api/v1/inventory/templates/{id}/runs | Start a run |
GET | /api/v1/inventory/templates/{id}/runs | List runs of a template |
GET | /api/v1/inventory/template-runs/{id}/steps | Per-step results of a run |
See the API reference for the full contract.
Related
- Inventory — the object model templates create into.
- Connection configuration — powering connect buttons on created devices and VMs.
- Inventory sync — populating inventory from an external system instead of templates.