Cobbler 自动化装机

183 篇文章 0 订阅


1. cobbler简介

Cobbler是一个自动化安装linux服务器的软件。通过pxe安装操作系统。Cobbler可以直接命令行终端安装系统,也可以用cobbler-web安装系统。

2. cobbler服务

Dhcp服务,Tftp服务,http服务,以及pxe服务支持,yum仓库管理。

3. cobbler准备及安装

准备:

关闭firwallddisableselinx,然后安装epel源并升级系统centos7

安装:

yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd

配置介绍:

/etc/cobbler # 配置文件目录

/etc/cobbler/settings # cobbler主配置文件,这个文件是YAML格式,Cobblerpython写的程序。

/etc/cobbler/dhcp.template # DHCP服务的配置模板

/etc/cobbler/tftpd.template # tftp服务的配置模板

/etc/cobbler/rsync.template # rsync服务的配置模板

/etc/cobbler/iso # iso模板配置文件目录

/etc/cobbler/pxe # pxe模板文件目录

/etc/cobbler/power # 电源的配置文件目录

/etc/cobbler/users.conf # Web服务授权配置文件

/etc/cobbler/users.digest # 用于web访问的用户名密码配置文件

/etc/cobbler/dnsmasq.template # DNS服务的配置模板

/etc/cobbler/modules.conf # Cobbler模块配置文件

/var/lib/cobbler # Cobbler数据目录

/var/lib/cobbler/config # 配置文件

/var/lib/cobbler/kickstarts # 默认存放kickstart文件

/var/lib/cobbler/loaders # 存放的各种引导程序

/var/www/cobbler # 系统安装镜像目录

/var/www/cobbler/ks_mirror # 导入的系统镜像列表

/var/www/cobbler/images # 导入的系统镜像启动文件

/var/www/cobbler/repo_mirror # yum源存储目录

/var/log/cobbler # 日志目录

/var/log/cobbler/install.log # 客户端系统安装日志

/var/log/cobbler/cobbler.log # cobbler日志

启动httptftpdhcpcobbler服务

然后使用命令检查需要cobbler配置项:

[root@linux-node1 ~]# cobbler check  # 检查Cobbler的配置,如果看不到下面的结果,再次执行/etc/init.d/cobblerd restart

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 : 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.

4 : change 'disable' to 'no' in /etc/xinetd.d/rsync

5 : debmirror package is not installed, it will be required to manage debian deployments and repositories

6 : 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

7 : 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.

 

# 看着上面的结果,一个一个解决。

修改相关配置文件,并重启。

参看文章:

https://www.ibm.com/developerworks/cn/linux/l-cobbler/index.html

然后可以在终端下直接自动化安装系统。

Cobbler-web界面配置:

安装cobbler-web

yum -y install cobbler-web

安装该程序包后,配置 Cobbler 授权和身份验证系统,以便您可以登录。配置位于文件 /etc/cobbler/modules.conf 中。

Cobbler Web 界面的身份验证和授权配置

[authentication]

module = authn_pam

[authorization]

module = authz_ownership

接下来,您需要一个名为 myuser 的系统用户(如果没有,可使用 useradd myuser && passwd myuser 创建)。然后,打开文件 /etc/cobbler/users.conf 并将 myuser 添加到 admins

重启cobbler。默认登录用户和密码是cobbler

Cobbler-web配置参看:

(1)http://www.voidcn.com/article/p-gqmjghha-dh.html

(2)http://www.voidcn.com/article/p-wvpjdhpl-dh.html

(3)http://www.voidcn.com/article/p-ftwyxnfd-dh.html

(4)http://www.voidcn.com/article/p-zpbdylsz-dh.html

(5)http://www.voidcn.com/article/p-zkwlvsqp-dh.html

至此结束了自动化装机的过程。

针对不同的系统需要手动创建好ks文件。这样可以避免一些细节性的错误。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值