以下对cobbler部署的操作,只是提供一个启动模型,还没进入系统
部署环境:防火墙关闭,selinx关闭,有epel源
装包:epel-release cobbler cobbler-web tftp-server dhcp httpd xinetd
启服务:[root@localhost ~]# systemctl start httpd cobblerd.service
[root@localhost ~]# cobbler check //可以看到有9条需要配置
The following are potential configuration items that you may want to fix:
1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
需配置:
[root@localhost ~]# sed -ri '/allow_dynamic_settings:/c\allow_dynamic_settings: 1' /etc/cobbler/settings //针对server需要先将动态设为1
[root@localhost ~]# cobbler setting edit --name=server --value=192.168.122.139 //可以使用cobbler,也可以用sed改,本机ip为192.168.122.139
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
需配置:[root@localhost ~]# cobbler setting edit --name=next_server --value=192.168.122.139
3 : change 'disable' to 'no' in /etc/xinetd.d/tftp
需配置:
[root@localhost ~]# sed -r '/disable/c\disable = no' /etc/xinetd.d/tftp
4 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
需配置:
[root@localhost ~]# cobbler get-loaders //需要下载文件
[root@localhost ~]# ls /var/lib/cobbler/loaders/
COPYING.elilo COPYING.yaboot grub-x86_64.efi menu.c32 README
COPYING.syslinux elilo-ia64.efi grub-x86.efi pxelinux.0 yaboot //下载后会看到这写文件
5 : enable and start rsyncd.service with systemctl
需配置:
[root@localhost ~]# systemctl enable rsyncd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
[root@localhost ~]# systemctl start rsyncd.service
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
需配置:因为不是debian系统,这个可以不安装
7 : ksvalidator was not found, install pykickstart
需配置:[root@localhost ~]# yum -y install pykickstart
8 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
需配置:[root@localhost ~]# openssl passwd -1 -salt 'mima' 'kailey'
$1$mima$A1tJFAnGOOPOV2YIFiQiC/ //用提示的命令生成一个密令,将它放在需要的地方,salt 是为密码指定一个岩,只要岩不同(密码可相同),密令就不同
或者可以随即生成一个岩
[root@localhost ~]# openssl passwd -1 -salt `openssl rand -hex 4` 'kailey'
$1$73f90ef9$TgPhLZakjYkr4NMB.AD7n/
[root@localhost ~]# cobbler setting edit --name=default_password_crypted --value='$1$mima$A1tJFAnGOOPOV2YIFiQiC/'
9 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
需配置:[root@localhost ~]# yum -y install fence-agents //安装哪个都可以
配置先不要重启,还有一项cobbler中没有配置:
manage_dhcp:
cobbler setting edit --name=manage_dhcp --value=1 //当然这个也可以暂时不设定
修改dhcp文件,一下是我的做法:
[root@localhost ~]# cat /etc/cobbler/dhcp.template
subnet 192.168.122.0 netmask 255.255.255.0 {
#option routers 192.168.1.5; //我是将前两项注释掉了,将涉及网段的改为我主机所在网段,也可以不改,但后面可能会有错误
#option domain-name-servers 192.168.1.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.122.100 192.168.122.254;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
Restart cobblerd and then run 'cobbler sync' to apply changes.
按照命令重启cobblerd 并运行cobbler sync 进行同步