Cobbler is a fast network-installed Linux service and can be adjusted to support network installation of Windows. The tool uses Python development, small and lightweight, with simple commands to complete the configuration of the PXE network installation environment, but also to manage DHCP, DNS, TFTP, rsync and the Yum Warehouse, the construction system ISO image.
Cobbler Support Command line management, web interface management, also provides API interface, can be easily used two times development.
Cobbler client Koan supports virtual machine installation and operating system reinstallation, making reloading systems easier.
Environment preparation
- VMware 12 Virtual Machines
- Centos 7 operating System (NIC mode: NAT mode; IP address: 192.168.96.129)
- Package: epel-release-latest-7.noarch.rpm Password: fqw7
Service Deployment
Install the EPEL-RELEASE-LATEST-7.NOARCH.RPM software package (cobbler related packages are provided by Epel Source)
rpm -ivh /mnt/epel-release-latest-7.noarch.rpm
- Install Cobbler cobbler-web DHCP tftp-server pykickstart httpd rsync xinetd Package
yum install cobbler cobbler-web dhcp tftp-server pykickstart httpd rsync xinetd -y
- To modify the Cobbler master configuration file:
vim /etc/cobbler/settings
next-server:192.168.96.129 #tftp服务器的ip地址
server:192.168.96.129 #服务器的ip地址
Manage_dhcp:1 #开启dhcp功能
- Check settings for cobbler using cobbler check
---------------------tip: Need to optimize-----------------------------------
The following is potential configuration items and that's want to fix:
1:selinux is enabled. Review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
https: #github. com/cobbler/cobbler/wiki/selinux
2:change ' disable ' to ' no ' in/etc/xinetd.d/tftp
3:some network boot-loaders is missing from/var/lib/cobbler/loaders, you could run ' cobbler get-loaders ' to download the M, or, if you are want to handle x86/x86_64 netbooting, and you could ensure that you haveinstalled a recent version O F the Syslinux package installed and can ignore this message entirely. Files in this directory, should want to support all architectures, should include pxelinux.0, MENU.C32, Elilo.efi, and Yaboot. The ' Cobbler get-loaders ' command is the easiest-to resolve these requirements.
4:enable and start Rsyncd.service with Systemctl
5:debmirror package isn't installed, it'll 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/COBBL Er/settings) is still set to ' cobbler ' and should be changed, try: "OpenSSL passwd-1-salt ' Random-phrase-here ' Your-pass Word-here ' "To generate new one
7:fencing tools were not found, and is 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.
- To modify the Cobbler user's initial password, you can use the following command to generate the password
openssl passwd -1 -salt ‘abc123‘ ‘abc123‘ #盐值加密
$1$abc123$9v8z2./e/pzihxrvcy3ii0 #加密后的密码
Replace this password in the settings file
default_password_crypted: "$1$abner$kdle2knwbphdm1uzee79v." #替换密码, this is the root user password
: wq! #保存退出
Download boot operating system files
Start the RSYNCD service
systemctl start rsyncd.service
- Enable TFTP service
vim /etc/xinetd.d/tftp
Disable = no #将yes修改为no, TFTP enabled
Restart XINETD Service
Systemctl Restart Xinetd.service
- Edit a DHCP template file
vim /etc/cobbler/dhcp.template
#cobbler控制的dhcp服务模板
Subnet 192.168.96.0 netmask 255.255.255.0 {
Option routers 192.168.96.1; #修改网关
Option Domain-name-servers 192.168.96.2; #修改DNS
Option Subnet-mask 255.255.255.0;
Range DYNAMIC-BOOTP 192.168.96.100 192.168.96.200; #修改地址池
: wq! #保存退出
- To generate a DHCP configuration file synchronously
cobbler sync
Start the DHCPD service
systemctl restart dhcpd.service
- Loading system disc Mirroring
mount /dev/sr0 /mnt
#导入iso镜像
#默认导入存放位置
/var/www/cobbler/ks_mirror/CentOS-7-x86_64
#查看导入结果
cobbler list
Distros:
Centos-7-x86_64
Profiles
Centos-7-x86_64
Systems
Repos
Images
Mgmtclasses:
Packages
Files
#查看发行版本
cobbler distro list
#安装tree软件包
yum install tree -y
Tree/var/lib/tftpboot/images #查看内核和初始化文件在tftp Server shared directory
└──centos-7-x86_64
├──initrd.img
└──vmlinuz
cobbler profile report
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 Metadata: {}
Management Classes: []
Management Parameters: <<inherit>>
Name Servers: []
Name Servers Search Path: []
Owners: [' admin ']
Parent Profile:
Internal Proxy:
Red Hat Management Key: <<inherit>>
Red Hat Management Server: <<inherit>>
Repos: []
Server Override: <<inherit>>
Template Files: {}
Virt Auto boot:1
Virt bridge:xenbr0
Virt cpus:1
Virt Disk Driver Type:raw
Virt File Size (GB): 5
Virt Path:
Virt RAM (MB): 512
Virt TYPE:KVM
#ks默认文件存放位置
#cobbler日志文件所在位置
/var/log/cobbler/cobbler.log
Turn off firewall and security features
Setenforce 0
Systemctl Stop Firewalld.service
Client installation is complete with character interface only
Login account Name: root password: abc123
Cobbler Web user settings
vim /etc/cobbler/modules.conf
Authn_configfile #默认就是模块认证
Htdigest-c/etc/cobbler/users.digest Cobbler Maaiqiang
Enter two times to confirm the password (123123)
#重新启动cobblerd, httpd Services
Systemctl Restart Cobblerd.service
Systemctl Restart Httpd.service
Automatic machine
The following is the Cobbler Web management platform
"Pro-Test available" Cobbler Automated batch deployment of Linux systems