Tools: Choose Enrollment VM base image using environment variable (#18070)

Good for running out older versions of macOS during an semi-automated
test
This commit is contained in:
Dante Catalfamo 2024-04-26 15:30:58 -04:00 committed by GitHub
parent 13f4703f01
commit 1cb670a3c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,7 @@ The script takes no arguments, but can be configured through three environment v
- `FLEET_ENROLL_SECRET` (required) The fleet enrollment secret
- `FLEET_URL` (required) The fleet base url
- `MACOS_ENROLLMENT_VM_NAME` (optional) The name of the VM. If nothing is specified, the default name is `enrollment-test`.
- `MACOS_ENROLLMENT_VM_IMAGE` (optional) The image to use for the VM. If nothing is specified, the default image is `ghcr.io/cirruslabs/macos-sonoma-base:latest`
The entire process from the generation of the `pkg` file to the installation is automated. The only part that requires user intervention is installing the MDM profile.

View file

@ -6,9 +6,13 @@ set -m
# Fleet enroll secret placed in $FLEET_ENROLL_SECRET
# Fleet URL placed in $FLEET_URL
# Optional VM name in $MACOS_ENROLLMENT_VM_NAME
# Optional VM image in $MACOS_ENROLLMENT_VM_IMAGE
# For others see https://tart.run/quick-start/
# - ghcr.io/cirruslabs/macos-ventura-base:latest
# - ghcr.io/cirruslabs/macos-monterey-base:latest
vm_name="${MACOS_ENROLLMENT_VM_NAME:-enrollment-test}"
image_name="ghcr.io/cirruslabs/macos-sonoma-base:latest"
image_name="${MACOS_ENROLLMENT_VM_IMAGE:-ghcr.io/cirruslabs/macos-sonoma-base:latest}"
alias ssh_cmd="sshpass -p admin ssh -o \"StrictHostKeyChecking no\" admin@\$(tart ip $vm_name)"
alias ssh_interactive_cmd="sshpass -p admin ssh -o \"StrictHostKeyChecking no\" -t admin@\$(tart ip $vm_name)"