Experiment: PAM
Authenticator Authenticator
sed -i 's/^server.*/#&/;1aserver 192.168.39.8 iburst' /etc/chrony.conf
Experiment: chrony and ntp
Experimental: kickstart file generation, system-config-kickstart
semi-automated installation centos6,7,8 mini install
实验:dhcp服务
[root@centos8 dhcp]#grep -v "^#" dhcpd.conf
option domain-name "magedu.org";
option domain-name-servers 180.76.76.76, 114.114.114.114;
default-lease-time 86400;
max-lease-time 100000;
log-facility local7;
subnet 192.168.39.0 netmask 255.255.255.0 {
range 192.168.39.10 192.168.39.100;
range 192.168.39.150 192.168.39.200;
option routers 192.168.39.2;
}
host test {
hardware ethernet 00:0c:29:58:4f:12;
fixed-address 192.168.39.120;
}
Experiment: tftp service
Experiment: PXE-based installation automation CentOS8 installation centos6,7,8
1 dnf install dhcp-server tftp-server httpd syslinux-nonlinux
2 systemctl enable --now httpd tftp dhcpd
Preparation 3 yum warehouse
mkdir / var / WWW / HTML / CentOS / 6,7, 8} {/ ISOS / the x86_64 / -pv
Mount / dev / SR0 / var / WWW / HTML / CentOS /. 8 / ISOS / the x86_64 /
4准备ks文件
mkdir /var/www/html/ksdir/
[root@centos8 ksdir]#grep -Ev "^#|^$" /var/www/html/ksdir/ks8.cfg
ignoredisk --only-use=sda
zerombr
text
reboot
clearpart --all --initlabel
selinux --disabled
firewall --disabled
url --url=http://192.168.39.8/centos/8/isos/x86_64/
keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
network --bootproto=dhcp --device=ens160 --ipv6=auto --activate
network --hostname=centos8.magedu.com
rootpw --iscrypted $6$nOPs5JTMlP4mhQeW$R/o62B6SXAh3RR.zrZ3U0X4xYX9/u5nSLrR/vqCB6kdO2XFfMk2a4yAgrHJQpXK/e4jzRb0jiLBv2nFMXaBjB/
firstboot --enable
skipx
services --disabled="chronyd"
timezone Asia/Shanghai --isUtc --nontp
user --name=wang --password=$6$oUfb/02CWfLb5l8f$sgEZeR7c7DpqfpmFDH6huSmDbW1XQNR4qKl2EPns.gOXqlnAIgv9pTogtFVaDtEpMOC.SWXKYqxfVtd9MCwxb1 --iscrypted --gecos="wang"
part / --fstype="xfs" --ondisk=sda --size=102400
part /data --fstype="xfs" --ondisk=sda --size=51200
part swap --fstype="swap" --ondisk=sda --size=2048
part /boot --fstype="ext4" --ondisk=sda --size=1024br/>%packages
@^minimal-environment
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
5 dhcp 配置
cp /usr/share/doc/dhcp-server/dhcpd.conf.example /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
option domain-name "example.org";
option domain-name-servers 180.76.76.76,114.114.114.114;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.39.0 netmask 255.255.255.0 {
range 192.168.39.100 192.168.39.200;
option routers 192.168.39.2;
next-server 192.168.39.8;
filename "pxelinux.0";
}
systemctl start dhcpd
Preparation 6 tftp documents
CP /usr/share/syslinux/{pxelinux.0,menu.c32} / var / lib / tftpboot /
CP /misc/cd/isolinux/{ldlinux.c32,libcom32.c32,libutil.c32, vmlinuz, the initrd.img} / var / lib / tftpboot /
mkdir /var/lib/tftpboot/pxelinux.cfg/
CP /misc/cd/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
mkdir / var / lib / tftpboot / 6,7, 8} {
[@ centos8 the root tftpboot] #tree
.
├──. 6
│ ├── the initrd.img
│ └── vmlinuz
├──. 7
│ ├── the initrd.img
│ vmlinuz └──
├──. 8
│ ├── the initrd.img
│ └── vmlinuz
├── ldlinux.c32
├── libcom32.c32
├── libutil.c32
├── the menu.c32
├── the pxelinux.0
└── pxelinux.cfg
└── default
4 directories, 12 files
7 Create the installation menu
vim /var/lib/tftpboot/pxelinux.cfg/default
default the menu.c32
timeout 600
menu title CentOS Linux
label linux8
menu label Auto Install CentOS Linux ^8.0 Mini
kernel 8/vmlinuz
append initrd=8/initrd.img ks=http://192.168.39.8/ksdir/ks8_mini.cfg
label linux7
menu label Auto Install CentOS Linux ^7 Mini
kernel 7/vmlinuz
append initrd=7/initrd.img ks=http://192.168.39.8/ksdir/ks7.cfg
label linux6
menu label Auto Install CentOS Linux ^6 Mini
kernel 6/vmlinuz
append initrd=6/initrd.img ks=http://192.168.39.8/ksdir/ks6.cfg
label manual
menu label ^Manual Install CentOS Linux 8.0
kernel vmlinuz
append initrd=initrd.img inst.repo=http://192.168.39.8/centos/8/isos/x86_64/
label local
menu default
menu label Boot from ^local drive
localboot 0xffff
Experiment: centos7 Based cobbler to automate installation
1 yum install cobbler dhcp
systemctl enable --now cobblerd httpd tftp dhcpd
Check cobbler 2
Vim / etc / cobbler / Settings
default_password_crypted: "gEc7ilpP $ $ $. 1 pg5iSOj / mlxTxEslhRvyp /"
manage_dhcp:. 1
next_server: <tftp the IP address of the server>
Server: <cobbler the IP address of the server>
systemctl restart cobblerd
cobbler sync
3 download files
Cobbler GET-loaders
Cobbler Sync
4 dhcp服务
vim /etc/cobbler/dhcp.template
subnet 192.168.39.0 netmask 255.255.255.0 {
option routers 192.168.39.2;
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.39.100 192.168.39.254;
cobbler sync
systemctl start dhcpd
5 introducing system installation files
cobbler import --name = centos-8.0- x86_64 --path = / media / cdrom --arch = x86_64
6 ready ks
[root@centos7 kickstarts]#cat /var/lib/cobbler/kickstarts/ks8.cfg
#version=RHEL8
ignoredisk --only-use=sda
zerombr
text
reboot
Partition clearing information
clearpart --all --initlabel
selinux --disabled
firewall --disabled
Use graphical install
#repo --name="Appstream" --baseurl=http://192.168.39.8/centos/8/isos/x86_64/AppStream
url --url=$tree
#repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
Use CDROM installation media
Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
System language
long en_US.UTF-8
Network information
network --bootproto=dhcp --device=ens160 --ipv6=auto --activate
network --hostname=centos8.magedu.com
Root password
rootpw --iscrypted $6$nOPs5JTMlP4mhQeW$R/o62B6SXAh3RR.zrZ3U0X4xYX9/u5nSLrR/vqCB6kdO2XFfMk2a4yAgrHJQpXK/e4jzRb0jiLBv2nFMXaBjB/
Run the Setup Agent on first boot
firstboot --enable
Do not configure the X Window System
skipx
System services
services --disabled="chronyd"
System timezone
timezone Asia/Shanghai --isUtc --nontp
user --name=wang --password=$6$oUfb/02CWfLb5l8f$sgEZeR7c7DpqfpmFDH6huSmDbW1XQNR4qKl2EPns.gOXqlnAIgv9pTogtFVaDtEpMOC.SWXKYqxfVtd9MCwxb1 --iscrypted --gecos="wang"
Disk partitioning information
part / --fstype="xfs" --ondisk=sda --size=102400
part /data --fstype="xfs" --ondisk=sda --size=51200
part swap --fstype="swap" --ondisk=sda --size=2048
part /boot --fstype="ext4" --ondisk=sda --size=1024
%packagesbr/>@^minimal-environment
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
cobbler profile add --name=CentOS8.0_mini --distro=CentOS8.0-x86_64 --kickstart= /var/lib/cobbler/kickstarts/ks8.cfg
cobbler profile remove --name=CentOS8.0-x86_64
Experiment: The web management to achieve cobbler
yum install cobbler-web
systemctl restart httpd
Experiment: Primary DNS server implementations
yum install python2-pip
pip install Django==1.8.17