如何使用cobbler定制安装

cobbler批量安装

客户端安装

新建虚拟机从pxe启动,若出现以下界面则表示成功:

uos9安装

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

rockylinux9安装:

切换镜像
[root@cjy ~]# umount /mnt
[root@cjy ~]# mount /dev/cdrom /mnt
升级
[root@cjy ~]# cobbler signature update
task started: 2023-12-25_151906_sigupdate
task started (id=Updating Signatures, time=Mon Dec 25 15:19:06 2023)
running python triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
shell triggers finished successfully
Successfully got file from https://cobbler.github.io/signatures/3.0.x/latest.json
*** TASK COMPLETE ***

[root@cjy ~]# cobbler import --path=/mnt --name=rockylinux9 --arch=x86_64
task started: 2023-12-25_152306_import
task started (id=Media import, time=Mon Dec 25 16:50:06 2023)
running python triggers from /var/lib/cobbler/triggers/task/import/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/import/pre/*
shell triggers finished successfully
Found a candidate signature: breed=redhat, version=rhel8
Found a candidate signature: breed=redhat, version=rhel9
Found a matching signature: breed=redhat, version=rhel9
Adding distros from path /var/www/cobbler/distro_mirror/rockylinux-9-x86_64:
skipping import, as distro name already exists: rockylinux-9-x86_64
No distros imported, bailing out
*** TASK COMPLETE ***
写ks文件
[root@cjy ~]# vim /var/lib/cobbler/templates/rockylinux9.ks 
[root@cjy ~]# cat /var/lib/cobbler/templates/rockylinux9.ks 
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.159.148/cobbler/links/rockylinux9-x86_64/
$yum_repo_stanza
reboot

rootpw --iscrypted "$6$BhgpUy/vf7qCaTU5$nl7uR.wgWxo/nuah8zeYsJRXGEYUUaTg//Njihb3lSKrvFRqZJQ9E1a83vAZ0K/HTROWEV3HB..1qZBMHd/E3."


selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
zerombr

%packages
@core
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
[root@cjy ~]# cobbler validate-autoinstalls
task started: 2023-12-25_153833_validate_autoinstall_files
task started (id=Automated installation files validation, time=Mon Dec 25 16:58:33 2023)
running python triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/validate_autoinstall_files/pre/*
shell triggers finished successfully
*** TASK COMPLETE ***
[root@cjy ~]# cobbler profile edit --name rockylinux9-x86_64 --autoinstall=rockylinux9.ks
[root@cjy ~]# cobbler profile list 
   rockylinux9-x86_64
   uos20-x86_64
[root@cjy ~]# cobbler profile edit --name rockylinux9-x86_64 --kernel-options='net.ifnames=0 biosdevname=0'
[root@cjy ~]# cobbler profile report
Name                           : uos20-x86_64
Automatic Installation Template : uos20.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : uos20-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

Name                           : rockylinux9-x86_64
Automatic Installation Template : rockylinux9.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : rockylinux9-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm
[root@cjy ~]# cd /var/lib/tftpboot/
[root@cjy tftpboot]# vim grub/x86_64_menu_items.cfg
..................................................
append initrd=/images/rockylinux9-x86_64/initrd.img net.ifnames=0 biosdevname=0  inst.kssendmac inst.ks=http://192.168.159.148/cblr/svc/op/autoinstall/profile/rockylinux9-x86_64
...................................................
更改kssendmac、ks为inst.kssendmac 、inst.ks
[root@cjy tftpboot]# vim /usr/lib/python3.6/site-packages/cobbler/tftpgen.py
..................................................
 append_line += " inst.kssendmac"
                append_line = "%s inst.ks=%s" % (append_line, autoinstall_path)
...................................................
更改kssendmac、ks为inst.kssendmac 、inst.ks
[root@cjy tftpboot]# vim pxelinux.cfg/default
...................................................
append initrd=/images/rockylinux9-x86_64/initrd.img net.ifnames=0 biosdevname=0  inst.kssendmac inst.ks=http://192.168.159.148/cblr/svc/op/autoinstall/profile/rockylinux9-x86_64
...................................................
更改kssendmac、ks为inst.kssendmac 、inst.ks

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

centos8安装

切换镜像
[root@cjy ~]# umount /mnt
[root@cjy ~]# mount /dev/cdrom /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
升级
[root@cjy ~]# cobbler signature update
task started: 2023-12-25_182428_sigupdate
task started (id=Updating Signatures, time=Mon Dec 25 18:24:28 2023)
running python triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sigupdate/pre/*
shell triggers finished successfully
Successfully got file from https://cobbler.github.io/signatures/3.0.x/latest.json
*** TASK COMPLETE ***
上传镜像
[root@cjy ~]# cobbler import --path=/mnt --name=centos8 --arch=x86_64
task started: 2023-12-25_182631_import
task started (id=Media import, time=Mon Dec 25 18:26:31 2023)
running python triggers from /var/lib/cobbler/triggers/task/import/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/import/pre/*
shell triggers finished successfully
Found a candidate signature: breed=redhat, version=rhel8
Found a matching signature: breed=redhat, version=rhel8
Adding distros from path /var/www/cobbler/distro_mirror/centos8-x86_64:
creating new distro: centos8-x86_64
trying symlink: /var/www/cobbler/distro_mirror/centos8-x86_64 -> /var/www/cobbler/links/centos8-x86_64
creating new profile: centos8-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/distro_mirror/centos8-x86_64 for centos8-x86_64
processing repo at : /var/www/cobbler/distro_mirror/centos8-x86_64/AppStream
need to process repo/comps: /var/www/cobbler/distro_mirror/centos8-x86_64/AppStream
looking for /var/www/cobbler/distro_mirror/centos8-x86_64/AppStream/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/distro_mirror/centos8-x86_64/AppStream/repodata
processing repo at : /var/www/cobbler/distro_mirror/centos8-x86_64/BaseOS
need to process repo/comps: /var/www/cobbler/distro_mirror/centos8-x86_64/BaseOS
looking for /var/www/cobbler/distro_mirror/centos8-x86_64/BaseOS/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/distro_mirror/centos8-x86_64/BaseOS/repodata
*** TASK COMPLETE ***
查看镜像
[root@cjy ~]# cobbler profile list
   centos8-x86_64
   rockylinux9-x86_64
   uos20-x86_64
[root@cjy ~]# cd /var/lib/cobbler/templates/
[root@cjy templates]# vim centos8.ks
[root@cjy templates]# cat centos8.ks 
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.159.148/cobbler/links/centos8-x86_64/
$yum_repo_stanza
reboot
rootpw --iscrypted "$6$BhgpUy/vf7qCaTU5$nl7uR.wgWxo/nuah8zeYsJRXGEYUUaTg//Njihb3lSKrvFRqZJQ9E1a83vAZ0K/HTROWEV3HB..1qZBMHd/E3."
selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install
zerombr
%packages
@core
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
[root@cjy templates]# cobbler profile report
Name                           : uos20-x86_64
Automatic Installation Template : uos20.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : uos20-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

Name                           : rockylinux9-x86_64
Automatic Installation Template : rockylinux9.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : rockylinux9-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

Name                           : centos8-x86_64
Automatic Installation Template : sample.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : centos8-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm
[root@cjy templates]# cobbler profile edit --name centos8-x86_64 --autoinstall=centos8.ks
[root@cjy templates]# cobbler profile edit --name centos8-x86_64 --kernel-options='net.ifnames=0 biosdevname=0'
[root@cjy templates]# cobbler sync
task started: 2023-12-25_183954_sync
task started (id=Sync, time=Mon Dec 25 18:39:54 2023)
running python triggers from /var/lib/cobbler/triggers/task/sync/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sync/pre/*
shell triggers finished successfully
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/uos20-x86_64
removing: /var/www/cobbler/images/rockylinux9-x86_64
removing: /var/www/cobbler/images/centos8-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/system
removing: /var/lib/tftpboot/grub/system_link
removing: /var/lib/tftpboot/grub/grub.cfg
removing: /var/lib/tftpboot/grub/local_efi.cfg
removing: /var/lib/tftpboot/grub/local_legacy.cfg
removing: /var/lib/tftpboot/grub/local_powerpc-ieee1275.cfg
removing: /var/lib/tftpboot/grub/aarch64_menu_items.cfg
removing: /var/lib/tftpboot/grub/i386_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc64_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc64le_menu_items.cfg
removing: /var/lib/tftpboot/grub/loongarch64_menu_items.cfg
removing: /var/lib/tftpboot/grub/amd64_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc64el_menu_items.cfg
removing: /var/lib/tftpboot/grub/ia64_menu_items.cfg
removing: /var/lib/tftpboot/grub/s390_menu_items.cfg
removing: /var/lib/tftpboot/grub/s390x_menu_items.cfg
removing: /var/lib/tftpboot/grub/i586_menu_items.cfg
removing: /var/lib/tftpboot/grub/arm_menu_items.cfg
removing: /var/lib/tftpboot/grub/armhfp_menu_items.cfg
removing: /var/lib/tftpboot/grub/x86_menu_items.cfg
removing: /var/lib/tftpboot/grub/ARM64_menu_items.cfg
removing: /var/lib/tftpboot/grub/x86_64_menu_items.cfg
removing: /var/lib/tftpboot/images/uos20-x86_64
removing: /var/lib/tftpboot/images/rockylinux9-x86_64
removing: /var/lib/tftpboot/images/centos8-x86_64
copying bootloaders
running: ['rsync', '-rpt', '--copy-links', '--exclude=.cobbler_postun_cleanup', '/var/lib/cobbler/loaders/', '/var/lib/tftpboot']
received on stdout: 
received on stderr: 
running: ['rsync', '-rpt', '--copy-links', '--exclude=README.grubconfig', '/var/lib/cobbler/grub_config/', '/var/lib/tftpboot']
received on stdout: 
received on stderr: 
copying distros to tftpboot
copying files for distro: uos20-x86_64
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/uos20-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/uos20-x86_64/initrd.img
copying files for distro: rockylinux9-x86_64
trying hardlink /var/www/cobbler/distro_mirror/rockylinux9-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/rockylinux9-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/rockylinux9-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/rockylinux9-x86_64/initrd.img
copying files for distro: centos8-x86_64
trying hardlink /var/www/cobbler/distro_mirror/centos8-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/centos8-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/centos8-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/centos8-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: uos20-x86_64
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/uos20-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/uos20-x86_64/initrd.img
Writing template files for uos20-x86_64
copying files for distro: rockylinux9-x86_64
trying hardlink /var/www/cobbler/distro_mirror/rockylinux9-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rockylinux9-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/rockylinux9-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/rockylinux9-x86_64/initrd.img
Writing template files for rockylinux9-x86_64
copying files for distro: centos8-x86_64
trying hardlink /var/www/cobbler/distro_mirror/centos8-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos8-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/centos8-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos8-x86_64/initrd.img
Writing template files for centos8-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
processing boot_files for distro: uos20-x86_64
processing boot_files for distro: rockylinux9-x86_64
processing boot_files for distro: centos8-x86_64
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout: 
received on stderr: 
running: service dhcpd restart
received on stdout: 
received on stderr: 重定向至 /bin/systemctl restart dhcpd.service

running shell triggers from /var/lib/cobbler/triggers/sync/post/*
shell triggers finished successfully
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running python trigger cobbler.modules.managers.genders
running shell triggers from /var/lib/cobbler/triggers/change/*
shell triggers finished successfully
*** TASK COMPLETE ***
[root@cjy templates]# cp /usr/share/syslinux/{pxelinux.0,menu.c32,ldlinux.c32,libutil.c32} /var/lib/tftpboot/

开机
在这里插入图片描述在这里插入图片描述

centos7安装

切换镜像
[root@cjy templates]# umount /mnt
[root@cjy templates]# mount /dev/cdrom /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
上传镜像
[root@cjy templates]# cobbler import --path=/mnt --name=centos7 --arch=x86_64
task started: 2023-12-25_185636_import
task started (id=Media import, time=Mon Dec 25 18:56:36 2023)
running python triggers from /var/lib/cobbler/triggers/task/import/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/import/pre/*
shell triggers finished successfully
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/distro_mirror/centos7-x86_64:
creating new distro: centos7-x86_64
trying symlink: /var/www/cobbler/distro_mirror/centos7-x86_64 -> /var/www/cobbler/links/centos7-x86_64
creating new profile: centos7-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/distro_mirror/centos7-x86_64 for centos7-x86_64
processing repo at : /var/www/cobbler/distro_mirror/centos7-x86_64
need to process repo/comps: /var/www/cobbler/distro_mirror/centos7-x86_64
looking for /var/www/cobbler/distro_mirror/centos7-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/distro_mirror/centos7-x86_64/repodata
*** TASK COMPLETE ***
查看镜像
[root@cjy templates]# cobbler profile list
   centos7-x86_64
   centos8-x86_64
   rockylinux9-x86_64
   uos20-x86_64
配置ks文件
[root@cjy templates]# vim centos7.ks
[root@cjy templates]# cat centos7.ks 
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.159.148/cobbler/links/centos7-x86_64/
$yum_repo_stanza
reboot
rootpw --iscrypted "$6$BhgpUy/vf7qCaTU5$nl7uR.wgWxo/nuah8zeYsJRXGEYUUaTg//Njihb3lSKrvFRqZJQ9E1a83vAZ0K/HTROWEV3HB..1qZBMHd/E3."
selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install
zerombr
%packages
@core
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
查看配置信息
[root@cjy templates]# cobbler profile report
Name                           : uos20-x86_64
Automatic Installation Template : uos20.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : uos20-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

Name                           : rockylinux9-x86_64
Automatic Installation Template : rockylinux9.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : rockylinux9-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

Name                           : centos8-x86_64
Automatic Installation Template : centos8.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : centos8-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {'net.ifnames': '0', 'biosdevname': '0'}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

Name                           : centos7-x86_64
Automatic Installation Template : sample.ks
Automatic Installation Metadata : {}
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : centos7-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
DHCP Filename Override         : <<inherit>>
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Next Server Override           : <<inherit>>
Owners                         : ['admin']
Parent Profile                 : 
Proxy                          : 
Red Hat Management Key         : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm
修改profile,将我们新建的ks文件设为默认的kickstarts安装文件
[root@cjy templates]# cobbler profile edit --name centos7-x86_64 --autoinstall=centos7.ks
配置网卡名称为传统网卡名称eth0
[root@cjy templates]# cobbler profile edit --name centos7-x86_64 --kernel-options='net.ifnames=0 biosdevname=0'
[root@cjy templates]# cobbler sync
task started: 2023-12-25_190303_sync
task started (id=Sync, time=Mon Dec 25 19:03:03 2023)
running python triggers from /var/lib/cobbler/triggers/task/sync/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sync/pre/*
shell triggers finished successfully
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/uos20-x86_64
removing: /var/www/cobbler/images/rockylinux9-x86_64
removing: /var/www/cobbler/images/centos8-x86_64
removing: /var/www/cobbler/images/centos7-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/system
removing: /var/lib/tftpboot/grub/system_link
removing: /var/lib/tftpboot/grub/grub.cfg
removing: /var/lib/tftpboot/grub/local_efi.cfg
removing: /var/lib/tftpboot/grub/local_legacy.cfg
removing: /var/lib/tftpboot/grub/local_powerpc-ieee1275.cfg
removing: /var/lib/tftpboot/grub/i386_menu_items.cfg
removing: /var/lib/tftpboot/grub/ia64_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc_menu_items.cfg
removing: /var/lib/tftpboot/grub/s390_menu_items.cfg
removing: /var/lib/tftpboot/grub/s390x_menu_items.cfg
removing: /var/lib/tftpboot/grub/x86_64_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc64_menu_items.cfg
removing: /var/lib/tftpboot/grub/aarch64_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc64le_menu_items.cfg
removing: /var/lib/tftpboot/grub/arm_menu_items.cfg
removing: /var/lib/tftpboot/grub/armhfp_menu_items.cfg
removing: /var/lib/tftpboot/grub/amd64_menu_items.cfg
removing: /var/lib/tftpboot/grub/ppc64el_menu_items.cfg
removing: /var/lib/tftpboot/grub/i586_menu_items.cfg
removing: /var/lib/tftpboot/grub/x86_menu_items.cfg
removing: /var/lib/tftpboot/grub/ARM64_menu_items.cfg
removing: /var/lib/tftpboot/images/uos20-x86_64
removing: /var/lib/tftpboot/images/rockylinux9-x86_64
removing: /var/lib/tftpboot/images/centos8-x86_64
removing: /var/lib/tftpboot/images/centos7-x86_64
copying bootloaders
running: ['rsync', '-rpt', '--copy-links', '--exclude=.cobbler_postun_cleanup', '/var/lib/cobbler/loaders/', '/var/lib/tftpboot']
received on stdout: 
received on stderr: 
running: ['rsync', '-rpt', '--copy-links', '--exclude=README.grubconfig', '/var/lib/cobbler/grub_config/', '/var/lib/tftpboot']
received on stdout: 
received on stderr: 
copying distros to tftpboot
copying files for distro: uos20-x86_64
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/uos20-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/uos20-x86_64/initrd.img
copying files for distro: rockylinux9-x86_64
trying hardlink /var/www/cobbler/distro_mirror/rockylinux9-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/rockylinux9-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/rockylinux9-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/rockylinux9-x86_64/initrd.img
copying files for distro: centos8-x86_64
trying hardlink /var/www/cobbler/distro_mirror/centos8-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/centos8-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/centos8-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/centos8-x86_64/initrd.img
copying files for distro: centos7-x86_64
trying hardlink /var/www/cobbler/distro_mirror/centos7-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/centos7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/centos7-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/centos7-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: uos20-x86_64
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/uos20-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/uos20-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/uos20-x86_64/initrd.img
Writing template files for uos20-x86_64
copying files for distro: rockylinux9-x86_64
trying hardlink /var/www/cobbler/distro_mirror/rockylinux9-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rockylinux9-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/rockylinux9-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/rockylinux9-x86_64/initrd.img
Writing template files for rockylinux9-x86_64
copying files for distro: centos8-x86_64
trying hardlink /var/www/cobbler/distro_mirror/centos8-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos8-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/centos8-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos8-x86_64/initrd.img
Writing template files for centos8-x86_64
copying files for distro: centos7-x86_64
trying hardlink /var/www/cobbler/distro_mirror/centos7-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/distro_mirror/centos7-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos7-x86_64/initrd.img
Writing template files for centos7-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
processing boot_files for distro: uos20-x86_64
processing boot_files for distro: rockylinux9-x86_64
processing boot_files for distro: centos8-x86_64
processing boot_files for distro: centos7-x86_64
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout: 
received on stderr: 
running: service dhcpd restart
received on stdout: 
received on stderr: 重定向至 /bin/systemctl restart dhcpd.service

running shell triggers from /var/lib/cobbler/triggers/sync/post/*
shell triggers finished successfully
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running python trigger cobbler.modules.managers.genders
running shell triggers from /var/lib/cobbler/triggers/change/*
shell triggers finished successfully
*** TASK COMPLETE ***
[root@cjy templates]# cp /usr/share/syslinux/{pxelinux.0,menu.c32,ldlinux.c32,libutil.c32} /var/lib/tftpboot/
cp:是否覆盖'/var/lib/tftpboot/pxelinux.0'? y
cp:是否覆盖'/var/lib/tftpboot/menu.c32'? y
cp:是否覆盖'/var/lib/tftpboot/ldlinux.c32'? y
cp:是否覆盖'/var/lib/tftpboot/libutil.c32'? y

开机
在这里插入图片描述
在这里插入图片描述

4. 定制安装

定制安装步骤:

  • 统计服务器mac地址
  • 配置cobbler
  • 安装

输入主机IP地址https://192.168.159.148/cobbler_web进入登录界面
在这里插入图片描述

用户名和密码都是cobbler_web

在这里插入图片描述
在这里插入图片描述

在 cobbler 的web界面上配置:

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

同步配置并重启相关服务:

[root@cjy ~]# cobbler sync
[root@cjy ~]# systemctl restart httpd
[root@cjy ~]# systemctl restart cobblerd
[root@cjy ~]# systemctl restart xinetd

最后开机自动会安装系统

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/509698.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【御控物联】JavaScript JSON结构转换(16):对象To数组——综合应用

文章目录 一、JSON结构转换是什么&#xff1f;二、术语解释三、案例之《JSON对象 To JSON数组》四、代码实现五、在线转换工具六、技术资料 一、JSON结构转换是什么&#xff1f; JSON结构转换指的是将一个JSON对象或JSON数组按照一定规则进行重组、筛选、映射或转换&#xff0…

Redis数据库常用命令和数据类型

文章目录 一、Redis数据库常用命令1、set/get2、keys3、exists4、del5、type6、rename6.1 重命名6.2 覆盖 7、renamenx8、dbsize9、密码设置10、密码验证11、查看密码12、取消密码13、Redis多数据库常用命令13.1 多数据库间切换13.2 多数据库间移动数据13.3 清除数据库数据 二、…

可视化大屏的行业应用(1):智慧生产和智能制造

可视化大屏在生产制造行业中具有重要的应用价值&#xff0c;主要表现在以下几个方面&#xff1a; 生产监控&#xff1a;可视化大屏可以实时显示生产线的运行状态和生产数据&#xff0c;包括设备运行状态、生产效率、产品质量等&#xff0c;帮助管理人员及时监控生产情况&#…

【新手适用】手把手教你从零开始实现一个基于Pytorch的卷积神经网络CNN三: 如何验证和测试模型

【新手适用】手把手教你从零开始实现一个基于Pytorch的卷积神经网络CNN二&#xff1a; 如何训练模型&#xff0c;内附详细损失、准确率、均值计算-CSDN博客 从零开始实现一个基于Pytorch的卷积神经网络 - 知乎 (zhihu.com) 1 初始化、导入模型和数据集 新建一个test.py文件&a…

Android的图片加载框架

Android的图片加载框架 为什么要使用图片加载框架&#xff1f;图片加载框架1. Universal Image Loader [https://github.com/nostra13/Android-Universal-Image-Loader](https://github.com/nostra13/Android-Universal-Image-Loader)2. Glide [https://muyangmin.github.io/gl…

SWM341系列SDRAM应用

SWM341系列SDRAM应用 1、不同的时钟频率下&#xff0c;SDRAM的初始化参数设置 现象&#xff1a;驱屏应用&#xff0c;显示一段时间后出现卡住的现象 分析&#xff1a;SDRAM的初始 化参数优化 主频150Mhz,建议配置CASL 3&#xff0c;TRFC ≥8。 主频100Mhz,ClkDiv可配置为1…

低压500kW 发电机组测试交流干式负载箱的工作方式

低压500kW发电机组测试交流干式负载箱是一种专门用于测试发电机组性能的设备&#xff0c;其主要功能是在发电机组运行过程中&#xff0c;通过模拟实际负载情况&#xff0c;对发电机组的输出功率、电压、电流等参数进行实时监测和调整&#xff0c;以确保发电机组在各种工况下的稳…

手写瀑布流

之前用vue-masonry实现瀑布流 <!DOCTYPE html> <html><head><meta http-equiv"content-type" content"text/html; charsetutf-8"><meta name"viewport" content"widthdevice-width,initial-scale1,maximum-sc…

算法——矩阵,被围绕的区域

. - 力扣&#xff08;LeetCode&#xff09; 最开始也是考虑使用dfs&#xff0c;对于矩阵中的每个点&#xff0c;如果能到达边界的O&#xff0c;则跳过继续dfs。否则如果上下左右四个方向都无法到达边界的O&#xff0c;则说明当前的无法到达&#xff0c;在一个set中记录他的行数…

AcWing刷题-游戏

游戏 DP l lambda: [int(x) for x in input().split()]n l()[0] w [0] while len(w) < n:w l()s [0] * (n 1) for i in range(1, n 1): s[i] s[i - 1] w[i]f [[0] * (n 1) for _ in range(n 1)]for i in range(1, n 1): f[i][i] w[i]for length in range(2, …

WordPress外贸建站Astra免费版教程指南(2024)

在WordPress的外贸建站主题中&#xff0c;有许多备受欢迎的主题&#xff0c;如Avada、Astra、Hello、Kadence等最佳WordPress外贸主题&#xff0c;它们都能满足建站需求并在市场上广受认可。然而&#xff0c;今天我要介绍的是一个不断颠覆建站人员思维的黑马——Astra主题。 原…

Java

1.学生和老师都会有work方法&#xff0c;学生的工作是学习&#xff0c;老师的工作是教书&#xff0c;我利用了一个接口来实现&#xff1b; 2.同时&#xff0c;老师和学生都是人&#xff0c;并且都有姓名&#xff0c;姓名&#xff0c;年龄和身高等特征&#xff0c;我用了一个继承…

Python基于PyQt5制作的一个上位机软件,用来控制一个Arduino四自由度机械臂

PyQt_Arduino 介绍 用PyQt5制作的一个上位机软件&#xff0c;用来控制一个Arduino四自由度机械臂。当然&#xff0c;为了扩展的需要&#xff0c;界面是按照六自由度机械臂制作的。 开发环境 系统&#xff1a; windows10 处理器: Intel Core™i7-8550U CPU 1.8GHz 2.00GHz …

服务器远程桌面连接不上怎么办?

随着互联网的发展和远程办公的兴起&#xff0c;服务器远程桌面连接成为了许多企业和个人不可或缺的工具。偶尔我们可能会碰到服务器远程桌面连接不上的情况&#xff0c;这时候我们需要找到解决办法&#xff0c;确保高效地远程访问服务器。 天联组网——突破远程连接障碍 在我们…

isaacgym 渲染黑屏

问题描述&#xff1a; isaacgym安装完IsaacGym_Preview_4_Package.tar.gz之后&#xff0c;运行python joint_monkey.py没有任何内容现实&#xff0c;但是终端还是正常输出信息。 环境是ubuntu22服务器&#xff0c;python3.8&#xff0c;nvidia Driver Version: 515.65.01 CUDA…

Linux shell编程学习笔记45:uname命令-获取Linux系统信息

0 前言 linux 有多个发行版本&#xff0c;不同的版本都有自己的版本号。 如何知道自己使用的Linux的系统信息呢&#xff1f; 使用uname命令、hostnamectl命令&#xff0c;或者通过查看/proc/version文件来了解这些信息。 我们先看看uname命令。 1 uname 命令的功能和格式 …

如何合理利用chatgpt写高质量新闻稿,10分钟速成(五)

演示站点&#xff1a; https://www.cnsai.net/ 论文模块 官方论坛&#xff1a; www.jingyuai.com 京娱AI下载源码 人工智能&#xff08;AI&#xff09;技术作为当今科技创新的前沿领域&#xff0c;为创业者提供了广阔的机会和挑战。随着AI技术的快速发展和应用领域的不断拓展&a…

大模型之路2:继续趟一条小路

继续趟一条小路&#xff0c;可谓是充满了曲折&#xff0c;当然&#xff0c;必不可少的还是坑。 吐槽 看过的喷友&#xff0c;其实你看完以后&#xff0c;大概率也就是和我一起骂骂街&#xff0c;因为....我也的确没理清楚。 我也不知道做错了什么&#xff0c;就是运行不过去…

探索 ZKFair 的Dargon Slayer蓝图,解锁新阶段的潜力

在当前区块链技术的发展中&#xff0c;Layer 2&#xff08;L2&#xff09;解决方案已成为提高区块链扩容性、降低交易成本和提升交易速度的关键技术&#xff0c;但它仍面临一些关键问题和挑战&#xff0c;例如用户体验的改进、跨链互操作性、安全性以及去中心化程度。在这些背景…

马上蓝桥了,干货总结基础树论知识点

目录 今日知识点&#xff1a;对于每个子树如果和小于0就返回0&#xff1b;如果大于0就直接返回。 注意异或的性质&#xff0c;偶消奇不消&#xff0c;所以lca上面的都消掉了&#xff0c;并不需要跑lca&#xff0c;也就是说只需要把根到所有点的距离跑出来即可 如果上传过来小…