cobbler介绍
cobbler工作流程
cobbler相关介绍
cobbler相关术语
cobbler各种配置目录说明
cobbler常用目录介绍
cobbler命令介绍
cobbler配置中的重要参数
default_password_crypted: "$1$gEc7ilpP$pg5iSOj/mlxTxEslhRvyp/"
manage_dhcp:1
manage_tftpd:1
pxe_just_once:1
next_server:< tftp服务器的 IP 地址>
server:
cobbler环境检查
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.
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.
3 : 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.
4 : change ‘disable’ to ‘no’ in /etc/xinetd.d/rsync
5 : comment ‘dists’ on /etc/debmirror.conf for proper debian support
6 : comment ‘arches’ on /etc/debmirror.conf for proper debian support
7 : 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
8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
vim /etc/cobbler/setting
272 next_server: 192.168.32.129
384 server: 192.168.32.129
如果当前节点可以访问互联网,执行“cobbler get-loaders”命令即可;否则,需要安装syslinux程序包,而后复制/usr/share/syslinux/{pxelinux.0,memu.c32}等文件至/var/lib/cobbler/loaders/目录中
执行“chkconfig rsync on”命令即可
执行"openssl passwd -1"生成密码,并用其替换/etc/cobbler/settings文件中default_password_crypted参数的值
101 default_password_crypted: "$1$99LixtJN$6IDi4kCnculvZb/Pavczg/"
另外:建议修改的配置:
vim /etc/cobbler/setting
242 manage_dhcp: 1
dhcp配置文件默认为空,把该项0改为1,由cobbler管理dhcp自动生成dhcp配置文件,无需手动创建
更改后,重启cobbler服务
此时还需更改由cobbler自动生成的dhcp配置文件
vim /etc/cobbler/dhcp.template
21 subnet 192.168.32.0 netmask 255.255.255.0 {
22 option routers 192.168.32.5;
23 option domain-name-servers 192.168.1.1;
24 option subnet-mask 255.255.255.0;
25 range dynamic-bootp 192.168.32.100 192.168.32.254;
把默认网段,更改为dhcp分配的地址网段即可,如:地址池范围,网关等,其他项无需更改
更改后进行同步:cobbler sync
cobbler相关管理
cobbler命令
知识扩展:
以上实现的是系统自动生成的应答文件引导,是最小化安装系统,如果要自定义系统,需要自定义制作应答文件,制作完成以后,需要对该文件进行更改:
vim ks_centos7.cfg
14 url --url=$tree
此时不知道yum仓库路径,把url路径指定为$tree变量,该变量为cobbler变量,它能够自动添加cobbler自己生成的仓库路径
把应答文件与发行版本centos7.5-x8_64进行关联,需要把应答文件复制到cobbler准们存放应答文件的目录下
/var/lib/cobbler/kickstarts/是cobbler专门用于存放应答文件的目录
cp ks_centos7.cfg /var/lib/cobbler/kickstarts/ks7.cfg
把应答文件复制到对应目录下并改名为ks7.cfg
手动关联应答文件与发行版本
cobbler profile add --name=centos7.5-x8_64-x86_64_desktop --distro=centos7.5-x8_64-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ks7.cfg
add 新增应答文件
可以把原来系统默认生成的应答文件删除
cobbler profile remove --name=centos7.5-x86_64
--name 指定系统启动菜单项的名称
--distro 指定系统发行版本
--kickstart 指定应答文件名,该文件路径必须为绝对路径
查看生成的菜单项:
cat /var/lib/tftpboot/pxelinux.cfg/default
cobbler实现步骤
1、安装包,并设置服务
2、检查配置
3、根据上面提示修改配置
4、下载启动相关文件菜单
5、配置DHCP服务
6、分别导入centos的安装源,并查看
7、准备kickstart文件并导入cobbler
8、测试
cobbler的web管理实现
vim /etc/cobbler/modules.conf
[authentication]
module=authn_configfile
创建其认证文件/etc/cobbler/users.digest,并添加所需的用户
htdigest -c /etc/cobbler/users.digest Cobbler admin
注意:添加第一个用户时,使用“-c”选项,后续添加其他用户时不要再使用,cobbler_web的realm只能为Cobbler
vim /etc/cobbler/modules.conf
[authentication]
module = authn_pam
创建cobbler用户
useradd cobbler
vim /etc/cobbler/users.conf
[admins]
admin = "cobbler“