aipackage/autoinstall/user-data

98 lines
3.0 KiB
Plaintext

#cloud-config
autoinstall:
version: 1
# ── Locale & keyboard ──────────────────────────
locale: en_IN.UTF-8
keyboard:
layout: us
# ── Network: DHCP on first ethernet ───────────
# Final network config is set by firstboot-setup.sh wizard
network:
network:
version: 2
ethernets:
any-en:
dhcp4: true
match:
name: "en*"
any-eth:
dhcp4: true
match:
name: "eth*"
# ── Storage: LVM using ALL disk space ─────────
storage:
layout:
name: lvm
match:
size: largest
# ── Identity ──────────────────────────────────
identity:
hostname: aiserver
username: cezen
# Password: Cezen@2024!
password: "$6$rounds=4096$cezentech$9pHVUFCvB7mHrblqn0qXJaFWxMkmepNM4T8Q5Fx8piVXuGDq.MLk/RH4nRMWtluLMpPXaZQAGFOD4xtjW1wC1"
# ── SSH ───────────────────────────────────────
ssh:
install-server: true
allow-pw: true
# ── Base packages ─────────────────────────────
packages:
- git
- curl
- wget
- whiptail
- net-tools
# ── Late commands ─────────────────────────────
late-commands:
# 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
# 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
# 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