Cobbler automatic deployment minimizes installation


Cobbler is an open source project developed using Python. It provides a network installation environment for fully automatic batch and rapid establishment of Linux systems by concentrating all the services involved in the deployment system.

Experiment preparation

A Linux server (Centos7 system, IP: 192.168.12.20)
A blank virtual machine
needs to be connected to the Internet, and the virtual machines use NAT mode

Replace official source

1. Backup mirror
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2. Download Ali source
wget -O /etc/yum.repos. d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
3. Clear yum cache
yum clean all
4. Regenerate the cache environment
yum makecache

Install epel source and replace it with Ali epel source

1. Install epel software
yum -y install epel-release
2. Replace
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
3. Online Update source
yum list

Cobbler automatic installation service construction steps

Install Cobbler and its related service software packages
yum install -y cobbler dhcp tftp-server pykickstart httpd rsync xinetd
Insert picture description here
The functions of each software are as follows
#cobbler is used to quickly establish a Linux network installation environment
#dhcp is used to automatically assign IP addresses to blank hosts
#tftp-server Provide boot image file download
#pykickstart to achieve unattended installation
#httpd run as a console program
#rsync to achieve data synchronization
#xinetd to provide access control, enhanced log and resource management functions

Modify the main cobbler configuration file
vim /etc/cobbler/settings #Modify the
following items
next_server: 192.168.80.10 #Point to the IP of the tftp server, that is, the local IP
server: 192.168.80.10 #Point to the IP of the cobbler server, that is, the local IP
manage_dhcp : 1
#Let cobbler manage the dhcp service manage_rsync: 1 #Let cobbler manage the rsync service
manage_tftpd: 1 #Let cobbler manage the tftp service to
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
start related services and turn off the firewall and selinux
systemctl start httpd.service #Open the http service
systemctl start cobblerd.service #open Cobbler service
systemctl stop firewalld
setenforce 0
Insert picture description here
Use the cobbler check command to check the settings of Cobbler, and query items that need to be changed. Cobbler check
enables the
Insert picture description here
tftp service and rsync service.
Modify the tftp configuration file
vim /etc/xinetd.d/tftp
disable = no to
Insert picture description here
enable Service
systemctl restart xinetd.service
systemctl start rsyncd.service
Insert picture description here
Download the boot operating system file
cobbler get-loaders
Insert picture description here
Set the initial password of the Cobbler user
Use salt encryption to generate the key
openssl passwd -1 -salt'abc123''abc123'
Any character can be written as the root user after installing the system the password
Insert picture description here
will be generated key is added Cobbler profile
Insert picture description here
configuration dhcp service
modify Cobbler dhcp service management template file
vim /etc/cobbler/dhcp.template
Subnet 192.168.80.0 Netmask 255.255.255.0 { the Option Routers 192.168.80.1; # modify gateway option domain-name-servers 192.168.80.2; #Modify DNS, if the network card is in dhcp mode, you can query the DNS address through nslookup 127.0.0.1 | grep server option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.80.100 192.168 .80.200; #Modify the address pool Synchronize the configured template file to the configuration file of the DHCP service cobbler sync restart the DHCP service systemctl restart dhcpd.service




Insert picture description here


Insert picture description here
Insert picture description here


Insert picture description here
Import the ISO image file
Mount the image file
mount /dev/sr0 /mnt
Insert picture description here
Import the Linux kernel in the iso image and initialize the image file
cobbler import --path=/mnt/ --name=CentOS-7-x86_64 --arch=x86_64
Insert picture description here
# Parameter description
#--path indicates the directory where the mirror is mounted
#--name
indicates the name defined for the installation source #--atch indicates the number of system bits of the specified installation source
#The default import storage path is /var/www/cobbler/ks_mirror/CentOS- 7-x86_64
Check whether the kernel and initialization files are in the tftp-server shared directory

yum install -y tree #The system is not installed by default, you need to manually install tree
tree /var/lib/tftpboot/images #Check if the file exists and
Insert picture description here
restart all services
systemctl restart cobblerd.service
systemctl restart dhcpd.service
systemctl restart xinetd.service
systemctl restart httpd .service
Insert picture description here
then use cobbler check to check the settings of Cobbler.
Insert picture description here
After all the configuration is complete, turn on the blank host to automatically install the system.
Insert picture description here
This installation method is a minimal installation, and the installed system only has a character interface.
Login account: root Password: abc123
Insert picture description here
Minimize the graphical interface to install
yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
reboot
or
startx

Guess you like

Origin blog.csdn.net/MQ107/article/details/114580222