Add first-boot TUI wizard: network, tier, tool selection + LVM auto-extend
This commit is contained in:
1 parent
2dfc245b90
commit
a1948d93fe
2 files changed
+234
-37
No files matched your search
+46
-37
@@ -8,6 +8,7 @@ autoinstall:
|
||||
layout: us
|
||||
|
||||
# ── Network: DHCP on first ethernet ───────────
|
||||
# Final network config is set by firstboot-setup.sh wizard
|
||||
network:
|
||||
network:
|
||||
version: 2
|
||||
@@ -21,18 +22,18 @@ autoinstall:
|
||||
match:
|
||||
name: "eth*"
|
||||
|
||||
# ── Storage: LVM on largest disk ──────────────
|
||||
# ── Storage: LVM using ALL disk space ─────────
|
||||
storage:
|
||||
layout:
|
||||
name: lvm
|
||||
match:
|
||||
size: largest
|
||||
|
||||
# ── Identity: cezen user ──────────────────────
|
||||
# ── Identity ──────────────────────────────────
|
||||
identity:
|
||||
hostname: aiserver
|
||||
username: cezen
|
||||
# Password: Cezen@2024! (SHA-512 hash below)
|
||||
# Password: Cezen@2024!
|
||||
password: "$6$rounds=4096$cezentech$9pHVUFCvB7mHrblqn0qXJaFWxMkmepNM4T8Q5Fx8piVXuGDq.MLk/RH4nRMWtluLMpPXaZQAGFOD4xtjW1wC1"
|
||||
|
||||
# ── SSH ───────────────────────────────────────
|
||||
@@ -40,49 +41,57 @@ autoinstall:
|
||||
install-server: true
|
||||
allow-pw: true
|
||||
|
||||
# ── Packages installed during setup ───────────
|
||||
# ── Base packages ─────────────────────────────
|
||||
packages:
|
||||
- git
|
||||
- curl
|
||||
- wget
|
||||
- whiptail
|
||||
- net-tools
|
||||
|
||||
# ── Late commands: run after OS install ───────
|
||||
# These run with target mounted at /target
|
||||
# ── Late commands ─────────────────────────────
|
||||
late-commands:
|
||||
# Clone the Cezen AI installer
|
||||
- git clone https://cgit.cezentech.com/jinojose/aipackage.git /target/opt/aipackage
|
||||
# Extend LVM to use 100% of available disk space
|
||||
- lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv || true
|
||||
- resize2fs /dev/ubuntu-vg/ubuntu-lv || true
|
||||
|
||||
# Set ownership
|
||||
- curtin in-target -- chown -R cezen:cezen /opt/aipackage
|
||||
|
||||
# Create a firstboot systemd service that runs install.sh on first boot
|
||||
- |
|
||||
cat > /target/etc/systemd/system/cezen-firstboot.service << 'SVCEOF'
|
||||
[Unit]
|
||||
Description=Cezen AI Suite First Boot Installer
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
ConditionPathExists=!/opt/cezen/.installed
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash /opt/aipackage/install.sh
|
||||
ExecStartPost=/bin/touch /opt/cezen/.installed
|
||||
RemainAfterExit=yes
|
||||
StandardOutput=journal+console
|
||||
StandardError=journal+console
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
SVCEOF
|
||||
|
||||
# Enable the firstboot service
|
||||
- curtin in-target -- systemctl enable cezen-firstboot.service
|
||||
|
||||
# Allow cezen user to run sudo without password (needed for install.sh)
|
||||
# Allow cezen passwordless sudo (needed for install.sh)
|
||||
- echo "cezen ALL=(ALL) NOPASSWD:ALL" > /target/etc/sudoers.d/cezen
|
||||
- chmod 440 /target/etc/sudoers.d/cezen
|
||||
|
||||
# ── Skip confirmations ────────────────────────
|
||||
# Clone the Cezen AI installer
|
||||
- git clone https://cgit.cezentech.com/jinojose/aipackage.git /target/opt/aipackage || true
|
||||
|
||||
# Deploy the firstboot setup wizard
|
||||
- cp /target/opt/aipackage/autoinstall/firstboot-setup.sh /target/opt/cezen-setup.sh
|
||||
- chmod +x /target/opt/cezen-setup.sh
|
||||
|
||||
# Create firstboot systemd service (runs the TUI wizard on first login)
|
||||
- |
|
||||
cat > /target/etc/systemd/system/cezen-setup.service << 'EOF'
|
||||
[Unit]
|
||||
Description=Cezen AI Suite Setup Wizard
|
||||
After=network-online.target getty@tty1.service
|
||||
Wants=network-online.target
|
||||
ConditionPathExists=!/opt/cezen/.setup-done
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash /opt/cezen-setup.sh
|
||||
StandardInput=tty
|
||||
StandardOutput=tty
|
||||
StandardError=tty
|
||||
TTYPath=/dev/tty1
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
- curtin in-target -- systemctl enable cezen-setup.service
|
||||
|
||||
# ── Skip confirmations ─────────────────────────
|
||||
user-data:
|
||||
disable_root: false
|
||||
Reference in new issue
Block a user