依赖软件:
yum install epel dhcp tftp rysnc xinetd httpd -y
关闭selinux:
临时关闭:
setenforce 0
永久关闭:
sed -i ‘s/SELINUX=.*/SELINUX=disable/g‘ /etc/selinux/config
安装cobbler:
yum install cobbler
配置xinetd启动tftp:/etc/xinetd.d/tftp
在DHCP服务器配置子网
cobbler重要的文件:
/var/lib/cobbler/kickstarts/: #默认放置ks.cfg配置文件位置
/etc/cobbler/settings: #cobbler配置文件
#修改setting文件
#为了集成现有环境,取消cobbler管理服务,以下设置为0
manage_dhcp: 0
manage_dns: 0
manage_tftpd: 0
manage_rsync: 0
设置完配置文件后,启动服务
systemctl start dhcpd #67/udp systemctl start xinetd #69/udp systemctl start rsyncd systemctl start httpd systemctl start cobblerd
检测cobbler:
cobbler check #此处会出现一些错误,依照提示依次解决即可
重启服务:
systemctl restart cobblerd cobbler sync #同步
挂载镜像:
mount /dev/cdrom /mnt cobbler import --name=‘self-define_name‘ --path=/mnt #导入
查看当前的profile:
cobbler profile list
制作kickstart文件:
ks.cfg:
openssl passwd -1 -salt root #生成用户密码
下载: system-config-kickstart
制作ks.cfg:
图形界面:
system-config-kickstart
修改安装好的ks.cfg文件: /root/anaconda-ks.cfg
验证ks文件的有效性:
ksvalidator ks.cfg
复制配置文件到cobbler启动目录:
cp ks.cfg /var/lib/cobbler/kickstarts/
导入配置文件:
cobbler profile add --name=‘centos-7-base‘ --distro=‘centos-7-x86_64‘ --kickstart=/var/lib/cobbler/kickstarts/ks.cfg
参考网址:
KS配置文件: http://www.osyunwei.com/archives/7577.html
cobbler安装:http://www.linuxidc.com/Linux/2015-09/122945.htm
cobbler原理:http://www.361way.com/cobbler-principle/4328.html
时间: 2024-11-01 10:37:39