天天看点

cobbler

cobbler 目前最新版本为2.6.9 官网为http://cobbler.github.io/

一,安装cobbler

以下是相关配置路径(默认安装) :

Cobbler 配置主要位置:/var/lib/cobbler/ (实际操作和配置的目录 )

snippets 代码  位置:/var/lib/cobbler/snippets/

Kickstart 模板  位置 : /var/lib/cobbler/kickstarts/

安装源镜像       位置 : /var/www/cobbler/ks_mirror/ (把它link到apache的发布目录,方便kickstart 工作时通过http下载安装镜像文件 )

yum install cobbler cobbler-web pykickstart debmirror -y      

二,解决cobbler初始化问题

[root@cobbler yum.repos.d]#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 : 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

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 : change 'disable' to 'no' in /etc/xinetd.d/rsync

6 : comment out 'dists' on /etc/debmirror.conf for proper debian support

7 : comment out 'arches' on /etc/debmirror.conf for proper debian support

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.

  1. 在/etc/cobbler/settings里配置server的地址
  2. 在/etc/cobbler/settings里配置next_server的地址
  3. 修改SELinux的配置文件vim /etc/selinux/config 为disabled
  4. 执行cobbler get-loaders
  5. change 'disable' to 'no' in /etc/xinetd.d/rsync
  6. 注释/etc/debmirror.conf中的dists行
  7. 注释/etc/debmirror.conf中的arches行
  8. 执行以下命令加密密码并替换/etc/cobbler/settings的default_password_crypted

    [root@cobbler ~]# openssl passwd -1 -salt 'random-phrase-here' 'jiayuan.com'       

    $1$random-p$CiZoWfdQPZ.Hcyd/MxC/31

  9. 安装cman 和 fence-agents

三,安装并管理所需服务

yum -y install dhcp tftp rsync xinetd      

四,启动web界面

    要想启动web界面,就必须要先启动httpd,启动后如下:

cobbler

四,导入系统镜像

    首先挂载系统镜像,然后执行令导入系统镜像。

mount -o loop /var/iso/CentOS-6.4-x86_64.iso /mnt/os/
cobbler import --path=/mnt/os/ --name=centos6.4 --arch=x86_64      

    注意: 这个安装源的唯一标示 就是根据这两个参数来定义name,arch.导入系统后查看

cobbler distro list
cobbler profile find --distro=***    #查看配置文件是否存在
cobbler profile remove --name=***    #删除配置文件
cobbler profile find --distro=***    #再查看配置已无
cobbler distro remove --name=****    #删除distro      

五、自定义profile

cobbler profile add --name=centos6.3-x86_64 --distro=rhel6.3-x86_64 --kickstart=/var/lib/cobbler/kickstarts/6u33w.ks      
cobbler profile report --name  centos6.3-x86_64 
ksfile=$( cobbler profile report --name  centos6.3-x86_64|grep -E '^Kickstart' |head -n 1|cut -d ':' -f 2 );cat $ksfile;      

继续阅读