Skip to content

Lab 03: Provisioning After Boot

Use Yeast provisioning to install packages, copy files, and run shell commands after the VM is reachable.

You will learn:

  • what provision.packages does
  • what provision.files does
  • what provision.shell does
  • how top-level provisioning applies to instances
  • when to use yeast provision
  • when to use yeast up --reprovision or yeast up --no-provision

What You Will Build

yeast-lab-03/
└── web VM
    ├── Ubuntu 24.04
    ├── Caddy installed
    ├── static index.html copied
    └── Caddy restarted by shell commands

Before You Start

Run:

yeast doctor

Step 1: Create The Project

mkdir yeast-lab-03
cd yeast-lab-03
yeast init --template caddy-single-vm

Inspect the provisioning config:

cat yeast.yaml
ls -la site

The template uses top-level provision, which applies to the web instance.

Step 2: Start The VM

yeast up

After SSH becomes ready, Yeast installs packages, copies files, and runs shell commands from yeast.yaml.

Step 3: Verify Provisioning

yeast exec web -- systemctl is-active caddy

Expected output:

active

Check the copied file:

yeast exec web -- test -f /var/www/html/index.html

Step 4: Read Logs

yeast logs web --tail 80

Use logs when the VM starts but something inside the boot or runtime path looks wrong.

Step 5: Rerun Provisioning On A Running VM

yeast provision web

Use this when the VM is already running and you want to reapply provisioning without recreating the VM.

Step 6: Compare Provisioning Flags

Force provisioning during up:

yeast up --reprovision

Skip provisioning during up:

yeast up --no-provision

These flags are useful when debugging provisioning separately from VM startup.

Clean Up

yeast down
yeast destroy

What You Learned

Cloud-init prepares access. Provisioning turns a reachable VM into the machine you want.

Provisioning is Yeast's built-in way to make small, repeatable setup steps part of the project.

Next Lab

Continue with Status, Logs, Inspect, JSON.