New to Kestra?
Use blueprints to kickstart your first workflows.
Loop over a JSON server manifest, provision each machine, and register it as a typed VM asset in Kestra with environment, OS, Python version, and IP metadata.
Fleet provisioning usually ends with machines running and documentation missing. This blueprint iterates over a JSON server manifest, provisions each machine, and registers every one as a typed io.kestra.plugin.ee.assets.VM asset in the Kestra asset catalog with environment, OS, Python version, and IP address metadata. The result is a fleet whose inventory is generated by the provisioning run itself, ready to drive downstream flows such as targeted upgrades or security audits that select servers by metadata.
server_manifest flow variable holds a JSON array of servers, each with id, ip, os, env, and python_version. Replace it with your real manifest, or load one from a namespace file or an HTTP call.provision_servers task (io.kestra.plugin.core.flow.ForEach) iterates over the array, one iteration per server.parse_server_details (io.kestra.plugin.core.execution.SetVariables) parses {{ fromJson(taskrun.value) }} into named variables for readability.terraform_apply (io.kestra.plugin.scripts.shell.Commands on the Process task runner) simulates the provisioning step. Swap the echo commands for a real terraform apply, Ansible playbook, or cloud CLI call.register_asset (io.kestra.plugin.core.debug.Return) declares an assets.outputs entry per server: type io.kestra.plugin.ee.assets.VM, scoped to the flow namespace, with env, os, python_version, and ip_address metadata.webhook_trigger (io.kestra.plugin.core.trigger.Webhook), secured by PROVISION_WEBHOOK_KEY, lets a CI pipeline such as GitHub Actions start the run whenever the manifest changes.VM asset per manifest entry, with rich, queryable metadata.asset-upgrade-servers and asset-fleet-security-audit, which select machines with assets(metadata={...}).Terraform and Ansible provision machines but leave inventory to a CMDB that drifts. Kestra runs the provisioning and writes the catalog in the same execution, so the two can never disagree. ForEach gives per-server task runs with isolated logs and retries, the webhook trigger plugs into any CI system, and the asset metadata immediately powers downstream selection queries for upgrades and audits.
PROVISION_WEBHOOK_KEY: shared secret guarding the Webhook trigger.PROVISION_WEBHOOK_KEY secret to your Kestra instance.server_manifest variable to your fleet.VM asset per server with its metadata.io.kestra.plugin.core.namespace.DownloadFiles or from Git or S3.io.kestra.plugin.terraform.cli.TerraformCLI or an Ansible task.concurrencyLimit on the ForEach to provision servers in parallel.asset-fleet-security-audit with a Flow trigger so every provisioning run is audited immediately.