I’d like to introduce Incant (GitHub, PyPI). Incant is a frontend for Incus that provides a declarative way to define and manage development environments. It simplifies the creation, configuration, and provisioning of Incus instances using YAML-based configuration files.
In short, you can create an incant.yaml file with:
instances:
my-instance:
image: images:debian/12
vm: false # use a container, not a KVM virtual machine
provision:
- echo "Hello, World!"
- apt-get update && apt-get install -y curl
Then run incant up, and let Incant interact with Incus to orchestrate the provisioning of your instance.
It’s not really at the same level as cloud-init: in terms of stack, Incant is a wrapper around Incus, while Incus wraps cloud-init.
In theory (because I haven’t tried it), you could use Incant to describe and provision a set of Incus instances, and use cloud-init to configure those instances (and combine that with Incant’s provision stanzas to complete the configuration if needed).
I actually worded that wrong… I was looking for something to replace cloudinit to run a few commands within an shell of a container on startup. Good stuff so far, hope you keep it up.
This snippet is from a incant.yaml file I have in use:
``` provision: - ssh: true - copy: # copy a file using 'incus file push' source: ../setup-kernel.sh target: /usr/local/sbin/ mode: "0755" uid: 0 gid: 0 - | # an inlined script #!/bin/bash set -xe /usr/local/sbin/setup-kernel.sh
```
The ssh: true is realy cool. It installs SSH server in the guest and puts ~/.ssh/id_*.pub of running user into guest:/root/.ssh/authorized_keys