-
vim /etc/cobbler/settings // Cobbler主配置文件
-
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/' /etc/cobbler/settings // 开启管理dhcp功能
-
sed -i 's/manage_rsync: 0/manage_rsync: 1/' /etc/cobbler/settings // 开启管理rsync功能
next_server : 192.168.137.123 // 设置你的 tftp server 地址, 和cobbler_server 是同一台地址
server : 192.168.137.123 // cobbler_server 地址
getsebool
getsebool: SELinux is disabled // 关闭 selinux
/etc/init.d/iptables stop // 关闭防火墙
vim /etc/xinetd.d/tftp
service tftp
{
disable = no // 开启 tftp 服务
vim /etc/xinetd.d/rsync
service rsync
{
disable = no // 开启 rsync 服务
vim /etc/httpd/conf.d/wsgi.conf
取消掉 LoadModule wsgi_module modules/mod_wsgi.so 前的"#"号 // apache 启动加载 wsgi 模块
openssl passwd -1 -salt 'random-phrase-here' 'Cailu'
$1$random-p$WdA.q7B.jLd413ds.EunF0 // 生成系统安装后的 root 密码
# cobbler has various sample kickstart templates stored
# in /var/lib/cobbler/kickstarts/. This controls
# what install (root) password is set up for those
# systems that reference this variable. The factory
# default is "cobbler" and cobbler check will warn if
# this is not changed.
# The simplest way to change the password is to run
# openssl passwd -1
# and put the output between the "" below.
default_password_crypted: "$1$random-p$WdA.q7B.jLd413ds.EunF0"
配置DHCP
如果你通过 cobbler 管理 dhcp , 只需要填写 cobbler dhcp 模板
vim /etc/cobbler/dhcp.template 添加一段配置
subnet 192.168.137.0 netmask 255.255.255.0 {
option routers 192.168.137.123; // dhcp 分配的网关
option domain-name-servers 202.106.0.20; // dhcp 分配的DNS服务器地址
option subnet-mask 255.255.255.0; // 分配使用的掩码
range dynamic-bootp 192.168.137.100 192.168.137.120; //分配地址的范围
default-lease-time 600; // 默认租约时间
max-lease-time 1200; // 最大租约时间
next-server 192.168.137.123; // tftp server 地址
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if option pxe-system-type = 00:02 {
filename "ia64/elilo.efi";
} else if option pxe-system-type = 00:06 {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
}
ifconfig eth0:0 192.168.137.123 netmask 255.255.255.0 // 在eth0 网卡绑定临时IP
vim /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS=eth0:0 // 修改DHCP监听接口为我们刚才绑定的临时网口
配置相关服务开机启动
chkconfig httpd on
chkconfig cobblerd on
chkconfig dhcpd on
chkconfig xinetd on
chkconfig tftp on
开启相关服务
/etc/init.d/httpd start
/etc/init.d/dhcpd start
/etc/init.d/xinetd start
/etc/init.d/cobblerd start
cobbler get-loaders // 下载引导操作系统文件
yum install debmirror -y
vim /etc/debmirror.conf
#@dists="sid"; // 注销
#@arches="i386"; // 注销
使用 cobbler check 检查环境是否 配置成功
cobbler check
No configuration problems found. All systems go.
到此步骤为止,cobbler server 就算配置好了
emar_Cail