本文共 4528 字,大约阅读时间需要 15 分钟。
Cobbler+preseed自动化安装Ubuntu 14.04系统:
建议在Ubuntu 14.04系统上搭建,Ubuntu 16.04上会有apache2的python和mod_wsgi模块版本冲突
安装apache2、tftpd-hpa、kickstart略
apt-get install cobbler
netstat -ntplu (查看服务端口,包括tcp和udp)
curl -I (验证网页是否能打开)
cobbler check
apt-get install debmirror
cp -rv /usr/share/doc/debmirror/examples/debmirror.conf /etc/
vi /etc/debmirror.conf (注释掉下面2行)
#@dists="precise";
#@arches="i386";
:wqservice cobbler restart
cobbler sync
echo "xxxx" | openssl passwd -1 -stdin (此次xxxx为客户端的root初始密码)
vi /etc/cobbler/settings (将上补生成的乱码贴进去)
default_password_crypted: "$1$cobbler$nBCRhq3fBRuMs35Rp4EUX/"
:wqcobbler sync
导入iso镜像
mount -t iso9660 -r -o ro,loop ubuntu-14.04.3-server-amd64.iso /root/iso/
cobbler import --name=UBT14043 --arch=x86_64 --path=/root/iso
cobbler list
cobbler distro list
cobbler profile list
cobbler profile report --name=UBT14043-x86_64 #查看profile设置
cobbler distro report --name=UBT14043-x86_64 #查看安装镜像文件信息
cobbler profile remove --name=UBT14043-x86_64 #移除profile
cobbler profile add --name=UBT14043-x86_64 --distro=UBT14043-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ubt14043.seed #添加
cobbler profile edit --name=UBT14043-x86_64 --distro=UBT14043-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ubt14043.seed #编辑
cobbler profile add --name=UBT14043-x86_64 --kickstart="/var/lib/cobbler/kickstarts/ubt14043.seed"
cobbler profile report
service cobbler restart
cobbler sync
DEFAULT menu
PROMPT 0MENU TITLE Cobbler | TIMEOUT 0#TOTALTIMEOUT 6000#ONTIMEOUT localLABEL local
MENU LABEL (local)MENU DEFAULTLOCALBOOT -1LABEL UBT14043-x86_64
kernel /images/UBT14043-x86_64/linuxMENU LABEL UBT14043-x86_64append initrd=/images/UBT14043-x86_64/initrd.gz ksdevice=bootif lang= locale=en_US priority=critical text auto-install/enable=true priority=critical url= hostname=aa domain=ming.com suite=trusty netcfg/choose_interface=em1 netcfg/dhcp_timeout=120ipappend 2MENU end
注:
1、指定网卡需写到default文件里,写到seed文件里不认2、如果用的是AD的DHCP,一定要在default文件里写上dhcp_timeout时间,不然DHCP失败概率会很高d-i live-installer/net-image string
d-i debian-installer/locale string en_US.UTF-8d-i debian-installer/splash boolean falsed-i console-setup/ask_detect boolean falsed-i console-setup/layoutcode string usd-i console-setup/variantcode string d-i netcfg/choose_interface select autod-i clock-setup/utc boolean trued-i partman-auto/method string regulard-i partman-auto/disk string /dev/sdad-i partman-auto/expert_recipe select \boot-root :: \100000 80 100000 ext4 \$bootable{ } \$primary{ } \method{ format } format{ } \use_filesystem{ } filesystem{ ext4 } \mountpoint{ / } \. \102 60 1000 linux-swap \$primary{ } \method{ swap } format{ } \. d-i partman-auto/choose_recipe boot-rootd-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select Finish partitioning and write changes to diskd-i partman/confirm boolean trued-i partman/confirm_nooverwrite boolean trued-i partman/default_filesystem string ext4d-i clock-setup/utc boolean trued-i clock-setup/ntp boolean trued-i clock-setup/ntp-server string 10.0.0.3d-i base-installer/kernel/image string linux-serverd-i passwd/root-login boolean falsed-i passwd/make-user boolean trued-i passwd/user-fullname string superd-i passwd/username string superd-i passwd/user-password password xxxxxxd-i passwd/user-password-again password xxxxxd-i user-setup/allow-password-weak boolean trued-i user-setup/encrypt-home boolean falsed-i passwd/user-default-groups string sudod-i mirror/country string manuald-i mirror/protocol string httpd-i mirror/http/hostname string 10.0.0.2d-i mirror/http/directory string /cobbler/ks_mirror/UBT14043-x86_64d-i apt-setup/services-select multiselect securityd-i apt-setup/security_host string 10.0.0.2d-i apt-setup/security_path string /cobbler/ks_mirror/UBT14043-x86_64d-i debian-installer/allow_unauthenticated string falsed-i pkgsel/upgrade select noned-i pkgsel/language-packs multiselect d-i pkgsel/update-policy select noned-i pkgsel/updatedb boolean trued-i grub-installer/skip boolean falsed-i lilo-installer/skip boolean falsed-i grub-installer/only_debian boolean trued-i grub-installer/with_other_os boolean trued-i finish-install/keep-consoles boolean falsed-i finish-install/reboot_in_progress note d-i cdrom-detect/eject boolean trued-i debian-installer/exit/halt boolean falsed-i debian-installer/exit/poweroff boolean falsed-i pkgsel/include string openssh-server转载于:https://blog.51cto.com/yangzhiming/2052396