当前位置: 亚洲城ca88 > 亚洲城 > 正文

cobbler无人值班守护,cobbler无人值班守护批量安装

时间:2019-05-04 17:19来源:亚洲城

kickstart cobbler体系小说:http://www.cnblogs.com/f-ck-need-u/p/7048359.html**

cobbler无人值班守护批量安装Linux系统,cobbler无人值守


本文目录:

一.1 pxe安装系统

一.2 cobbler基本介绍

壹.叁 安装和计划cobbler

1.3.1 安装cobbler

1.3.2 配置dhcp和tftp

一.四 cobbler从地方光盘安装系统

1.4.1 生成distro

1.4.2 提供kickstart文件

1.4.3 提供profile

一.四.4 开首安装

一.伍 比pxe kickstart好的地点

1.6 让新机械自动施行脚本



一.一 pxe安装系统

pxe的大意进程如下图。

里头pxelinux.0为bootloader。pxelinux.cfg目录下的公文(一般采取私下认可的default文件)定义了安装操作系统前的菜单项,如kernel和Initrd的路径,kickstart的路径等。

率先客户端请求pxe服务器上的dhcp,dhcp上点名了next-server和filename,它们各自是tftpd的地方和pxelinux.0的不贰诀要;然后客户端请求tftpd获取pxelinux.0,实践pxelinux.0后将教导进入安装分界面,随后得到pxelinux.cfg目录下的文书并读取当中的安顿,从中获得kernel和initrd的门径所在,借使有定义kickstart项则还会去获取kickstart文件并读取配置;再然后客户端请求获取kernel和initrd文件,以实行内核并跻身到根文件系统;最终客户端获取成功系统装置所需的任何文件,那几个文件能够是在pxe的本地,也能够是互联英特网等能获得到的地点。

在阅读本文在此以前,若是不懂pxe kickstart,建议先读书下,对读书cobbler很有帮衬。能够参考笔者所写的pxe kickstart小说。

 

一.一 pxe安装系统

pxe的大约进程如下图。

图片 1

内部pxelinux.0为bootloader。pxelinux.cfg目录下的文书(一般采用私下认可的default文件)定义了安装操作系统前的菜单项,如kernel和Initrd的门径,kickstart的渠道等。

第叁客户端请求pxe服务器上的dhcp,dhcp上钦点了next-server和filename,它们分别是tftpd的地址和pxelinux.0的门道;然后客户端请求tftpd获取pxelinux.0,实行pxelinux.0后将指导进入安装分界面,随后获得pxelinux.cfg目录下的公文并读取在这之中的布局,从中获得kernel和initrd的渠道所在,如若有定义kickstart项则还会去获得kickstart文件并读取配置;再然后客户端请求获取kernel和initrd文件,以开展内核并进入到根文件系统;最终客户端获取成功系统设置所需的其余文件,这几个文件可以是在pxe的本土,也得以是互联英特网等能博取到的地点。

在读书本文在此以前,假使不懂pxe kickstart,建议先读书下,对学习cobbler很有扶持。能够参见作者所写的pxe kickstart文章。

 

一.2 cobbler基本介绍

cobbler能够看成是多少个越来越多职能的pxe,它落成系统装置和pxe也差不离,要求的文书和经过大概都平等。

cobbler能自动管理dns/tftp/dhcp/rsync那多少个服务(但就像是对tftp的治本有些bug,须要手动运营tftp),且cobbler注重于httpd(pxe扶助http/nfs/ftp)。

主干的种类安装,cobbler只需生成3个distro和三个profile就可以。

distro也正是三个镜像,它提供安装系统经过中所需的方方面面文件,如vmlinuz,initrd以及rpm包等。

profile的机能是为着活动修改pxelinux.cfg/default文件,每生成或修改三遍profile,都会在default文件中期维修改或充实对应的label。

除开distro/profile之外,cobbler还管理system/images/repositories等,可是用的很少。

一.二 cobbler基本介绍

cobbler可以作为是一个越多效益的pxe,它落成系统设置和pxe可能多,供给的文件和进度大致都大同小异。

cobbler能自动管理dns/tftp/dhcp/rsync那多少个劳务(但就像是对tftp的管理某个bug,要求手动运营tftp),且cobbler信赖于httpd(pxe辅助http/nfs/ftp)。

基本的系统装置,cobbler只需生成几个distro和1个profile就可以。

distro相当于贰个镜像,它提供安装系统经过中所需的百分之百文件,如vmlinuz,initrd以及rpm包等。

profile的法力是为着活动修改pxelinux.cfg/default文件,每生成或改造三次profile,都会在default文件中期维修改或追加对应的label。

而外distro/profile之外,cobbler还管理system/images/repositories等,可是用的很少。

1.三 安装和布署cobbler

1.叁 安装和配备cobbler

1.3.1 安装cobbler

cobbler在epel源中提供。由于还依赖于httpd、dhcp,所以httpd和dhcp也相应装上。

yum -y install cobbler cobbler-web pykickstart debmirror httpd dhcp

里头cobbler-web是提供web管理分界面的,pykicstart是检查kicstart文件语法错误的,debmirror是爱慕debian源的工具,此处用不上但有正视关系,所以装上。

安装后,在/etc/cobbler生成以下文件。

[[email protected] ~]# cd /etc/cobbler/

[[email protected] cobbler]# ls
auth.conf       distro_signatures.json  modules.conf    reporting           tftpd.template  zone_templates
cheetah_macros  dnsmasq.template        mongodb.conf    rsync.exclude       users.conf
cobbler_bash    import_rsync_whitelist  named.template  rsync.template      users.digest
completions     iso                     power           secondary.template  version
dhcp.template   ldap                    pxe             settings            zone.template

图片 2

先启动httpd,再启动cobblerd。

[[email protected] cobbler]# systemctl start httpd.service
[[email protected] cobbler]# systemctl start cobblerd.service

[[email protected] cobbler]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name  
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1298/sshd          
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1402/master        
tcp        0      0 127.0.0.1:25151             0.0.0.0:*                   LISTEN      14091/python2       
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      2261/mysqld        
tcp        0      0 :::22                       :::*                        LISTEN      1298/sshd          
tcp        0      0 ::1:25                      :::*                        LISTEN      1402/master        
tcp        0      0 :::443                      :::*                        LISTEN      14037/httpd        
tcp        0      0 :::80                       :::*                        LISTEN      14037/httpd

启航之后,首先执行cobbler check检查安顿是不是精确。依照提醒修改相关的配置项。

[[email protected] cobbler]# cobbler check
The following are potential configuration items that you may want to fix:

1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : 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.
4 : change 'disable' to 'no' in /etc/xinetd.d/rsync
5 : comment out 'dists' on /etc/debmirror.conf for proper debian support
6 : comment out 'arches' on /etc/debmirror.conf for proper debian support
7 : ksvalidator was not found, install pykickstart
8 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
9 : 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.

先是和第三个难题:

[[email protected] cobbler]# vim /etc/cobbler/settings

next_server: 172.16.10.10
server: 172.16.10.10

其四个难点:获取pxelinux.0和menu.c3二文件(对于centos来讲只需那三个文本),可以像pxe同样从syslinux包中手动复制到/var/lib/cobbler/loaders目录下,也足以施行cobbler get-loaders自动下载,但要求联网。

[[email protected] cobbler]# cobbler get-loaders

第伍个难点:有相当大可能率该难点不是如此的,而是说要将rsyncd.service使用给start且enable,只需systemctl enable rsyncd,systemctl start rsyncd。

[[email protected] cobbler]# vim /etc/xinetd.d/rsync
disable=no

[[email protected] cobbler]# service xinetd start

第四、5个难题,注释掉/etc/debmirror.conf中相关项就可以。

第13个难点:因为从前安装的时候写成了pykicstart,所以出错了此间。

[[email protected] cobbler]# yum -y install pykickstart

第8个问题:

[[email protected] cobbler]# openssl passwd -1 -salt `openssl rand -hex 8` '123456'
$1$77e1022c$D9rxuxUWdc0NN46gzj9XT.

[[email protected] cobbler]# vim /etc/cobbler/settings
default_password_crypted: "$1$77e1022c$D9rxuxUWdc0NN46gzj9XT."

第八个难题和电源处理有关,不用管了。间接重启cobbler,然后cobbler sync。

[[email protected] cobbler]# service cobblerd restart

[[email protected] cobbler]# cobbler check
The following are potential configuration items that you may want to fix:
1 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

[[email protected] cobbler]# cobbler sync

 cobbler sync命令用于将tftpboot目录和/var/www/cobbler保持最新,当/var/lib/cobbler也许kickstart文件发出了调换,应该推行一次cobbler sync或然直接重启cobbler服务。

1.3.1 安装cobbler

cobbler在epel源中提供。由于还借助于httpd、dhcp,所以httpd和dhcp也应当装上。

yum -y install cobbler cobbler-web pykickstart debmirror httpd dhcp

里头cobbler-web是提供web处理分界面的,pykicstart是检查kicstart文件语法错误的,debmirror是保卫安全debian源的工具,此处用不上但有依赖关系,所以装上。

设置后,在/etc/cobbler生成以下文件。

[root@xuexi ~]# cd /etc/cobbler/

[root@xuexi cobbler]# ls
auth.conf       distro_signatures.json  modules.conf    reporting           tftpd.template  zone_templates
cheetah_macros  dnsmasq.template        mongodb.conf    rsync.exclude       users.conf
cobbler_bash    import_rsync_whitelist  named.template  rsync.template      users.digest
completions     iso                     power           secondary.template  version
dhcp.template   ldap                    pxe             settings            zone.template

图片 3

先启动httpd,再启动cobblerd。

[root@xuexi cobbler]# systemctl start httpd.service
[root@xuexi cobbler]# systemctl start cobblerd.service

[root@xuexi cobbler]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name  
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1298/sshd          
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1402/master        
tcp        0      0 127.0.0.1:25151             0.0.0.0:*                   LISTEN      14091/python2       
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      2261/mysqld        
tcp        0      0 :::22                       :::*                        LISTEN      1298/sshd          
tcp        0      0 ::1:25                      :::*                        LISTEN      1402/master        
tcp        0      0 :::443                      :::*                        LISTEN      14037/httpd        
tcp        0      0 :::80                       :::*                        LISTEN      14037/httpd

开头今后,首先实行cobbler check检查计划是还是不是准确。依据提醒修改有关的配置项。

[root@xuexi cobbler]# cobbler check
The following are potential configuration items that you may want to fix:

1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : 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.
4 : change 'disable' to 'no' in /etc/xinetd.d/rsync
5 : comment out 'dists' on /etc/debmirror.conf for proper debian support
6 : comment out 'arches' on /etc/debmirror.conf for proper debian support
7 : ksvalidator was not found, install pykickstart
8 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
9 : 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.

先是和第壹个难点:

[root@xuexi cobbler]# vim /etc/cobbler/settings

next_server: 172.16.10.10
server: 172.16.10.10

其三个难点:获取pxelinux.0和menu.c3二文件(对于centos来说只需那八个公文),能够像pxe一样从syslinux包中手动复制到/var/lib/cobbler/loaders目录下,也能够推行cobbler get-loaders自动下载,但供给联网。

[root@xuexi cobbler]# cobbler get-loaders

第九个难点:有只怕该难点不是那般的,而是说要将rsyncd.service使用给start且enable,只需systemctl enable rsyncd,systemctl start rsyncd。

[root@xuexi cobbler]# vim /etc/xinetd.d/rsync
disable=no

[root@xuexi cobbler]# service xinetd start

第伍、多个难点,注释掉/etc/debmirror.conf中相关项就可以。

第几个难点:因为事先安装的时候写成了pykicstart,所以出错了这边。

[root@xuexi cobbler]# yum -y install pykickstart

第8个问题:

[root@xuexi cobbler]# openssl passwd -1 -salt `openssl rand -hex 8` '123456'
$1$77e1022c$D9rxuxUWdc0NN46gzj9XT.

[root@xuexi cobbler]# vim /etc/cobbler/settings
default_password_crypted: "$1$77e1022c$D9rxuxUWdc0NN46gzj9XT."

第八个难点和电源管理有关,不用管了。间接重启cobbler,然后cobbler sync。

[root@xuexi cobbler]# service cobblerd restart

[root@xuexi cobbler]# cobbler check
The following are potential configuration items that you may want to fix:
1 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

[root@xuexi cobbler]# cobbler sync

 cobbler sync命令用于将tftpboot目录和/var/www/cobbler保持最新,当/var/lib/cobbler可能kickstart文件发出了调换,应该举行三遍cobbler sync只怕间接重启cobbler服务。

1.3.2 配置dhcp和tftp

假设在/etc/cobbler/setting中设置了manage_dhcp:壹,表示由cobbler管理dhcp(默感觉0即人为手动处理),则cobbler管理的dhcp的布局模板/etc/cobbler/dhcp.template会覆盖/etc/dhcp/dhcpd.conf中布署,所以应当修改dhcp.template。

此地采纳默许的不由cobbler管理dhcp。

[[email protected] cobbler]# yum-y install dhcp
[[email protected] cobbler]# vim /etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 259200;
max-lease-time 518400;
subnet 172.16.10.0 netmask 255.255.255.0 {
        range 172.16.10.20 172.16.10.50;
        option subnet-mask 255.255.255.0;
        next-server 172.16.10.10;          # tftp的地址
        filename "pxelinux.0";             # pxelinux.0的路径,此为tftp根目录(/var/lib/tftpboot)的相对路径
}

[[email protected] cobbler]# service dhcpd restart

至于tftp,在/etc/cobbler/settings中私下认可启用了由cobbler管理tftp,所以那边不须求配置它。只要知道它的根目录为/var/lib/tftpboot就可以。可是只要前面装系统的时候假若找不到tftp(应该是cobbler管理tftp的bug),则手动运营tftp就能够。

1.3.2 配置dhcp和tftp

假诺在/etc/cobbler/setting中装置了manage_dhcp:一,表示由cobbler管理dhcp(默感觉0即人为手动管理),则cobbler管理的dhcp的安排模板/etc/cobbler/dhcp.template会覆盖/etc/dhcp/dhcpd.conf中陈设,所以应该修改dhcp.template。

此地选取暗中同意的不由cobbler处理dhcp。

[root@xuexi cobbler]# yum-y install dhcp
[root@xuexi cobbler]# vim /etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 259200;
max-lease-time 518400;
subnet 172.16.10.0 netmask 255.255.255.0 {
        range 172.16.10.20 172.16.10.50;
        option subnet-mask 255.255.255.0;
        next-server 172.16.10.10;          # tftp的地址
        filename "pxelinux.0";             # pxelinux.0的路径,此为tftp根目录(/var/lib/tftpboot)的相对路径
}

[root@xuexi cobbler]# service dhcpd restart

有关tftp,在/etc/cobbler/settings中暗中同意启用了由cobbler管理tftp,所以那边不需求陈设它。只要精通它的根目录为/var/lib/tftpboot就可以。但是壹旦前边装系统的时候即使找不到tftp(应该是cobbler管理tftp的bug),则手动运维tftp就可以。

一.肆 cobbler从地点光盘安装系统

1.四 cobbler从本土光盘安装系统

1.4.1 生成distro

生成distro的点子有三种,能够从本地镜像导入生成,也能够遵照互联网上的财富转移。鲜明,从本土转移的频率是最棒的。

从本地导入的过程实际上是将系统镜像中的文件复制到/var/www/cobbler/目录(暗许)下。

mkdir /mnt
mount /dev/cdrom /mnt
cobbler import --name=CentOS7.2 --path=/mnt

伺机导入完毕,则意味着distro生成实现。

[[email protected] cobbler]# ls -l /var/www/cobbler/images/CentOS7.2-x86_64/
total 38056
-r--r--r-- 3 root root 34815427 Oct 24  2014 initrd.img
-r-xr-xr-x 3 root root  4152336 Oct 24  2014 vmlinuz

[[email protected] cobbler]# ls -l /var/www/cobbler/ks_mirror/CentOS7.2/   # 此目录完全来源于镜像
total 340
-r--r--r-- 1 root root     14 Oct 24  2014 CentOS_BuildTag
dr-xr-xr-x 3 root root   4096 Oct 24  2014 EFI
-r--r--r-- 1 root root    212 Nov 28  2013 EULA
-r--r--r-- 1 root root  18009 Nov 28  2013 GPL
dr-xr-xr-x 3 root root   4096 Oct 24  2014 images
dr-xr-xr-x 2 root root   4096 Oct 24  2014 isolinux
dr-xr-xr-x 2 root root 278528 Oct 24  2014 Packages
-r--r--r-- 1 root root   1354 Oct 20  2014 RELEASE-NOTES-en-US.html
dr-xr-xr-x 2 root root   4096 Oct 24  2014 repodata
-r--r--r-- 1 root root   1706 Nov 28  2013 RPM-GPG-KEY-CentOS-6
-r--r--r-- 1 root root   1730 Nov 28  2013 RPM-GPG-KEY-CentOS-Debug-6
-r--r--r-- 1 root root   1730 Nov 28  2013 RPM-GPG-KEY-CentOS-Security-6
-r--r--r-- 1 root root   1734 Nov 28  2013 RPM-GPG-KEY-CentOS-Testing-6
-r--r--r-- 1 root root   3380 Oct 24  2014 TRANS.TBL

确保url路径

 

1.4.1 生成distro

生成distro的秘诀有多样,能够从地点镜像导入生成,也得以依靠互连网上的能源转移。分明,从地面转移的功用是最佳的。

从地点导入的历程实际上是将系统镜像中的文件复制到/var/www/cobbler/目录(私下认可)下。

mkdir /mnt
mount /dev/cdrom /mnt
cobbler import --name=CentOS7.2 --path=/mnt

等待导入落成,则象征distro生成完毕。

[root@xuexi cobbler]# ls -l /var/www/cobbler/images/CentOS7.2-x86_64/
total 38056
-r--r--r-- 3 root root 34815427 Oct 24  2014 initrd.img
-r-xr-xr-x 3 root root  4152336 Oct 24  2014 vmlinuz

[root@xuexi cobbler]# ls -l /var/www/cobbler/ks_mirror/CentOS7.2/   # 此目录完全来源于镜像
total 340
-r--r--r-- 1 root root     14 Oct 24  2014 CentOS_BuildTag
dr-xr-xr-x 3 root root   4096 Oct 24  2014 EFI
-r--r--r-- 1 root root    212 Nov 28  2013 EULA
-r--r--r-- 1 root root  18009 Nov 28  2013 GPL
dr-xr-xr-x 3 root root   4096 Oct 24  2014 images
dr-xr-xr-x 2 root root   4096 Oct 24  2014 isolinux
dr-xr-xr-x 2 root root 278528 Oct 24  2014 Packages
-r--r--r-- 1 root root   1354 Oct 20  2014 RELEASE-NOTES-en-US.html
dr-xr-xr-x 2 root root   4096 Oct 24  2014 repodata
-r--r--r-- 1 root root   1706 Nov 28  2013 RPM-GPG-KEY-CentOS-6
-r--r--r-- 1 root root   1730 Nov 28  2013 RPM-GPG-KEY-CentOS-Debug-6
-r--r--r-- 1 root root   1730 Nov 28  2013 RPM-GPG-KEY-CentOS-Security-6
-r--r--r-- 1 root root   1734 Nov 28  2013 RPM-GPG-KEY-CentOS-Testing-6
-r--r--r-- 1 root root   3380 Oct 24  2014 TRANS.TBL

确保url路径

图片 4

 

1.4.2 提供kickstart文件

以下是CentOS7的Kickstart内容。如若要改为顺应CentOS陆的内容,只需将keyboard项设置为"keyboard us",并修改下分区格局(如有须要的话)以及%post脚本段的源委就能够。

[[email protected] ~]# vim /var/lib/cobbler/kickstarts/CentOS7.2.ks
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Install OS instead of upgrade
install
# Use network installation
url --url=$tree
# Use text mode install
text
# Firewall configuration
firewall --disabled
firstboot --disable
# ignoredisk --only-use=sda   # 此项是CentOS7默认的项,但cobbler编译ks文件时不支持此语法,所以必须将此项注释掉
# Keyboard layouts
# old format: keyboard us
# new format:
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8

# Network information
network  --onboot=yes --bootproto=dhcp --device=eth0 --noipv6
network  --hostname=node1.xuexi.com
# Reboot after installation
reboot
# Root password
rootpw --iscrypted $6$KIPkwGVYqtjHln80$quxmkE5MKKA2LyzLOAc/s3FWH/jX76sObq6hqwOsEBoeMc/wIrzGG4xm72lkXwLeOfRLS/sl5vdajY9j34D4J. 
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Shanghai
# System bootloader configuration
bootloader --append="quiet crashkernel=auto" --location=mbr --boot-drive=sda
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --asprimary --fstype="xfs" --size=250
part swap --fstype="swap" --size=2000
part / --asprimary --fstype="xfs" --grow --size=5000

# 如果是要LVM分区,则考虑以下分区
# part /boot --fstype ext4 --size=100
# part swap --fstype=swap --size=2048
# part pv26 --size=100 --grow
# volgroup VG00 --pesize=32768 pv26
# logvol / --fstype ext4 --name=LVroot --vgname=VG00 --size=29984
# logvol /data --fstype ext4 --name=LVdata --vgname=VG00 --size=100 --grow

%post
rm -f /etc/yum.repos.d/*
cat >>/etc/yum.repos.d/my.repo<<eof
[base]
name=sohu
baseurl=http://mirrors.sohu.com/centos/7/os/x86_64/
gpgcheck=0
enable=1
[epel]
name=epel
baseurl=http://mirrors.aliyun.com/epel/7Server/x86_64/
enable=1
gpgcheck=0
eof
sed -i "s/rhgb //" /boot/grub2/grub.cfg
sed -i "/UUID/d" /etc/sysconfig/network-scripts/ifcfg-eth0
echo "DNS1=114.114.114.114" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "UseDNS no" >> /etc/ssh/sshd_config
sed -i "s/GSSAPIAuthentication yes/GSSAPIAuthentication no/" /etc/ssh/ssh_config
sed -i "s/^SELINUX=.*$/SELINUX=disabled/" /etc/sysconfig/selinux
systemctl disable firewalld
%end

%packages
@base
@core
@development
@platform-devel
kexec-tools
lftp
tree
lrzsz

%end


	

编辑:亚洲城 本文来源:cobbler无人值班守护,cobbler无人值班守护批量安装

关键词: 亚洲城ca88