Expand description
Defaults: settings that aren’t the spec’s business but a person’s or a team’s, in layers, the last one winning:
- built in (the image table in
crate::images, each cloud’s region in its generator), - the user’s file,
$ISOLOOM_HOME/defaults.yml(~/.isoloom/defaults.yml), - the project’s file,
isoloom.defaults.ymlnext to the spec (committed: the team’s), - environment variables
ISOLOOM_<KEY>,__standing for a dot (ISOLOOM_CLOUD__AWS__REGION), - the command line,
-s defaults.<key>=<value>.
Mappings deep-merge, so a file that sets one region leaves the others alone. The same -s
without the defaults. prefix overrides the spec itself (-s machines.web.vm.os=ubuntu@24.04),
for one run.
images: # the image table (see Images): OS images, the access machine
os: { debian-12: { vagrant: my-org/debian-12 } }
access: { docker: kalilinux/kali-rolling, vm: kali }
vagrant:
provider: libvirt # `isothrum up` passes --provider
cloud:
aws: { region: eu-west-1 }
azure: { region: westeurope }Structs§
- Cloud
- One cloud’s entry in the defaults’
cloud:section. - Defaults
- The typed defaults, once the layers are merged. Unknown keys are errors.
- Layer
- One layer’s contribution: where it came from, and what it set.
- Resolved
- The merged defaults with, for every leaf, the layer that set it last.
- Sources
- What a project’s defaults are read from: the project, the
--imagestable, its profile, the command’s-sand the host it runs on. - Vagrant
- The defaults’
vagrant:section.
Constants§
- BUILTIN_
REGIONS - Each cloud’s built-in region, as its generator writes it. A test keeps them equal.
- PROJECT_
FILE - The project-level file, next to
isoloom.yml.
Functions§
- apply_
to_ files - Applies the defaults that change generated files: each cloud module’s region default.
(Images are applied to the spec before generating;
vagrant.providerat run time.) - builtin
- What the built-in layer holds, for
isoloom defaults --system: the clouds’ regions (the image table is documented on its own page and read from the code). - from_
env ISOLOOM_CLOUD__AWS__REGION=x->("cloud.aws.region", "x"). Only the defaults’ sections are read (ISOLOOM_HOME,ISOLOOM_DERIVEDand the publish variables mean other things).- leaves
- Dotted paths of every leaf of a value.
- load
- Reads every layer for a project: the user’s file, the project’s, the profile,
--images, the host’sISOLOOM_*variables, then the-soverrides. - merge
- Deep-merges
fromintointo: mappings key by key, anything else replaced. - override_
spec - The spec’s YAML with
-s key=valueoverrides applied (keys without thedefaults.prefix), before it is parsed:machines.web.vm.os=ubuntu@24.04,networks.lab.internet=false. - override_
spec_ with override_specwithbase(a profile’sspec) deep-merged first.- parse_
set key=valueof a-s.- resolve
- Merges layers in order; later ones win leaf by leaf.
- scalar
- A value as YAML would read it (
3a number,truea boolean, else text). - set_
region - The module text with its
variable "region"default replaced. - user_
file - The user’s defaults file, in Isoloom’s home on
host.