Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

19.2.5 Create a KickStart answer file


May 24, 2021 That's what Linux should learn



After all, we're using PXE and Kickstart to deploy an "unattended installation system service" instead of an "unattended transport system disc mirroring service", so we also need to be able to get the client host to get the disc image while automatically helping us fill out the options that appear during the installation process. S imply put, if there are 100 servers in the production environment that need to be installed in the same system environment, the buttons clicked and the information filled in during the installation process should be the same. S o why not create a list of requirements similar to a memo? In this way, when the unattended installation of the system, you can find the corresponding option value from this list of requirements, thus eliminating the pain of manual input, and more importantly, also completely liberated human intervention, completely realize the unattended automatic installation of the system, rather than simply transmitting the system disc image.

With the above to pave the way, I believe you should now be able to guess that Kickstart is not actually a service program, but an answer file. T hat's right! T he Kickstart answer file contains the options and parameter information that need to be used during the system installation process, and the system can automatically access the contents of this answer file, thus completely realizing the unattended installation system. S o, since this document is so important, where to look? I n fact, in the root administrator's home directory there is a file called anaconda-ks .cfg, which is the answer file. T he file is now copied to the working directory of the vsftpd service provider (the acquisition path for the file is already defined in the configuration file of the power-on options menu, which is the pub subdirector in the vsftpd service provider data directory). Use the chmod command to set permissions for the file, ensuring that everyone has readable permissions to ensure that the client host has smooth access to the answer file and its contents:

The root@linuxprobe kickstart answer file is not as complex as you think.cfg, it has only about 46 lines of parameters and comments.cfg, and we can root@linuxprobe quickly understand the effect of each parameter by name and introduction.cfg. Mr. Liu Wei here to select a few more representative parameters to explain, other parameters suggest that we modify the test.

First of all, the 6th line of the optical image installation method modified to the FTP protocol, carefully fill in the IP address of the FTP server, and use the local browser to try to open the next check for errors. Then modify the time zone on line 21 to Shanghai, and finally set the disk option for line 29 to empty all disk content and initialize the disk:

[root@linuxprobe ~]# vim /var/ftp/pub/ks.cfg 1 #version=RHEL7 2 # System authorization information 3 auth --enableshadow --passalgo=sha512 4 5 # Use CDROM installation media 6 url --url=ftp://192.168.10.10 7 # Run the Setup Agent on first boot 8 firstboot --enable 9 ignoredisk --only-use=sda 10 # Keyboard layouts 11 keyboard --vckeymap=us --xlayouts='us' 12 # System language 13 lang en_US. UTF-8 14 15 # Network information 16 network --bootproto=dhcp --device=eno16777728 --onboot=off --ipv6=auto 17 network --hostname=localhost.localdomain 18 # Root password 19 rootpw --iscrypted $6$pDjJf42g8C6pL069$iI.PX/yFaqpo0ENw2pa7MomkjLyoae2zjMz2UZJ7b H3UO4oWtR1.Wk/hxZ3XIGmzGJPcs/MgpYssoi8hPCt8b/ 20 # System timezone 21 timezone Asia/Shanghai --isUtc 22 user -- n ame=linuxprobe --password=$6$a9v3InSTNbweIR7D$JegfYWbCdoOokj9sodEccdO.zL F4oSH2AZ2ss2R05B6Lz2A0v2K.RjwsBALL2FeKQVgf640oa/tok6J.7GUtO/ --iscrypted --gecos ="linuxprobe" 23 # X Window System configuration information 24 xconfig --startxonboot 25 # System bootloader configuration 26 bootloader --location=mbr --boot-drive=sda 27 autopart --type=lvm 28 # Partition c learing information 29 clearpart --all --initlabel 30 31 %packages 32 @base 33 @core 34 @desktop-debugging 35 @dial-up 36 @fonts 37 @gnome-desktop 38 @guest-agents 39 @guest -agents 40 @input-methods 41 @internet-browser 42 @multimedia 43 @print-client 44 @x11 45 46%end If you feel that the system comes with fewer answer file parameters by default and does not meet the needs of the production environment, you can install the system-config-kickstart package through the Yum software repository. This is a graphical Kickstart answer file generation tool that generates custom answer files based on your needs, then places the generated files in the /var/ftp/pub directory and changes the name to ks.cfg.

Have a problem? Ask bold questions!

Because readers have different hardware or operation errors may lead to experimental configuration errors, please be patient and take a closer look at the operation steps, do not be discouraged

Linux technical exchange please add Group A: 560843 (full), Group B: 340829 (recommended), Group C: 463590 (recommended), click here to view the national group.

This group features: through password verification to ensure that each group member is "Linux should learn" readers, more targeted, from time to time free to receive customized gifts.