目录
2.安装eple源和cobbler相关依赖和其他工具,启动服务
4.生成一个加密的密码,写入到配置文件中/etc/cobbler/settings
12.修改kickstart,把刚刚创建的ks文件设置为默认的文件kickstart
前言
Cobbler是一款自动化操作系统部署的实现工具,由Python语言开发,是对PXE的二次封装。融合多种特性,提供了CLI和Web的管理形式。同时,Cobbler也提供了API接口,方便二次开发使用。它不仅可以安装物理机,同时也支持kvm、xen虚拟化、Guest OS的安装。另外,它还能结合Puppet等集中化管理软件,实现自动化管理。
一、准备阶段
-
虚拟机可连外网,NAT模式
-
系统环境:centos7.5
-
Cobbler服务器端:192.168.127.210
二、安装部署
1.基础环境配置
关闭防火墙、SElinux关闭,重启虚拟机。
[root@localhost ~]# systemctl disable --now firewalld.service
[root@localhost ~]# sed -ri 's/^(SELINUX=).*/\1disabled/g' /etc/selinux/config
[root@localhost ~]# setenforce 0
[root@localhost ~]# reboot
2.安装eple源和cobbler相关依赖和其他工具,启动服务
#配置epel源
[root@localhost ~]# yum -y install epel-release vim
[root@localhost ~]# yum -y install httpd dhcp tftp python-ctypes cobbler xinetd cobbler-web pykickstart fence-agents-all net-tools
#启动httpd,cobblerd
[root@localhost ~]# systemctl enable --now httpd cobblerd
3.修改/etc/cobbler/settings
#修改server的ip地址为本机ip
[root@localhost ~]# sed -i 's/^server: 127.0.0.1/server: 192.168.127.210/' /etc/cobbler/settings
#设置tftp的ip地址为本机ip
[root@localhost ~]# sed -i 's/^next_server: 127.0.0.1/next_server: 192.168.127.210/' /etc/cobbler/settings
#修改cobbler配置文件,让cobbler控制dhcp
[root@localhost ~]# sed -i '/^manage_dhcp/s/0/1/g' /etc/cobbler/settings
[root@localhost ~]# sed -n '/^manage_dhcp/p' /etc/cobbler/settings
manage_dhcp: 1
4.生成一个加密的密码,写入到配置文件中/etc/cobbler/settings
[root@localhost ~]# openssl passwd -1 -salt 'Root@123' 'Root@123' #使用盐值加密
$1$Root@123$YTTPFr6OuGfidOhiBeSG3.
[root@localhost ~]# vim /etc/cobbler/settings
....
default_password_crypted: "$1$Root@123$YTTPFr6OuGfidOhiBeSG3."
....
# 改完配置文件同步一下
[root@localhost ~]# cobbler sync
5.启动rsync并设置开机自启
[root@localhost ~]# systemctl enable --now rsyncd
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
6.重启cobbler然后配置tftp
[root@localhost ~]# systemctl restart cobblerd.service
[root@localhost ~]# vim /etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = no
user = root
server = /usr/sbin/in.tftpd
server_args = -B 1380 -v -s /var/lib/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}
7.执行检查环境命令
[root@localhost ~]# cobbler check
The following are potential configuration items that you may want to fix:
1 : Some network boot-loaders are missing from /var/lib/cobbler/loaders. If you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version o