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
| Name | Type | Required | Description |
|---|---|---|---|
inventory_path | string | yes | Absolute path to the inventory directory. |
pattern | string | yes | Hostname pattern; expands {01..10} (zero-padded range) or {a,b,c} (list). |
nodes | list | yes | Proxmox node names to distribute hosts across (round-robin). |
provision | map | yes | Provision template; required keys type (proxmox_vm/proxmox_lxc) and cluster. |
groups | list | no | Group names to add the generated hosts to. |
vmid_start | int | no | Starting VMID; assigned sequentially per host. Omit for Proxmox auto-assign. |
ip_template | string | no | IP template with {} placeholder (e.g. 10.7.1.{}/24) or literal dhcp. |
ip_start | int | no | Number substituted into ip_template for the first host; increments. Default 1. |
gateway | string | no | Gateway IP; baked into net0 for LXC. |
state | string | no | present (create/update, default) or absent (remove host_vars and prune groups). |
save | string | no | Var 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