yum安装

yum install -y epel-release
yum install -y httpd dhcp tftp cobbler cobbler-web pykickstart xinetd
#httpd dhcp tftp cobbler 程序及其依赖服务 #cobbler-web web管理 #pykickstart KS文件检查 #xinetd 守护进程 systemctl start cobblerd && systemctl enable cobblerd
systemctl start httpd && systemctl enable httpd
systemctl start xinetd && systemctl enable xinetd

  

配置文件

/etc/cobbler             # 配置文件目录
/etc/cobbler/settings # cobbler主配置文件
/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日志

  

/etc/cobbler/settings中几个比较重要的参数设置(根据需求设置)

manage_dhcp:1
manage_dns:1
manage_tftpd:1
restart_dhcp:1
restart_dns:1
pxe_just_once:1 #防止安装循环配置始终从网络引导,激活此选项时机器告诉 Cobbler 安装已完成。Cobbler 将系统对象的 netboot 标志更改为 false,这会强制机器从本地磁盘引导
next_server:<服务器的 IP 地址> #用在 DHCP 配置文件中,向机器告知提供引导文件的服务器地址
server:<服务器的 IP 地址> #用于引用 Cobbler 服务器地址

  

初始化cobbler

systemctl restart cobblerd
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 : 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

  

获取启动文件

cobbler get-loaders   #下载有点慢

  

开启TFTP服务

vim /etc/xinetd.d/tftp
disable = no
systemctl restart xinetd

  

开启rsyncd服务

systemctl start rsyncd && systemctl enable rsyncd

设置默认root密码

openssl passwd -1 -salt 'root' 'root'   #密码明文为root
$1$root$9gr5KxwuEdiI80GtIzd.U0
vim /etc/cobbler/settings
101 default_password_crypted: "$1$root$9gr5KxwuEdiI80GtIzd.U0" 

cobbler管理DHCP

vim /etc/cobbler/dhcp.template #重启cobbler后,cobbler会生成一个模板文件
subnet 192.168.100.0 netmask 255.255.255.0 {
option routers 192.168.100.1;
option domain-name-servers 192.168.100.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.100.50 192.168.100.100;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;

  

生成新的配置文件

[root@linux-node1 ~]# systemctl restart cobblerd
[root@linux-node1 ~]# cobbler sync

  

导入镜像

mount /dev/cdrom /mnt #在光驱中加载一个完成的centos7 ISO文件
mount: /dev/sr0 is write-protected, mounting read-only
cobbler import --path=/mnt/ --name=/CentOS-7-x86_64 --arch=x86_64 #使用import导入
cobbler profile list #查看镜像目录
CentOS-7-x86_64
cobbler profile report #查看cobbler系统仓库中的版本信息
Name : CentOS-7-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : CentOS-7-x86_64 #版本名称
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {} #自定义内核参数
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.ks #这里显示此系统版本使用的是系统自带的kickstart文件

  

制作ks文件

kickstart文件的制作非常简单。

首先安装system-config-kickstart。

yum install system-config-kickstart
system-config-kickstart #要有桌面环境

修改默认ks文件执行system-config-kickstart启用图形界面进行配置(使用xmanager之类的连接程序)

cd /var/lib/cobbler/kickstarts/
上传自定义ks文件 CentOS-7-x86_64.cfg
cobbler profile edit --name=CentOS-7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS-7-x86_64.cfg #上传完成后修改成我们自己的ks文件
cobbler profile edit --name=CentOS-7-x86_64 --kopts='net.ifnames=0 biosdevname=0' #这里我们顺便修改一下内核文件参数,让centos7初始化网卡名为“eth”
cobbler sync #更改配置后都要执行

测试cobbler

web管理

https://192.168.100.132/cobbler_web

账号密码  cobbler cobbler

Cobbler 自动化部署系统的更多相关文章

  1. Cobbler自动化部署系统

    1.cobbler简介 ​ cobbler是一个LInux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装.重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等 ​ cobbler可以 ...

  2. Cobbler自动化部署最佳实践

    第1章 Cobbler自动化部署最佳实践 运维自动化在生产环境中占据着举足轻重的地位,尤其是面对几百台,几千台甚至几万台的服务器时,仅仅是安装操作系统,如果不通过自动化来完成,根本是不可想象的. 面对 ...

  3. .NET持续集成与自动化部署之路第一篇——半天搭建你的Jenkins持续集成与自动化部署系统

    .NET持续集成与自动化部署之路第一篇(半天搭建你的Jenkins持续集成与自动化部署系统) 前言     相信每一位程序员都经历过深夜加班上线的痛苦!而作为一个加班上线如家常便饭的码农,更是深感其痛 ...

  4. centos7.2环境nginx+mysql+php-fpm+svn配置walle自动化部署系统详解

    centos7.2环境nginx+mysql+php-fpm+svn配置walle自动化部署系统详解 操作系统:centos 7.2 x86_64 安装walle系统服务端 1.以下安装,均在宿主机( ...

  5. Cobbler自动化部署

    一:PXE.Kickstart与Cobbler的概念: PXE(preboot execute environment,预启动执行环境)是由Intel公司开发的技术,需要网卡的硬件支持,工作于C/S的 ...

  6. cobbler自动化安装系统

    笔者Q:972581034 交流群:605799367.有任何疑问可与笔者或加群交流 在很久很久以前,使用kickstart实现自动化安装的时候,我一直认为装系统是多么高大上的活,直到cobbler的 ...

  7. .NET 半天搭建Jenkins持续集成与自动化部署系统

    前言 相信每一位程序员都经历过深夜加班上线的痛苦!而作为一个加班上线如家常便饭的码农,更是深感其痛.由于我们所做的系统业务复杂,系统庞大,设计到多个系统之间的合作,而核心系统更是采用分布式系统架构,由 ...

  8. 自动化运维之Cobbler自动化部署安装操作系统

    Cobbler概述: Cobbler可以用来快速建立 Linux 网络安装环境,它已将 Linux 网络安装的技术门槛,从大专以上文化水平,成功降低到初中以下,连补鞋匠都能学会. 在生产环境中,经常批 ...

  9. (转)Cobbler自动化部署最佳实践

    原文:http://www.xuliangwei.com/xubusi/446.html 运维自动化在生产环境中占据着举足轻重的地位,尤其是面对几百台,几千台甚至几万台的服务器时,仅仅是安装操作系统, ...

随机推荐

  1. USACO The Clocks

    操作间没有次序关系,同一个操作最多重复3次... 可以直接暴力... The Clocks IOI'94 - Day 2 Consider nine clocks arranged in a 3x3 ...

  2. mariadb修改root密码的方法

    mariadb安装好后,root密码为空,可以先使用HeidiSQL链接到数据库,执行以下sql,就可以修改root的密码了 update mysql.user set password=passwo ...

  3. This dependency was not found: * !!vue-style-loader!css-loader?……解决方案

    1.新建一个vue项目时,需要重新安装stylus 报错 This dependency was not found: * !!vue-style-loader!css-loader?{"m ...

  4. App.config使用ASP.NET Web Project的Transformation

    1.创建对应configuration的App.config文件,比如:App.Debug.config.App.Release.config. 2.编辑项目文件,将App.*.config文件的Bu ...

  5. Android Usb Camera HAL框架

  6. gcc6.3的安装

    author:headsen  chen date: 2018-10-12  15:11:35 1,环境:centos7.3 ,64位,内核 3.10 2,安装过程 #!/bin/bash yum i ...

  7. kvm虚拟机不能使用virsh shutdownw命令关闭虚拟机的解决方法

    今天笔者在对kvm虚拟机进行管理时,使用virsh shutdown命令关闭指定的虚拟机时,发现虽然有如下的提示,但其实虚拟机却一直不会真正的关闭. 经过查看virsh命令帮助和上网查询,才得知vir ...

  8. OSS命令行工具ossutil

    ossutil工具旨在为您提供一个以命令行方式管理OSS数据的途径.当前版本未提供完整的Bucket和Multipart管理功能,相关功能会在后续版本中开发.如果您需要使用上述功能,建议先使用ossc ...

  9. 170816、nginx常用配置说明

    #user nobody; #开启进程数 <=CPU数  worker_processes 1; #错误日志保存位置 #error_log logs/error.log; #error_log ...

  10. 小程序中的block

    <block/> 并不是一个组件,它仅仅是一个包装元素,不会在页面中做任何渲染,只接受控制属性. 因为 wx:if 是一个控制属性,需要将它添加到一个标签上.如果要一次性判断多个组件标签, ...