cobbler批量装机服务部署

文章目录

实施步骤如下:

一、前置任务

1.1 关闭selinux和firewall
systemctl stop firewalld
systemctl disable firewalld
sed -i 's/\(SELINUX=\)enforcing/\1disabled/g' /etc/selinux/config
1.2 双网卡地址
eth0: 192.168.3.55
eth1: 192.168.6.230
1.3 添加路由,vim /etc/rc.d/rc.local
ip route add 192.168.0.224/27 via 192.168.3.254 dev eth0
ip route add 192.168.1.128/25 via 192.168.3.254 dev eth0
ip route add 192.168.6.128/25 via 192.168.3.254 dev eth0
ip route add 192.168.0.28 via 192.168.3.254 dev eth0
ip route add 192.168.0.8 via 192.168.3.254 dev eth0
ip route add 192.168.1.224/27 via 192.168.3.254 dev eth0

二、安装cobbler

2.1 安装包
yum -y install epel-release
yum -y install cobbler cobbler-web tftp-server dhcp httpd xinetd
systemctl enable httpd cobblerd
systemctl start httpd cobblerd
2.2 检查配置
[root@cobbler ~]# cobbler check
The following are potential configuration items that you may want to fix:
 
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 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : 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.
5 : enable and start rsyncd.service with systemctl
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : ksvalidator was not found, install pykickstart
8 : 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
9 : 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.
2.3 逐一解决上面检查结果中的问题
# 设置可以动态修改配置文件
[root@cobbler ~]# sed -ri '/allow_dynamic_settings:/c\allow_dynamic_settings: 1' /etc/cobbler/settings
[root@cobbler ~]# grep allow_dynamic_settings /etc/cobbler/settings
allow_dynamic_settings: 1
[root@cobbler ~]# systemctl restart cobblerd
 
1. server
[root@cobbler ~]# cobbler setting edit --name=server --value=192.168.3.55
 
2. next_server
[root@cobbler ~]# cobbler setting edit --name=next_server --value=192.168.3.55
 
3. tftp_server
[root@cobbler ~]# sed -ri '/disable/c\disable = no' /etc/xinetd.d/tftp
[root@cobbler ~]# systemctl enable xinetd
[root@cobbler ~]# systemctl restart xinetd
 
4. boot-loaders
[root@cobbler ~]# cobbler get-loaders
 
5. rsyncd
[root@cobbler ~]# systemctl start rsyncd
[root@cobbler ~]# systemctl enable rsyncd
 
6. debmirror [optional]
# 这个是可选项的,可以忽略。这里就忽略了
 
7. pykickstart
[root@cobbler ~]# yum -y install pykickstart
 
8. default_password_crypted  #注意:这里设置的密码,也就是后面安装完系统的初始化登录密码
[root@cobbler ~]# openssl passwd -1 -salt `openssl rand -hex 4` 'admin'
$1$675f1d08$oJoAMVxdbdKHjQXbGqNTX0
[root@cobbler ~]# cobbler setting edit --name=default_password_crypted --value='$1$675f1d08$oJoAMVxdbdKHjQXbGqNTX0'
 
9. fencing tools [optional]
[root@cobbler ~]# yum -y install fence-agents
2.4 配置DHCP
[root@cobbler ~]# cobbler setting edit --name=manage_dhcp --value=1
 
# 修改cobbler的dhcp模块,不要直接修改dhcp本身的配置文件,因为cobbler会覆盖
[root@cobbler ~]# vim /etc/cobbler/dhcp.template
...
subnet 192.168.3.0 netmask 255.255.255
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值