Restart cobblerd and then run 'cobbler sync' to apply changes.
现在来修复上面三个问题,我们希望能让这台 cobbler 服务器能同时部署 CentOS/Fedora 和 Debian/Ubuntu 系统,所以需要安装 debmirror,安装 debmirror-20090807-1.el5.noarch.rpm 前需要先安装依赖包:
# yum install wget
# yum install ed patch perl perl-Compress-Zlib perl-Cwd perl-Digest-MD5
perl-Digest-SHA1 perl-LockFile-Simple perl-libwww-perl
# wget ftp://fr2.rpmfind.net/linux/epel/5/ppc/debmirror-20090807-1.el5.noarch.rpm
# rpm -ivh debmirror-20090807-1.el5.noarch.rpm
修改 /etc/debmirror.conf 配置文件,注释掉 @dists 和 @arches 两行:
# vi /etc/debmirror.conf
...
#@dists="sid";
@sections="main,main/debian-installer,contrib,non-free";
#@arches="i386";
...
用 openssl 生成一串密码后加入到 cobbler 的配置文件(/etc/cobbler/settings)里,替换 default_password_crypted 字段:
# openssl passwd -1 -salt 'www.example.com' 'example'
$1$www.example$T5FgCHY2P0NDr6JmbN0Bl0
# vi /etc/cobbler/settings
default_password_crypted: "$1$www.example$T5FgCHY2P0NDr6JmbN0Bl0"
安装 cman:
# yum install cman
修复完成,再用 cobbler check 检查一下,确认没问题后用 cobbler sync 做同步操作:
# cobbler check
No configuration problems found.  All systems go.
# cobbler sync
导入 ISO
挂载 CentOS-6.2-x86_64-bin-DVD1.iso 安装光盘然后导入到 cobbler(注意这个 iso 文件有 4GB 多,导入可能需要一段时间),导入成功后 cobbler list 查看一下:
# mount -o loop -t iso9660 CentOS-6.2-x86_64-bin-DVD1.iso /mnt
# cobbler import --path=/mnt --name=CentOS-6.2-x86_64-bin-DVD1 –arch=x86_64
# cobbler sync
# cobbler list
distros:
  CentOS-6.2-bin-DVD1-x86_64
profiles:
  CentOS-6.2-bin-DVD1-x86_64
systems:
repos:
p_w_picpaths:
测试
最后创建一台虚拟机测试一下,把虚拟机设置成网络 PXE 启动(和 cobbler 在同一个网络),启动后就可以看到 Cobbler 引导界面,看到界面后选择 CentOS-6.2-bin-DVD1-x86_64 条目就可以顺利开始无人工干预安装系统,Cobbler 引导界面如下:
安装完系统后默认的密码是啥呢?根据 sample.ks 的配置提示,这个密码 $default_password_crypted 就是我们上面用 openssl passwd -1 -salt ‘www.example.com’ ‘example’ 生成的密码,所以这里的 root 密码是 example:
# cat /var/lib/cobbler/kickstarts/sample.ks
...
#Root password
rootpw --iscrypted $default_password_crypted