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)
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";
:wq
service cobbler restart
cobbler sync
echo "xxxx" | openssl passwd -1 -stdin (此次xxxx為用戶端的root初始密碼)
vi /etc/cobbler/settings (将上補生成的亂碼貼進去)
default_password_crypted: "$1$cobbler$nBCRhq3fBRuMs35Rp4EUX/"
導入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
DEFAULT menu
PROMPT 0
TIMEOUT 0
#TOTALTIMEOUT 6000
#ONTIMEOUT local
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
LABEL UBT14043-x86_64
kernel /images/UBT14043-x86_64/linux
MENU LABEL UBT14043-x86_64
ipappend 2
MENU end
注:
1、指定網卡需寫到default檔案裡,寫到seed檔案裡不認
2、如果用的是AD的DHCP,一定要在default檔案裡寫上dhcp_timeout時間,不然DHCP失敗機率會很高
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/splash boolean false
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i console-setup/variantcode string
d-i netcfg/choose_interface select auto
d-i clock-setup/utc boolean true
d-i partman-auto/method string regular
d-i partman-auto/disk string /dev/sda
d-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 \
method{ swap } format{ } \
.
d-i partman-auto/choose_recipe boot-root
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select Finish partitioning and write changes to disk
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string 10.0.0.3
d-i base-installer/kernel/image string linux-server
d-i passwd/root-login boolean false
d-i passwd/make-user boolean true
d-i passwd/user-fullname string super
d-i passwd/username string super
d-i passwd/user-password password xxxxxx
d-i passwd/user-password-again password xxxxx
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
d-i passwd/user-default-groups string sudo
d-i mirror/country string manual
d-i mirror/protocol string http
d-i mirror/http/hostname string 10.0.0.2
d-i mirror/http/directory string /cobbler/ks_mirror/UBT14043-x86_64
d-i apt-setup/services-select multiselect security
d-i apt-setup/security_host string 10.0.0.2
d-i apt-setup/security_path string /cobbler/ks_mirror/UBT14043-x86_64
d-i debian-installer/allow_unauthenticated string false
d-i pkgsel/upgrade select none
d-i pkgsel/language-packs multiselect
d-i pkgsel/update-policy select none
d-i pkgsel/updatedb boolean true
d-i grub-installer/skip boolean false
d-i lilo-installer/skip boolean false
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/keep-consoles boolean false
d-i finish-install/reboot_in_progress note
d-i cdrom-detect/eject boolean true
d-i debian-installer/exit/halt boolean false
d-i debian-installer/exit/poweroff boolean false
d-i pkgsel/include string openssh-server
本文轉自linux部落格51CTO部落格,原文連結http://blog.51cto.com/yangzhiming/2052396如需轉載請自行聯系原作者
yangzhimingg