Unattended installation script kickstart in linux

The role of automatic installation scripts under linux system and the significance of enterprises

#Problems faced
when installing multiple operating systems in an enterprise When installing a linux system, the installation process will need to answer many questions about settings.
These questions must be selected manually, otherwise the installation cannot be performed.
When only one linnux system is installed, manually Setting workload is relatively easy.
When installing multiple linux, these settings need to be repeated many times, these repetitive actions are inefficient operations

#How to solve the above problems
Use a file to record the answers to the questions used in the installation process, and let all the hosts that need to be installed automatically read

kickstart action #

In the above solution, the file that records the answers to all the questions in the system installation process is called the kickstart script

2. Experimental environment

1. Host name: westos_node1
2.ip: 172.25.254.40
3. Fire wall, selinux off
4. httpd service on
5. Configuration software warehouse can work normally

Making of kickstart automatic installation script

Kickstart production method to provide graphics
in the rhel7 system. The graphics tools have been cancelled in the rhel8 system and added to the rhn network
. If kickstart is not available in rhel8, you can use the template to generate #through
template files to generate kickstart files#
in the installed rhel8 In, /root/anacanda-ks.cfg, is the answer to all the questions answered when the current system is installed. The
generated kickstart, this file is the kickstart template

Operation steps:
1. Shared resources
dnf install httpd -y
systemctl enable --now httpd
systemctl disable --now firewalld
setenfore 0 ##selinux adjust to warning mode
mkdir /var/www/html/westos_8
mount /dev/cdrom /var/ www/html/westos_8
test resource sharing
firefox http : //172.25.254.40/westos_8

#The meaning of shared resources
When installing the operating system, each installed operating system must have installation resources.
If you use mirrored installation, you need to add a mirrored image to each installed system.
This will waste storage and share it through the network The resources in the mirror allow the hosts installing the system to access the shared resources through the network, so that the problem of multiple hosts requiring multiple mirror installations can be solved

#用templatekickstart#
In the installed rhel8, /root/anacoda-ks.cfg is the kickstart generated by answering all the answers to the questions when the current system is installed. This file is the kickstart template
cp /root/anacoda- ks.cfg /var/www/html/westos.cfg
vim /var/www/html/westos.cfg
Insert picture description here
Insert picture description here
generation of cipher text password for root user
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

#%pre ##Scripts that run automatically before installation of the system
#%end
#%post ##Scripts that are automatically executed after system installation
cat>> /etc/yum.repos.d/westos.repo<<EOF

Turn on httpd service
Turn off the firewall

Guess you like

Origin blog.csdn.net/Antonhu/article/details/113406418