cobbler

cobbler:

Cobbler由python语言开发,是对PXE和Kickstart以及DHCP的封装。融合很多特性,提供了CLI和Web的管理形式。更加方便的实行网络安装。

cobbler的工作流程;

cobbler_第1张图片
image

配置cobbler:

1 准备环境:

(1)所选主机需有2个网卡,其中一个为静态ip且仅主机模式;另一个为dhcp获取的桥接模式,可获取yum源。
(2)禁用selinux,关闭防火墙。
iptables -F
[root@centos7 ~]#getenforce
Permissive
(3)安装各种所需服务并启用
yum install dhcp cobbler cobbler-web
systemctl enable dhcpd (该服务会被cobbler接管,在cobbler配置文件中可以配置)
systemctl enable httpd
systemctl enable tftpd
systemctl enable cobblerd
systemctl start dhcpd
systemctl start httpd
systemctl start tftpd
systemctl start cobblerd

2 更改cobbler的配置文件

在更改文件的时候最好备份一份,防止破坏文件无法恢复。
vim  /etc/cobbler/settings
(1)  文件的384行:
server: 192.168.52.142   -----------》改成仅主机模式的那块网卡的ip
(2)文件的272行:
next_server: 192.168.52.142---------》同上
(3)文件的242行 :
manage_dhcp: 1  ------------------》原文件为0,改成1,表示dhcp服务由cobler接管。
(4)更改完文件后需输入命令 cobbler sync 写入 ;
可用cobbler check 检查有无遗漏。
[root@centos7 ~]#cobbler check
The following are potential configuration items that you may want to fix:

1 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
https://github.com/cobbler/cobbler/wiki/Selinux
2 : enable and start rsyncd.service with systemctl
3 : debmirror package is not installed, it will be required to manage debian deployments and repositories
4 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Restart cobblerd and then run 'cobbler sync' to apply changes.

   (5)此时去查看dhcp服务的配置文件会显示已被cobbler接管。
[root@centos7 ~]#cat /etc/dhcp/dhcpd.conf
# ******************************************************************
# Cobbler managed dhcpd.conf file
# generated from cobbler dhcp.conf template (Mon Jul 24 07:19:37 2017)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
# ******************************************************************

3 下载加载程序并导入光盘

cobbler get-loaders
cobbler sync 
systemctl restart cobblerd.service
  cobbler import --path=/misc/cd --name=centos7.3
  cobbler import --path=/misc/cd --name=centos6.9
   cobbler sync
导入完成后
  [root@centos7 ~]#cobbler distro list
   centos6.9-x86_64
   centos7.3-x86_64
自动回生成2个ks文件,默认为最小化安装。
cobbler_第2张图片
image

你可能感兴趣的:(cobbler)