From 5cab7fe9c06de45cc0ce162480c9e1dca3b00932 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 10 Aug 2026 02:33:26 +0000 Subject: [PATCH] Correct cloud-init.sh usage instructions for real provider UIs IONOS's User Data field takes a Script Type choice (Cloud Config vs Shell Script) and runs the pasted/imported content directly rather than fetching a URL. Update the README to say so, add DEBIAN_FRONTEND=noninteractive for genuine unattended cloud-init execution. --- README.md | 15 +++++++++++---- cloud-init.sh | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fe5ae33..0951f62 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,17 @@ Use a fine-grained read-only PAT scoped to just this repo (Contents: Read). **Cloud provider install-script / user-data field (IONOS, DigitalOcean, Hetzner, ...):** these run as root with no terminal attached while the image is still being provisioned, so `bootstrap.sh`'s interactive hand-off -doesn't apply yet. Paste `cloud-init.sh` into that field instead: -``` -https://raw.githubusercontent.com/outis1one/ubuntu-post-install/main/cloud-init.sh -``` +doesn't apply yet. Use `cloud-init.sh` instead — it's a plain cloud-init +user-data shell script (starts with `#!/bin/bash`, no `#cloud-config` YAML). + +IONOS's server-creation screen has a **User Data** box under "Scripts" with +a **Script Type** choice of *Cloud Config* or *Shell Script* — pick +**Shell Script**, then either click **Import from file** and select +`cloud-init.sh`, or paste its contents directly. User-data fields run the +script's own content; they don't fetch a URL, so paste/import the file +itself rather than a link to it. (DigitalOcean/Hetzner's plain "User data" +textbox works the same way — paste the script contents in directly.) + It clones the repo in the background during provisioning and installs a one-shot login hook. The provider boots Ubuntu 24.04, this runs unattended, and by the time you SSH in the whiptail service menu is already waiting for diff --git a/cloud-init.sh b/cloud-init.sh index 3aba119..605f8d6 100755 --- a/cloud-init.sh +++ b/cloud-init.sh @@ -37,6 +37,7 @@ REPO_URL="https://github.com/outis1one/ubuntu-post-install.git" DEST="/root/ubuntu-post-install" MARKER="/root/.ubuntu-post-install-pending" HOOK="/etc/profile.d/99-ubuntu-post-install.sh" +export DEBIAN_FRONTEND=noninteractive command -v git >/dev/null 2>&1 || { apt-get update -qq && apt-get install -y git; }