Linux-Cobbler automatic deployment and installation
- 1. Cobbler automatically deploys and installs
- Two, experiment preparation
-
- 1. Import epel source
- 2. Install Cobbler and its related service packages
- 3. Modify the main configuration file of cobbler
- 4. Start related services and close the firewall and selinux
- 5. Turn on the tftp service and rsync service
- 6. Download the boot operating system file
- 7. Set the initial password of the Cobbler user
- 8. Configure dhcp service
- 9. Import the ISO image file
- 10. Restart all services
- 11. Use cobbler check again to check settings for Cobbler
- 12. After all configurations are completed, turn on the blank host to automatically install the system
- 13. If you need a graphical interface, you can install it manually
1. Cobbler automatically deploys and installs
Cobbler is an open source project developed using Python. It provides a fully automated and batch network installation environment for quickly establishing a Linux system by concentrating all the services involved in the deployment system.
Two, experiment preparation
A Linux server (Centos7 system, IP: 192.168.80.134)
A blank virtual machine
needs to be connected to the Internet, and the virtual machines use NAT mode
related software packages: link: https://pan.baidu.com/s/1Cl2H_cufGmbHCWfs_mObCQ Password: desg
Cobbler automatic installation service construction steps
1. Import epel source
rpm --ivh epel-release-latest-7.noarch.rpm - install dependency package
yum list - automatically load online update source
2. Install Cobbler and its related service packages
yum install -y cobbler dhcp tftp-server pykickstart httpd rsync xinetd #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 provides boot image file download
# pykickstart realizes unattended installation
#httpd runs as a console program
#rsync realizes data synchronization
#xinetd provides access control, enhanced log and resource management functions
3. Modify the main configuration file of cobbler
vim /etc/cobbler/settings #Modify the
following items
next_server: 192.168.80.10 #Point to the IP of the tftp server, which is the local IP
server: 192.168.80.10 #Point to the IP of the cobbler server, which is the local IP
manage_dhcp: 1 #Let cobbler Manage dhcp service
manage_rsync: 1 #Let cobbler manage rsync service
manage_tftpd: 1 #Let cobbler manage tftp service
4. Start related services and close the firewall and selinux
①Start the service systemctl start httpd.service #Start the http service
systemctl start cobblerd.service #Start the cobbler service
systemctl stop firewalld.service
setenforce 0 ②Use the
cobbler check command to check the settings of Cobbler, and query items that need to be changed.
cobbler check
5. Turn on the tftp service and rsync service
①Modify the configuration file of tftp
vim /etc/xinetd.d/tftp
disable = no
②Start the service systemctl restart xinetd.service
systemctl start rsyncd.service
6. Download the boot operating system file
cobbler get-loaders
7. Set the initial password of the Cobbler user
①Use salt encryption to generate the key
openssl passwd -1 -salt'abc123''abc123'
can write the password of the root user after installing the system ②Add
the generated key to the Cobbler configuration file
8. Configure dhcp service
①Modify the template file vim /etc/cobbler/dhcp.template of Cobbler management dhcp service- modify the file
②Synchronize the configured template file to the configuration file of the DHCP service
cobbler sync ③Restart the
DHCP service
systemctl restart dhcpd.service
9. Import the ISO image file
Mount image file ①
Mount / dev / SR0 / mnt
② iso image introduced in the Linux kernel, initialization image file
cobbler import --path = / mnt / --name = CentOS-7-x86_64 --arch = x86_64
Parameters
- path represents the directory where the mirror is mounted
-name represents the name defined for the installation source
-atch represents 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 shared directory of tftp-server yum install -y tree——the system is not installed by default, you need to manually install the tree
tree /var/lib/tftpboot/images——check whether the file exists
10. Restart all services
systemctl restart cobblerd.service
systemctl restart dhcpd.service
systemctl restart xinetd.service
systemctl restart httpd.service
11. Use cobbler check again to check settings for Cobbler
12. After all configurations are completed, turn on the blank host to automatically install the system
This installation method is a minimal installation, and the installed system only has a character interface.
Login account: root Password: abc123
13. If you need a graphical interface, you can install it manually
yum groupinstall “X Window System”
yum update grub2-common
yum install -y grub2-efi
yum install -y fwupdate
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch. rpm
yum groupinstall "GNOME Desktop"
ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/ system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
reboot
After reboot , the following interface will appear