cobbler

# 配置epel源
yum -y install epel-release

# 安装软件
yum install -y cobbler dhcp httpd xinetd cobbler-webyum cobbler cobbler-web tftp-server dhcp httpd xinetd

# 检查cobbler
cobbler check

# 设置可以动态修改配置文件

sed -ri 's/allow_dynamic_settings: .*/allow_dynamic_settings: 1/' /etc/cobbler/settings
systemctl restart cobblerd
# 准备好linux机器
[root@cobbler ~]# hostname
cobbler
# 加上一个本地hosts解析
[root@cobbler ~]# tail -1 /etc/hosts
10.0.0.50 cobbler
# 配置epel源
yum -y install epel-release
# 安装
[root@cobbler ~]# yum install cobbler cobbler-web dhcp tftp-server pykickstart httpd python-django -y
2.检查软件包 
[root@cobbler ~]# rpm -qa cobbler cobbler-web dhcp tftp-server pykickstart httpd python-django
cobbler-2.8.5-6.el7.x86_64
pykickstart-1.99.66.22-1.el7.noarch
httpd-2.4.6-99.el7.centos.1.x86_64
cobbler-web-2.8.5-6.el7.noarch
dhcp-4.2.5-83.el7.centos.1.x86_64
tftp-server-5.2-22.el7.x86_64
3.启动cobbler,与http
[root@cobbler ~]# systemctl start cobblerd httpd
[root@cobbler ~]# systemctl is-active cobblerd
active
[root@cobbler ~]# systemctl is-active httpd
active
4.检查cobbler配置
[root@cobbler ~]# cobbler check
# 配置文件
# 防止误重装
sed -i 's/pxe_just_once: 0/pxe_just_once: 1/' /etc/cobbler/settings
# 配置Cobbler统一管理DHCP
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/' /etc/cobbler/settings
# 配置DHCP Cobbler模版,这里sed提供了备份功能
sed -i.ori 's#192.168.1#10.0.0#g;22d;23d' /etc/cobbler/dhcp.template

2.根据cobbler check依次修改配置文件,修改如下配置,注意改了之后要重启cobblerd服务,才可以生效
# 请注意,填写ip地址
# 修改/etc/cobbler/settings
[root@cobbler ~]# grep -E -n  '^server|^next' /etc/cobbler/settings
278:next_server: 10.0.0.50
390:server: 10.0.0.50
# 修改xinetd配置文件, /etc/xinetd.d/tftp ,因为xinetd是管理tftp的,我们用cobbler去管理了
disable                 = no
# 需要安装驱动,cobbler要控制其他机器


# 还需要用到rsync服务,开启该服务
[root@cobbler ~]# systemctl restart  rsyncd
# 修改cobbler安装的系统,默认的密码是"cobbler",可以改下
  [root@cobbler ~]# openssl passwd -1
  Password:
  Verifying - Password:
  $1$5eZ//t9W$X79SpNdtVvC9f2mWzkJqv1
# 在配置文件/etc/cobbler/settings修改默认root密码为,123456
default_password_crypted: "$1$5eZ//t9W$X79SpNdtVvC9f2mWzkJqv1."
# 修改有关cobbler脑裂配置,可以使用fencing tools
# 安装[root@cobbler ~]# yum install -y fence-agents

# 改完如上配置,重启cooblerd
[root@cobbler ~]# systemctl restart cobblerd
# 再次检查,吧修改的配置,让其生效
[root@cobbler ~]# cobbler sync
# 剩下的报错无所谓
[root@cobbler ~]# 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 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.
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories
3 : 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.

重启核心服务

[root@cobbler ~]# systemctl restart cobblerd httpd tftp.socket rsyncd.service
[root@cobbler ~]# systemctl is-active cobblerd httpd tftp.socket rsyncd.service
active
active
active
active

访问cobbler web

# 必须用https协议
https://10.0.0.50/cobbler_web
账户密码都是cobbler

posted @ 2023-10-09 08:32  普里莫  阅读(30)  评论(0编辑  收藏  举报