Remove obsolete bootstrap script and update example script for clarity</message>
<message>Delete the existing bootstrap.sh script used for cloud-init first boot, as it is no longer needed. Update the bootstrap.sh.example script to provide clearer instructions for users on how to customize and deploy their own bootstrap script, ensuring better guidance for cloud-init integration. These changes streamline the provisioning process and enhance user experience.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# Example bootstrap script run by cloud-init at first boot.
|
||||
# Copy to bootstrap.sh, edit as needed, and place in your portal files (e.g. first-boot/)
|
||||
# so it is served at http://YOUR_SERVER:5000/files/bootstrap.sh
|
||||
# Copy to cloud-init/bootstrap.sh; sync-portal-files-to-lxc.sh deploys it to the portal root,
|
||||
# served at http://YOUR_SERVER:5000/files/bootstrap.sh (not under first-boot/).
|
||||
#
|
||||
# Cloud-init downloads this and runs it as root. Add your first-boot logic here:
|
||||
# - Install packages, apply config, run first-boot.sh from this repo, etc.
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
# ├── first-boot.sh ← cloud-init runcmd downloads this
|
||||
# ├── first-boot.conf ← cloud-init runcmd downloads this (required)
|
||||
# ├── first-boot.conf.example ← reference
|
||||
# ├── bootstrap.sh ← user-data.bootstrap downloads this (main path)
|
||||
# └── first-boot/ ← FILE_SERVER points here
|
||||
# ├── steps/
|
||||
# │ ├── 01-hostname.sh … 13-reboot.sh
|
||||
@@ -31,7 +32,7 @@ REMOTE_PORTAL="/var/lib/cm4-provisioning/portal-files"
|
||||
REMOTE_FIRST_BOOT="${REMOTE_PORTAL}/first-boot"
|
||||
|
||||
# Files we sync to the portal root (outside first-boot/)
|
||||
PORTAL_ROOT_FILES=(first-boot.sh first-boot.conf first-boot.conf.example)
|
||||
PORTAL_ROOT_FILES=(first-boot.sh first-boot.conf first-boot.conf.example bootstrap.sh)
|
||||
|
||||
# ── Validate local files ────────────────────────────────────────────────
|
||||
if [[ ! -d "$FILESERVER_DIR" ]]; then
|
||||
@@ -102,7 +103,7 @@ echo ""
|
||||
echo "── Checking for extra files in portal root ────────────────────"
|
||||
|
||||
REMOTE_FILES=$(ssh "$LXC" "find $REMOTE_PORTAL -maxdepth 1 -not -path $REMOTE_PORTAL -printf '%f\n' 2>/dev/null" | sort)
|
||||
EXPECTED_FILES=$(printf '%s\n' "${PORTAL_ROOT_FILES[@]}" "first-boot" | sort)
|
||||
EXPECTED_FILES=$(printf '%s\n' "${PORTAL_ROOT_FILES[@]}" "first-boot" | sort -u)
|
||||
EXTRA_FILES=$(comm -23 <(echo "$REMOTE_FILES") <(echo "$EXPECTED_FILES"))
|
||||
|
||||
if [[ -z "$EXTRA_FILES" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user