Cobbler+preseed自动化安装Ubuntu系统

简介:

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 http://127.0.0.1/cobbler (验证网页是否能打开)

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/"
:wq

cobbler 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

cat /var/lib/tftpboot/pxelinux.cfg/default内容:

DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://www.cobblerd.org/
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
append initrd=/images/UBT14043-x86_64/initrd.gz ksdevice=bootif lang= locale=en_US priority=critical text auto-install/enable=true priority=critical url=http://10.0.0.2/cblr/svc/op/ks/profile/UBT14043-x86_64 hostname=aa domain=ming.com suite=trusty netcfg/choose_interface=em1 netcfg/dhcp_timeout=120
ipappend 2

MENU end

注:
1、指定网卡需写到default文件里,写到seed文件里不认
2、如果用的是AD的DHCP,一定要在default文件里写上dhcp_timeout时间,不然DHCP失败概率会很高

cat ubt14043.seed内容:

d-i live-installer/net-image string http://10.0.0.2/cobbler/links/UBT14043-x86_64/install/filesystem.squashfs
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 \
$primary{ } \
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/utc boolean true
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

相关文章
|
4天前
|
Ubuntu Linux Python
Linux(15)Ubuntu安装ninja构建工具
Linux(15)Ubuntu安装ninja构建工具
15 0
|
1天前
|
Ubuntu Linux
Linux(Ubuntu)系统临时IP以及静态IP配置(关闭、启动网卡等操作)
请注意,以上步骤是在临时基础上进行配置的。如果要永久保存静态IP地址,通常还需要修改 `/etc/network/interfaces`文件,以便在系统重启后保持配置。同时,确保备份相关配置文件以防止出现问题。
12 1
|
3天前
|
存储 运维 Shell
Ansible自动化运维工具安装和基本使用
Ansible 是一款无代理的IT自动化工具,通过SSH连接目标主机执行配置管理、应用部署和云端管理任务。它使用YAML编写的Playbook定义任务,核心组件包括Playbook、模块、主机清单、变量等。Ansible的优势在于易用、功能强大、无须在目标主机安装额外软件,并且开源。安装过程涉及配置网络源、yum安装和SSH密钥设置。通过定义主机清单和使用模块进行通信测试,确保连接成功。
Ansible自动化运维工具安装和基本使用
|
4天前
|
Ubuntu Linux 数据安全/隐私保护
Linux(7)Ubuntu20.04 arm64安装Docker
Linux(7)Ubuntu20.04 arm64安装Docker
18 0
|
4天前
|
存储 Ubuntu Docker
如何在 Ubuntu 上安装 Docker?
【4月更文挑战第17天】
42 8
如何在 Ubuntu 上安装 Docker?
|
7天前
|
Ubuntu Docker 索引
ubuntu 20.04 安装docker教程和安装中遇到的问题解决方案(超详细 附加图文教程)
ubuntu 20.04 安装docker教程和安装中遇到的问题解决方案(超详细 附加图文教程)
30 0
|
10天前
|
Ubuntu 数据安全/隐私保护
在UBUNTU虚拟机上安装R软件包
在UBUNTU虚拟机上安装R软件包
13 0
|
10天前
|
存储 编解码 Ubuntu
0-零基础安装ubuntu(超详细安装步骤)
0-零基础安装ubuntu(超详细安装步骤)
|
11天前
|
Ubuntu Linux 定位技术
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
|
20天前
|
Ubuntu Python
WSL ubuntu 20.04安装python3
通过以上步骤,你可以在WSL的Ubuntu 20.04上成功安装Python 3。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
24 1

热门文章

最新文章