#!/bin/sh if [ -d /tmp/alpine-rootfs ]; then rm -rf /tmp/alpine-rootfs fi apptainer build -s /tmp/alpine-rootfs alpine-bootable.def wwctl image import --force /tmp/alpine-rootfs alpine wwctl image build alpine wwctl power off n1 wwctl power off n2 if ! wwctl overlay list | grep "alpine-net" >/dev/null; then wwctl overlay create alpine-net wwctl overlay mkdir alpine-net /etc/network mkdir -p etc/network cat > etc/network/interfaces.ww </dev/null; then wwctl profile add --profile=default alpine wwctl profile set -y alpine --system-overlays=$(wwctl profile list -j | jq -r 'to_entries[] | select(.key=="default") | .value."system overlay" | join(",")' | sed 's/debian.interfaces/alpine-net/') fi wwctl node set -y --image=alpine --profile=alpine n1 wwctl node set -y --image=alpine --profile=alpine n2 wwctl overlay build n1 wwctl overlay build n2 wwctl power on n1 wwctl power on n2