Skip to content

instantiate

!instantiate

Category: inventory

Generate inventory host_vars files and group memberships for a fleet of machines (runs on LOCAL inventory). Triggers the provision system by writing a provision block per host. Supports hostname-pattern expansion and round-robin node distribution.

Parameters

NameTypeRequiredDescription
inventory_pathstringyesAbsolute path to the inventory directory.
patternstringyesHostname pattern; expands {01..10} (zero-padded range) or {a,b,c} (list).
nodeslistyesProxmox node names to distribute hosts across (round-robin).
provisionmapyesProvision template; required keys type (proxmox_vm/proxmox_lxc) and cluster.
groupslistnoGroup names to add the generated hosts to.
vmid_startintnoStarting VMID; assigned sequentially per host. Omit for Proxmox auto-assign.
ip_templatestringnoIP template with {} placeholder (e.g. 10.7.1.{}/24) or literal dhcp.
ip_startintnoNumber substituted into ip_template for the first host; increments. Default 1.
gatewaystringnoGateway IP; baked into net0 for LXC.
statestringnopresent (create/update, default) or absent (remove host_vars and prune groups).
savestringnoVar name to record the generated hostname list into.

Examples

- !instantiate
  inventory_path: /opt/jetpack/inventory
  pattern: fleet-{01..05}.lon.riff.cc
  nodes: [bee, moth]
  vmid_start: 200
  ip_template: 10.7.1.{}/24
  ip_start: 230
  gateway: 10.7.1.1
  groups: [testfleet]
  provision:
    type: proxmox_lxc
    cluster: SpaceTempAgency
    memory: 2048
    cores: 4