通过 Cobbler 批量安装 Ubuntu 的完整流程
一 环境准备与组件安装
二 配置 Cobbler 核心参数
openssl passwd -1 'YourPassword'systemctl enable --now cobblerd httpd tftp(xinetd 托管 tftp 时同时启用 xinetd)cobbler get-loaderscobbler check(务必清零告警后再继续)。三 配置 DHCP 与 TFTP
四 导入 Ubuntu 镜像并创建应答文件
cobbler import --path=/mnt/iso --name=ubuntu20.04 --arch=x86_64cobbler import --name ubuntu20 --path /mnt/ --autoinstall ubuntu.seedd-i debian-installer/locale string en_US、d-i keyboard-configuration/layoutcode string usd-i time/zone string Asia/Shanghai、d-i clock-setup/ntp boolean true、d-i clock-setup/ntp-server string ntp1.aliyun.comd-i mirror/http/hostname string $http_server、d-i mirror/http/directory string $install_source_directoryd-i live-installer/net-image string http://$http_server/cobbler/links/$distro_name/install/filesystem.squashfsd-i partman-auto/method string lvmd-i partman-lvm/device_remove_lvm boolean trued-i partman-auto/purge_lvm boolean trued-i partman-auto/choose_recipe select atomicd-i partman-partitioning/confirm_write_new_label boolean trued-i partman/confirm boolean trued-i partman/confirm_nooverwrite boolean truecobbler distro list、cobbler profile listcobbler profile add --name ubuntu20.04 --distro ubuntu20.04-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ubuntu.seedcobbler profile edit --name ubuntu20.04-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ubuntu.seedcobbler sync(每次修改后务必执行)。五 批量部署与常见问题处理
cobbler system add --name host01 --profile ubuntu20.04-x86_64 --mac AA:BB:CC:DD:EE:FF --netboot-enabled 1cobbler system edit --name host01 --interface eth0 --static 1 --ip-address 10.0.0.101 --netmask 255.255.255.0 --gateway 10.0.0.2 --dns-nameservers 114.114.114.114cobblerd does not appear to be running/accessible:启动服务 systemctl start cobblerd httpd 后再试。httpd Syntax error ... WSGIScriptAliasMatch:启用 mod_wsgi 模块(LoadModule wsgi_module …)。cobbler check 告警未清零:按提示逐项修复,常见为 TFTP/SELinux/防火墙、未加载引导器、DHCP 模板不一致等,修复后 cobbler sync。