Just entered the company, listening to colleagues mentioned cobbler, before only know that there is a PXE, and later on the Internet to find some information, I found a server to test a bit
Cobbler
Deployment environment:
Cobbler-server Dell PowerEdge C6220
Cobbler-server OS Centos6.4
Cobbler_server ip:192.168.1.100
Cobbler Installation Environment:
1, installation Epel
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm-uvh epel-release-6*.rpm
2. Service Installation
Yum-y Install cobbler httpd rsync tftp xinetd DHCP Cman Pykickstart
3. Modify the Cobbler configuration file /etc/cobbler/settings
Sed-i ' s/manage_dhcp:0/manage_dhcp:1/'/etc/cobbler/settings#开启dhcp功能
Sed-i ' s/manage_rsync:0/manage_rsync:1/'/etc/cobbler/settings#开启rsync功能
Sed-i ' S/next_server:127.0.0.1/next_server:192.168.1.100/'/etc/cobbler/settings#设置你的 TFTP server address
Sed-i ' S/server:127.0.0.1/server:192.168.1.100/'/etc/cobbler/settings#cobbler_server Address
4, to open cobbler service before need to do
Service Iptables Stop #关闭防火墙
Setenforce 0 #关闭selinux
/etc/xinetd.d/tftp
Disable = no #开启tftp服务
/etc/xinetd.d/rsync
Disable = no #开启 rsync Services
OpenSSL passwd-1-salt ' Cocosoa ' 00001234 ' Generate the system after the installation of the root password, Cocosoa is the interference password, 00001234 is the system login password
Vim/etc/cobbler/settings Edit the configuration file to replace the default password with the newly generated
default_password_crypted: "$1$cocosoa$oaesze7vlkwhmpibeojd81"
Cobbler Get-loaders #下载引导操作系统文件
Yum Install Debmirror-y
Vim/etc/debmirror.conf
# @dists = "Sid"; Cancellation
# @arches = "i386"; Cancellation
To configure the DHCP service, you only need to modify the Cobbler DHCP template file to
Vim/etc/cobbler/dhcp.template
Subnet 192.168.1.0 netmask 255.255.255.0 {
Option routers 192.168.1.5;
Option Domain-name-servers 192.168.1.1;
Option Subnet-mask 255.255.255.0;
Range DYNAMIC-BOOTP 192.168.1.100 192.168.1.254;
Default-lease-time 21600;
Max-lease-time 43200;
Next-server 192.168.1.122;
Class "Pxeclients" {
Match if substring (option vendor-class-identifier, 0, 9) = "Pxeclient";
If option Pxe-system-type = 00:02 {
FileName "Ia64/elilo.efi";
} else if option Pxe-system-type = 00:06 {
FileName "Grub/grub-x86.efi";
} else if option Pxe-system-type = 00:07 {
FileName "Grub/grub-x86_64.efi";
} else {
FileName "pxelinux.0";
}
}
}
Note After the modification, using Cobbler Sync Sync under the configuration file, or DHCP will not start, error
5. Start the service
Service httpd Start Add servername localhost:80 to the configuration file
Service Cobbler Start
Chkconfig httpd on
Chkconfig Cobblerd on
Chkconfig DHCPD on
Chkconfig xinetd on
Chkconfig TFTP on
Chkconfig iptables off
6. Import image
Cobbler Import--path=/media--name=centos6.4--arch=x86_64
Touch/var/lib/cobbler/kickstarts/centos6.4.ks
Cobbler profile Add--name=centos6.4--distro=centos6.4-x86_64--KICKSTART=/VAR/LIB/COBBLER/KICKSTARTS/CENTOS6.4.KS
Add a profile file and use centos6.4-x86_64 this distro, and specify the corresponding KS file, the KS file is prepared beforehand
Vim/etc/cobbler/pxe/pxedefault.template #编辑pxe模板
OnTimeOut centos6.4 #修改默认安装的profile为centos6.4, which means that when you do not have a choice, the profile is automatically installed after the timeout operation
7. Edit the Kickstarts file #可以自己写
Vim/var/lib/cobbler/kickstarts/centos6.4.ks
Install
Auth--useshadow--enablemd5
Key--skip
Bootloader--LOCATION=MBR
Clearpart--all--initlabel
Text
Firewall--disabled
Keyboard US
Lang en_US
URL--url= $tree
Reboot
ROOTPW--iscrypted $1$cocosoa$oaesze7vlkwhmpibeojd81
SELinux--disabled
TimeZone--ISUTC Asia/shanghai
Zerombr
Autopart
%packages
$SNIPPET (' package ')
cat/var/lib/cobbler/snippets/ Package
This file is written to the package that needs to be installed
The following is the extension directory, you can add a separate configuration file, easy to manage
/var/lib/cobbler/snippets
$SNIPPET (file name) The file is to be created under/var/lib/cobbler/snippets edit.
# System Authorization Information
Auth--useshadow--enablemd #用户登录认证
# System Bootloader Configuration
Bootloader--LOCATION=MBR #mbr引导
# Partition Clearing Information
Clearpart--all--initlabel #默认清除所以分区
# Use text mode install
Text #默认以文本模式安装
# Firewall Configuration
Firewall--enabled #防火墙默认开启
# Run The Setup Agent on first boot
Firstboot--disable #禁用启动代理
# System Keyboard
Keyboard US #默认英文键盘
# System Language
Lang en_US #默认语言英文
# Use Network Installation
URL--url= $tree #网络安装路径
# If Any cobbler repo definitions were referenced in the Kickstart profiles, include them here
$yum _repo_stanza #默认的yum仓库
# Network Information
$SNIPPET (' Network_config ')
# Reboot after installation
Reboot #安装完成后重启
#Root Password
ROOTPW--iscrypted $default _password_crypted #密码是我们/etc/cobbler/settings Set Password
# SELinux Configuration
SELinux--disabled #默认关闭selinux
# Do not configure the X Window System
Skipx #默认没有安装图形界面
# System TimeZone
TimeZone America/new_york #默认时区是美国/New York
# Install OS instead of upgrade
Install #定义的是安装系统而不是升级系统
# Clear the Master Boot Record
ZEROMBR #默认清空所有的mbr
# Allow Anaconda to partition the system as needed
Autopart #默认自动分区
It communication Group 144486234
This article is from the "Jonnter" blog, make sure to keep this source http://jonnter.blog.51cto.com/7927220/1831807
Cent OS Deployment Cobbler