Cobbler部署(centos7)

Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@localhost ~]# sed -ri ‘s/^(SELINUX=).*/\1disabled/g’ /etc/selinux/config

[root@localhost ~]# setenforce 0

[root@localhost ~]# reboot

//配置epel源

[root@localhost ~]# yum -y install epel-release vim

[root@localhost ~]# yum -y install httpd dhcp tftp python-ctypes cobbler xinetd cobbler-web pykickstart

//启动

[root@localhost ~]# systemctl enable --now httpd cobblerd

//修改server的ip地址为本机ip

[root@localhost ~]# sed -i ‘s/^server: 127.0.0.1/server: 192.168.129.33/’ /etc/cobbler/settings

//设置tftp的ip地址为本机ip

[root@localhost ~]# sed -i ‘s/^next_server: 127.0.0.1/next_server: 192.168.129.33/’ /etc/cobbler/settings

//修改cobbler配置文件,让cobbler控制dhcp

[root@localhost ~]# sed -i ‘/^manage_dhcp/s/0/1/g’ /etc/cobbler/settings

[root@localhost ~]# sed -n ‘/^manage_dhcp/p’ /etc/cobbler/settings

manage_dhcp: 1

//生成加密的密码

[root@localhost ~]# openssl passwd -1

Password:

Verifying - Password:

1 1 1VbNNoYL9$UtmeEV9aGp3VCtdWH.7f21 //加密后的密码

//将新生成的加密密码加入到配置文件

[root@localhost ~]# vim /etc/cobbler/settings

default_password_crypted: “ 1 1 1VbNNoYL9$UtmeEV9aGp3VCtdWH.7f21”

//开启tftp

[root@localhost ~]# sed -i ‘/disable/s/yes/no/g’ /etc/xinetd.d/tftp

//在centos7里无法使用cobbler get-loaders命令下载下载缺失文件,但是我们可以在centos8里使用这个cobbler get-loaders下载缺失文件,把8系统里的文件拷贝到7系统里,但是需要修改一些内容

[root@localhost loaders]# scp root@192.168.129.135:/var/lib/cobbler/loaders/* .

[root@localhost loaders]# ls

COPYING.syslinux grub-x86_64.efi menu.c32 README

COPYING.yaboot grub-x86.efi pxelinux.0 yaboot

//修改menu.c32

[root@localhost loaders]# find / -name menu.c32

/var/lib/tftpboot/menu.c32

/var/lib/cobbler/loaders/menu.c32

/usr/share/syslinux/menu.c32

[root@134 loaders]# ll /usr/share/syslinux/menu.c32 menu.c32 //本机的menu.c32和我们复制过来的大小不一样

-rw-r–r-- 2 root root 9339 Oct 13 21:11 menu.c32

-rw-r–r-- 1 root root 55140 Oct 31 2018 /usr/share/syslinux/menu.c32

//本机menu.c32覆盖8系统传过来的menu.c32

[root@localhost loaders]# \cp /usr/share/syslinux/menu.c32 menu.c32

//修改pxelinux.0

[root@localhost loaders]# find / -name pxelinux.0

/var/lib/tftpboot/pxelinux.0

/var/lib/cobbler/loaders/pxelinux.0

/usr/share/syslinux/pxelinux.0

[root@134 loaders]# ll /usr/share/syslinux/pxelinux.0 pxelinux.0

-rw-r–r-- 2 root root 9339 Oct 13 21:11 pxelinux.0

-rw-r–r-- 1 root root 26759 Oct 31 2018 /usr/share/syslinux/pxelinux.0

//本机pxelinux.0覆盖8系统传过来的pxelinux.0

[root@localhost loaders]# \cp /usr/share/syslinux/pxelinux.0 pxelinux.0

//启动rsync并设置开机自启

[root@localhost ~]# systemctl enable --now rsyncd

Created symlink /etc/systemd/system/multi-user.target.wants/rsyncd.service → /usr/lib/systemd/system/rsyncd.service.

//配置dhcp

[root@localhost ~]# vim /etc/cobbler/dhcp.template

subnet 192.168.129.0 netmask 255.255.255.0 { #本地主机网段

option routers 192.168.129.33; #本机IP

option domain-name-servers 192.168.129.2; #DNS地址

option subnet-mask 255.255.255.0; #子网掩码

range dynamic-bootp 192.168.129.10 192.168.129.20; #dhcp服务器分配的IP地址范围

default-lease-time 21600;

max-lease-time 43200;

next-server $next_server;

class “pxeclients” {

//检查dhcp是否正常

[root@localhost ~]# netstat -anulp|grep dhcp

udp 0 0 0.0.0.0:67 0.0.0.0:* 1649/dhcpd

//重启cobbler

[root@localhost ~]# systemctl restart cobblerd

[root@localhost ~]# ss -antl

State Recv-Q Send-Q Local Address:Port Peer Address:Port

LISTEN 0 5 127.0.0.1:25151 0.0.0.0:*

LISTEN 0 5 0.0.0.0:873 0.0.0.0:*

LISTEN 0 128 0.0.0.0:22 0.0.0.0:*

LISTEN 0 128 *:443 :

LISTEN 0 5 [::]:873 [::]😗

LISTEN 0 128 *:80 :

LISTEN 0 128 [::]:22 [::]😗

//通过cobbler check 核对当前设置是否有问题

[root@localhost ~]# cobbler check

The following are potential configuration items that you may want to fix:

1 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run ‘cobbler get-loaders’ to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a recent version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The ‘cobbler get-loaders’ command is the easiest way to resolve these requirements.

2 : debmirror package is not installed, it will be required to manage debian deployments and repositories

3 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Restart cobblerd and then run ‘cobbler sync’ to apply changes.

#以上2、3是关于debian系统的错误,请忽略

解决方法:

1、yum install fence-agents

2、yum -y install yum-utils

3、执行cobbler get-loaders命令

//再次查看

[root@localhost ~]# cobbler check

The following are potential configuration items that you may want to fix:

1 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run ‘cobbler get-loaders’ to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a recent version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The ‘cobbler get-loaders’ command is the easiest way to resolve these requirements.

2 : debmirror package is not installed, it will be required to manage debian deployments and repositories

Restart cobblerd and then run ‘cobbler sync’ to apply changes.

#1、2忽略

//重启服务并同步配置,改完dhcp必须要sync同步配置

[root@localhost ~]# systemctl restart cobblerd

[root@localhost ~]# cobbler sync

task started: 2021-10-13_160428_sync

task started (id=Sync, time=Wed Oct 13 16:04:28 2021)

running pre-sync triggers

cleaning trees

removing: /var/lib/tftpboot/grub/images

copying bootloaders

trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0

trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32

trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot

trying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk

trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi

trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi

copying distros to tftpboot

copying images

generating PXE configuration files

generating PXE menu structure

rendering DHCP files

generating /etc/dhcp/dhcpd.conf

rendering TFTPD files

generating /etc/xinetd.d/tftp

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: Redirecting to /bin/systemctl restart dhcpd.service

running shell triggers from /var/lib/cobbler/triggers/sync/post/*

running python triggers from /var/lib/cobbler/triggers/change/*

running python trigger cobbler.modules.manage_genders

running python trigger cobbler.modules.scm_track

running shell triggers from /var/lib/cobbler/triggers/change/*

*** TASK COMPLETE ***

//导入安装镜像

[root@localhost ~]# mount /dev/cdrom /mnt

mount: /mnt: /dev/sr0 already mounted on /mnt/cdrom.

[root@localhost ~]# df -h

文件系统 容量 已用 可用 已用% 挂载点

devtmpfs 1.9G 0 1.9G 0% /dev

tmpfs 1.9G 0 1.9G 0% /dev/shm

tmpfs 1.9G 9.0M 1.9G 1% /run

tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup

/dev/mapper/rhel-root 36G 1.9G 34G 6% /

/dev/nvme0n1p1 1014M 179M 836M 18% /boot

tmpfs 376M 0 376M 0% /run/user/0

/dev/sr0 7.9G 7.9G 0 100% /mnt

[root@localhost ~]# cobbler import --name=centos-7 --arch=x86_64 --path=/mnt

task started: 2021-10-13_160752_import

task started (id=Media import, time=Wed Oct 13 16:07:52 2021)

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/ks_mirror/centos-7-x86_64:

creating new distro: centos-7-x86_64

trying symlink: /var/www/cobbler/ks_mirror/centos-7-x86_64 -> /var/www/cobbler/links/centos-7-x86_64

creating new profile: centos-7-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/ks_mirror/centos-7-x86_64 for centos-7-x86_64

processing repo at : /var/www/cobbler/ks_mirror/centos-7-x86_64 #导入镜像的位置

need to process repo/comps: /var/www/cobbler/ks_mirror/centos-7-x86_64

looking for /var/www/cobbler/ks_mirror/centos-7-x86_64/repodata/comps.xml

Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos-7-x86_64/repodata

*** TASK COMPLETE ***

#参数说明

–path //镜像路径

–name //为安装源定义一个名字

–arch //指定安装源平台

#安装源的唯一标示就是根据name参数来定义,本例导入成功后,安装源的唯一标示就是:CentOS-7-x86_64,如果重复,系统会提示导入失败

//查看光盘内容是否导入成功

[root@localhost ~]# cd /var/www/cobbler/ks_mirror/centos-7-x86_64/

[root@localhost centos-7-x86_64]# ls

CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7

EFI images Packages RPM-GPG-KEY-CentOS-Testing-7

EULA isolinux repodata TRANS.TBL

//查看cobbler镜像列表

[root@localhost ~]# cobbler list

distros:

centos-7-x86_64

profiles:

centos-7-x86_64

systems:

repos:

images:

mgmtclasses:

packages:

files:

//创建kickstarts自动安装脚本

[root@localhost ~]# cat > /var/lib/cobbler/kickstarts/centos-7-x86_64.ks<<‘EOF’

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.129.33/cobbler/ks_mirror/centos-7-x86_64/ #本机ip

$yum_repo_stanza

reboot

rootpw --iscrypted 6 6 6dsDSjBlVZrhKDfMG$XO2VJHSWQRVzkTCy0FUHeFUSX5YwtAdQ4rw5haeo2JpjzW6bvzG2OfZa2pB283ckYLmT5VYnn5BnWyJc6sLPE/ #密码,这要把本机/root/anaconda-ks.cfg中的密码复制过来

selinux --disabled

skipx

timezone Asia/Shanghai --isUtc --nontp

install

zerombr

%packages

@^minimal

@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

EOF

在这里插入图片描述

//检查ks文件语法是否有误

[root@localhost ~]# cobbler validateks

task started: 2021-10-13_162453_validateks

task started (id=Kickstart Validation, time=Wed Oct 13 16:24:53 2021)


osversion: rhel7

checking url: http://192.168.129.33/cblr/svc/op/ks/profile/centos-7-x86_64

running: /usr/bin/ksvalidator -v “rhel7” “http://192.168.129.33/cblr/svc/op/ks/profile/centos-7-x86_64”

received on stdout:

received on stderr:

*** all kickstarts seem to be ok ***

*** TASK COMPLETE ***

//查看当前cobbler有哪些配置文件

[root@localhost ~]# cobbler profile list

centos-7-x86_64

//修改profile,将我们新建的ks文件设为默认的kickstarts安装文件

[root@localhost ~]# cobbler profile edit --name centos-7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos-7-x86_64.ks

//配置网卡名称为传统网卡名称eth0

[root@localhost ~]# cobbler profile edit --name centos-7-x86_64 --kopts=‘net.ifnames=0 biosdevname=0’

//检查当前系统cobbler配置文件信息

[root@localhost ~]# cobbler profile report

Name : centos-7-x86_64

TFTP Boot Files : {}

Comment :

DHCP Tag : default

Distribution : centos-7-x86_64 #仓库名字

Enable gPXE? : 0

Enable PXE Menu? : 1

Fetchable Files : {}

Kernel Options : {‘biosdevname’: ‘0’, ‘net.ifnames’: ‘0’} #网卡设为传统命名方式

Kernel Options (Post Install) : {}

Kickstart : /var/lib/cobbler/kickstarts/centos-7-x86_64.ks #使用的kickstarts配置文件的路径,必须为我们新建的ks文件的路径

Kickstart Metadata : {}

Management Classes : []

Management Parameters : <>

Name Servers : []

Name Servers Search Path : []

Owners : [‘admin’]

Parent Profile :

Internal proxy :

Red Hat Management Key : <>

Red Hat Management Server : <>

Repos : []

Server Override : <>

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

//同步cobbler

[root@localhost ~]# cobbler sync

task started: 2021-10-13_163449_sync

task started (id=Sync, time=Wed Oct 13 16:34:49 2021)

running pre-sync triggers

cleaning trees

removing: /var/www/cobbler/images/centos-7-x86_64

removing: /var/lib/tftpboot/pxelinux.cfg/default

removing: /var/lib/tftpboot/grub/images

removing: /var/lib/tftpboot/grub/grub-x86_64.efi

removing: /var/lib/tftpboot/grub/grub-x86.efi

removing: /var/lib/tftpboot/grub/efidefault

removing: /var/lib/tftpboot/images/centos-7-x86_64

removing: /var/lib/tftpboot/s390x/profile_list

copying bootloaders

trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi

trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi

copying distros to tftpboot

copying files for distro: centos-7-x86_64

trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/centos-7-x86_64/vmlinuz

trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/centos-7-x86_64/initrd.img

copying images

generating PXE configuration files

generating PXE menu structure

copying files for distro: centos-7-x86_64

trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos-7-x86_64/vmlinuz

trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos-7-x86_64/initrd.img

Writing template files for centos-7-x86_64

rendering DHCP files

generating /etc/dhcp/dhcpd.conf

rendering TFTPD files

generating /etc/xinetd.d/tftp

processing boot_files for distro: centos-7-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: Redirecting to /bin/systemctl restart dhcpd.service

running shell triggers from /var/lib/cobbler/triggers/sync/post/*

running python triggers from /var/lib/cobbler/triggers/change/*

running python trigger cobbler.modules.manage_genders

running python trigger cobbler.modules.scm_track

running shell triggers from /var/lib/cobbler/triggers/change/*

*** TASK COMPLETE ***

//为避免发生未知问题,先把服务端所有服务重启

[root@localhost ~]# systemctl restart xinetd cobblerd httpd

//开启xinetd

[root@localhost ~]# systemctl start xinetd

[root@localhost ~]# ss -anlt

State Recv-Q Send-Q Local Address:Port Peer Address:Port

LISTEN 0 5 127.0.0.1:25151 :

LISTEN 0 5 *:873 :

LISTEN 0 128 *:22 :

LISTEN 0 100 127.0.0.1:25 :

LISTEN 0 5 :::873 ::😗

LISTEN 0 128 :::80 ::😗

LISTEN 0 128 :::22 ::😗

LISTEN 0 100 ::1:25 ::😗

LISTEN 0 128 :::443 ::😗

客户端安装 centos-7-x86_64

=====================================================================================

上下键选择要安装的系统,local为从本地磁盘启动

在这里插入图片描述

在这里插入图片描述

定制安装

===================================================================

定制安装步骤:

  • 统计服务器mac地址

  • 配置cobbler

  • 安装

进入WEB页面,访问地址:https://IP/cobbler_web 即可。默认账号为cobbler,密码也为cobbler。web界面有很多功能,包括上传镜像、编辑kickstart、等等很多在命令行操作的都可以在web界面直接操作。

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

同步配置,重启相关服务

[root@localhost ~]# cobbler sync

task started: 2021-10-14_001336_sync

task started (id=Sync, time=Thu Oct 14 00:13:36 2021)

running pre-sync triggers

cleaning trees

removing: /var/www/cobbler/images/centos-7-x86_64

removing: /var/lib/tftpboot/pxelinux.cfg/default

removing: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-35-14-ca

removing: /var/lib/tftpboot/grub/images

removing: /var/lib/tftpboot/grub/grub-x86_64.efi

removing: /var/lib/tftpboot/grub/grub-x86.efi

removing: /var/lib/tftpboot/grub/efidefault

removing: /var/lib/tftpboot/grub/01-00-50-56-35-14-CA

removing: /var/lib/tftpboot/images/centos-7-x86_64

removing: /var/lib/tftpboot/s390x/profile_list

copying bootloaders

trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi

trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi

copying distros to tftpboot

copying files for distro: centos-7-x86_64

trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/centos-7-x86_64/vmlinuz

trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/centos-7-x86_64/initrd.img

copying images

generating PXE configuration files

generating: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-35-14-ca

generating: /var/lib/tftpboot/grub/01-00-50-56-35-14-CA

generating PXE menu structure

copying files for distro: centos-7-x86_64

trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos-7-x86_64/vmlinuz

trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos-7-x86_64/initrd.img

Writing template files for centos-7-x86_64

rendering DHCP files

generating /etc/dhcp/dhcpd.conf

rendering TFTPD files

generating /etc/xinetd.d/tftp

processing boot_files for distro: centos-7-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: Redirecting to /bin/systemctl restart dhcpd.service

running shell triggers from /var/lib/cobbler/triggers/sync/post/*

running python triggers from /var/lib/cobbler/triggers/change/*

running python trigger cobbler.modules.manage_genders

running python trigger cobbler.modules.scm_track

running shell triggers from /var/lib/cobbler/triggers/change/*

*** TASK COMPLETE ***

[root@localhost ~]# systemctl restart cobblerd httpd xinetd

在这里插入图片描述

客户端安装 rhel-8-x86_64

===================================================================================

在这里插入图片描述

//导入安装镜像

[root@localhost ~]# mount /dev/cdrom /mnt/

mount: /dev/sr0 写保护,将以只读方式挂载

[root@localhost ~]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/mapper/centos-root 36G 5.7G 30G 17% /

devtmpfs 1.9G 0 1.9G 0% /dev

tmpfs 1.9G 12M 1.9G 1% /run

tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup

/dev/sr0 7.9G 7.9G 0 100% /mnt

[root@localhost ~]# cobbler import --path=/mnt --name=rhel-8 --arch=x86_64

task started: 2021-10-14_135959_import

task started (id=Media import, time=Thu Oct 14 13:59:59 2021)

Found a candidate signature: breed=redhat, version=rhel8

Found a matching signature: breed=redhat, version=rhel8

Adding distros from path /var/www/cobbler/ks_mirror/rhel-8-x86_64:

creating new distro: rhel-8-x86_64

trying symlink: /var/www/cobbler/ks_mirror/rhel-8-x86_64 -> /var/www/cobbler/links/rhel-8-x86_64

creating new profile: rhel-8-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/ks_mirror/rhel-8-x86_64 for rhel-8-x86_64

processing repo at : /var/www/cobbler/ks_mirror/rhel-8-x86_64/AppStream

need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-8-x86_64/AppStream

looking for /var/www/cobbler/ks_mirror/rhel-8-x86_64/AppStream/repodata/comps.xml

Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel-8-x86_64/AppStream/repodata

processing repo at : /var/www/cobbler/ks_mirror/rhel-8-x86_64/BaseOS

need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-8-x86_64/BaseOS

looking for /var/www/cobbler/ks_mirror/rhel-8-x86_64/BaseOS/repodata/comps.xml

Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel-8-x86_64/BaseOS/repodata

*** TASK COMPLETE ***

//查看cobbler镜像列表

[root@localhost ~]# cobbler list

distros:

centos-7-x86_64

rhel-8-x86_64

profiles:

centos-7-x86_64

rhel-8-x86_64

systems:

vm1

repos:

images:

mgmtclasses:

packages:

files:

//查看光盘内容是否导入成功

[root@localhost ~]# ls /var/lib/cobbler/kickstarts

centos-7-x86_64.ks esxi5-ks.cfg pxerescue.ks sample_esx4.ks sample_esxi6.ks sample.seed

default.ks install_profiles sample_autoyast.xml sample_esxi4.ks sample.ks sample.seed.28

esxi4-ks.cfg legacy.ks sample_end.ks sample_esxi5.ks sample_old.seed

//创建kickstarts自动安装脚本

[root@localhost kickstarts]# cat > /var/lib/cobbler/kickstarts/redaht-8-x86_64.ks<<‘EOF’

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.129.33/cobbler/ks_mirror/rhel-8-x86_64/

$yum_repo_stanza

reboot

rootpw --iscrypted 6 6 6dsDSjBlVZrhKDfMG$XO2VJHSWQRVzkTCy0FUHeFUSX5YwtAdQ4rw5haeo2JpjzW6bvzG2OfZa2pB283ckYLmT5VYnn5BnWyJc6sLPE/

selinux --disabled

skipx

timezone Asia/Shanghai --isUtc --nontp

install

zerombr

%packages

@^minimal

@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

EOF

在这里插入图片描述

//检查ks文件语法是否有误

[root@localhost kickstarts]# cobbler validateks

task started: 2021-10-14_165039_validateks

task started (id=Kickstart Validation, time=Thu Oct 14 16:50:39 2021)


osversion: rhel8

checking url: http://192.168.129.33/cblr/svc/op/ks/profile/rhel-8-x86_64

running: /usr/bin/ksvalidator -v “rhel8” “http://192.168.129.33/cblr/svc/op/ks/profile/rhel-8-x86_64”

received on stdout: rhel8版本不被pykickstart支持

received on stderr:


osversion: rhel7

checking url: http://192.168.129.33/cblr/svc/op/ks/profile/centos-7-x86_64

running: /usr/bin/ksvalidator -v “rhel7” “http://192.168.129.33/cblr/svc/op/ks/profile/centos-7-x86_64”

received on stdout:

received on stderr:

Potential templating errors:

Unknown variable found at line 16, column 22: ‘$dsDSjBlVZrhKDfMG’

Unknown variable found at line 16, column 39: ‘$XO2VJHSWQRVzkTCy0FUHeFUSX5YwtAdQ4rw5haeo2JpjzW6bvzG2OfZa2pB283ckYLmT5VYnn5BnWyJc6sLPE’


osversion: rhel7

checking url: http://192.168.129.33/cblr/svc/op/ks/system/vm2

running: /usr/bin/ksvalidator -v “rhel7” “http://192.168.129.33/cblr/svc/op/ks/system/vm2”

received on stdout:

received on stderr:

Potential templating errors:

Unknown variable found at line 16, column 22: ‘$dsDSjBlVZrhKDfMG’

Unknown variable found at line 16, column 39: ‘$XO2VJHSWQRVzkTCy0FUHeFUSX5YwtAdQ4rw5haeo2JpjzW6bvzG2OfZa2pB283ckYLmT5VYnn5BnWyJc6sLPE’

*** potential errors detected in kickstarts ***

!!! TASK FAILED !!!

//修改profile,将我们新建的ks文件设为默认的kickstarts安装文件

[root@localhost ~]# cobbler profile edit --name rhel-8-x86_64 --kickstart=/var/lib/cobbler/kickstarts/redhat-8-x86_64.ks

//配置网卡名称为传统网卡名称eth0

[root@localhost ~]# cobbler profile edit --name rhel-8-x86_64 --kopts=‘net.ifnames=0 biosdevname=0’

//检查当前系统cobbler配置文件信息

[root@localhost kickstarts]# cobbler profile report

Name : rhel-8-x86_64

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Java)

最后

学习视频:

大厂面试真题:

《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

*** potential errors detected in kickstarts ***

!!! TASK FAILED !!!

//修改profile,将我们新建的ks文件设为默认的kickstarts安装文件

[root@localhost ~]# cobbler profile edit --name rhel-8-x86_64 --kickstart=/var/lib/cobbler/kickstarts/redhat-8-x86_64.ks

//配置网卡名称为传统网卡名称eth0

[root@localhost ~]# cobbler profile edit --name rhel-8-x86_64 --kopts=‘net.ifnames=0 biosdevname=0’

//检查当前系统cobbler配置文件信息

[root@localhost kickstarts]# cobbler profile report

Name : rhel-8-x86_64

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。[外链图片转存中…(img-Ob9Ot9W5-1713819232398)]

[外链图片转存中…(img-H2OwoMQW-1713819232398)]

[外链图片转存中…(img-UF2shReL-1713819232398)]

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Java)

[外链图片转存中…(img-3fCSkdK7-1713819232399)]

最后

学习视频:

[外链图片转存中…(img-yScwyDae-1713819232399)]

大厂面试真题:

[外链图片转存中…(img-zsT7AoKv-1713819232399)]

《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

  • 18
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值