cobbler实现批量部署Linux服务器(CentOS7.3含自定义安装)
来源:互联网 发布:教师网络研修收获 编辑:程序博客网 时间:2024/05/18 20:52
centos7.3下使用私有网络(我这里使用kvm自建的default1网络,网段为192.168.100.0/24)实现cobbler自动安装拓扑图:cobbler server ------- client192.168.100.2/24第一步:先安装cobbler相关软件包 (需要epel源,local源,centos163源;但因为需要用私有网络来做实验,但私有网络又不能和我的共享源连接,所以先可以使用桥接网络把下面的包装上,再换成私有网络) # yum install cobbler cobbler-web tftp* rsync xinetd http* syslinux dhcp* pykickstart fence-agents xinetd debmirror system-config-kickstart第二步:启动服务,并使用cobbler check查询哪些需要修改# systemctl restart cobblerd.service# systemctl restart httpd.service # systemctl enable cobblerd.service# systemctl enable httpd.service# cobbler check(报错基本上和rhel6.5的差不多,要看具体报错可以参考我上一篇同类型rhel6.5文章)第三步:按照cobbler check对应的信息修改# sed -i 272s/127.0.0.1/192.168.100.2/ /etc/cobbler/settings# sed -i 384s/127.0.0.1/192.168.100.2/ /etc/cobbler/settings # sed -i 242s/0/1/ /etc/cobbler/settings# openssl passwd -1 -salt 'xcvsfdsdfwq' '123456' -- xcvsfdsdfwq 为干扰码 可以随便填$1$xcvsfdsd$cGxdcHuQGCnu5vJw5M7zX1# vim /etc/cobbler/settings--在101行把上面产生的密码字符串粘贴到""里替代原来的字符串default_password_crypted: "$1$xcvsfdsd$cGxdcHuQGCnu5vJw5M7zX1"# systemctl restart cobblerd.service# sed -i /disable/s/yes/no/ /etc/xinetd.d/tftp# systemctl restart rsyncd.service# systemctl enable rsyncd.service第四步:导入centos7.3的iso镜像(镜像自行下载)# cobbler import --path=/yum/ --name=centos7.3# cobbler distro list--导入成功后,确认导入的镜像名 centos7.3-x86_64# cobbler profile list--导入成功后,确认默认的profile名 centos7.3-x86_64第五步:修改dhcp配置# vim /etc/cobbler/dhcp.template --在此文件的第21行到第25行修改成你对应的网段和ipsubnet 192.168.100.0 netmask 255.255.255.0 { option routers 192.168.100.2; option domain-name-servers 192.168.100.2; option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.100.100 192.168.100.254;
(这里的参数的意义在上一篇同类文章rhel6.5有介绍)第六步:使用cobbler sync同步,并启动xinetd服务# cobbler sync# systemctl restart xinetd.service# systemctl enable xinetd.service第七步:新建另一个虚拟机(保证相同私有网络,并且最好2G内存,内存小的话会在安装时报空间不够的错误),进行安装测试 ==============================================================================自动安装我们已经实现了,但如何自定义我们想安装的profile重点就是你需要自定义一个ks文件自定义ks文件的方法1,如果你很熟悉此文件,直接拷别人的模版修改或者直接使用/root/anaconda-ks.cfg来修改2,使用一个图形工具system-config-kickstart来帮助你配置(下面我就是使用这种方法)# yum install system-config-kickstart# system-config-kickstart# vim /etc/yum.repos.d/local.repo --这里有个小问题,需要把软件仓库里改成development,图形才能选择包,否则图形在选择软件包那一步看不到[development]name=developmentbaseurl=file:///yum/(你的本地yum源目录)enabled=1gpgcheck=0--图形的操作过程这里省略给大家两个做好的ks.cfg文件参考:第一个文件就是大家用来安装centos7.3宿主机的ks文件,内容如下:#platform=x86, AMD64, or Intel EM64T#version=DEVEL# Install OS instead of upgradeinstall# Keyboard layoutskeyboard 'us'# Root passwordrootpw --iscrypted $1$6RbFC2nC$GBugZL7ACuGhck8DbUZgM/# Use network installationurl --url="http://172.16.13.250/cobbler/ks_mirror/centos7.3/"# System languagelang en_US# Firewall configurationfirewall --disabled# System authorization informationauth --useshadow --passalgo=sha512# Use text mode installtextfirstboot --disable# SELinux configurationselinux --disabled# Network informationnetwork --bootproto=dhcp --device=eth0# Reboot after installationreboot# System timezonetimezone Asia/Shanghai --isUtc# System bootloader configurationbootloader --append="rhgb quiet" --location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart --all --initlabel# Disk partitioning informationpart /boot --fstype="xfs" --size=300part swap --fstype="swap" --size=4000part / --fstype="xfs" --size=150000part /data --fstype="xfs" --size=80000%packages@additional-devel@desktop-debugging@development@fonts@gnome-desktop@input-methods@kde-desktop@legacy-x@platform-devel@remote-desktop-clients@x11initial-setupinitial-setup-guivinagre%end=========================================================================# cobbler profile help--查看帮助# cobbler profile list--查看有哪些profile centos7.3-x86_64# cobbler profile report --name=centos7.3-x86_64 |grep KickstartKickstart : /var/lib/cobbler/kickstarts/sample_end.ks --这就是这个安装方案的kickstart文件Kickstart Metadata : {}我现在自定义一个ks文件,也想做成一个profile,步骤如下:步骤一:自定义ks文件(使用system-config-kickstart或直接找一个模版文件修改),得到如下的文件# vim /var/lib/cobbler/kickstarts/centos7.3.ks--复制下面一大段信息,粘到此文件里#platform=x86, AMD64, or Intel EM64T#version=DEVEL# Install OS instead of upgradeinstall# Keyboard layoutskeyboard 'us'# Root passwordrootpw --iscrypted $1$6RbFC2nC$GBugZL7ACuGhck8DbUZgM/# Use network installationurl --url="http://192.168.100.2/cobbler/ks_mirror/centos7.3/"# System languagelang en_US# Firewall configurationfirewall --disabled# System authorization informationauth --useshadow --passalgo=sha512# Use text mode installtextfirstboot --disable# SELinux configurationselinux --disabled# Network informationnetwork --bootproto=dhcp --device=eth0# Reboot after installationreboot# System timezonetimezone Asia/Shanghai --isUtc# System bootloader configurationbootloader --append="rhgb quiet" --location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart --all --initlabel# Disk partitioning informationpart /boot --fstype="xfs" --size=300part swap --fstype="swap" --size=2000part / --fstype="xfs" --grow --size=1%postrm /etc/yum.repos.d/* -rfcat > /etc/yum.repos.d/local.repo << EOF[base]name=basebaseurl=file:///yumenabled=1gpgcheck=0EOF%end%packages@additional-devel@desktop-debugging@development@fonts@gnome-desktop@input-methods@kde-desktop@legacy-x@platform-devel@remote-desktop-clients@x11initial-setupinitial-setup-guivinagre%end步骤二:把准备好的ks文件做成一个新的profile# cobbler profile add --name=new_centos7.3 --distro=centos7.3-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos7.3.ks# cobbler profile list--在原来基础上就多了自定义的安装方案 centos7.3-x86_64 new_centos7.3步骤三:测试然后就可以新建一个客户端虚拟机,使用上面的new_centos7.3安装名字来测试了==================================================================对上面操作的扩展(仅供参考)# cobbler profile edit --name=new_centos7.3 --kickstart=/var/lib/cobbler/kickstarts/xxx.ks # cobbler profile remove --name=new_centos7.3======================================================================欢迎讨论交流!常年在线!
阅读全文
0 0
- cobbler实现批量部署Linux服务器(CentOS7.3含自定义安装)
- cobbler实现批量部署Linux服务器(rhel6.5)
- Centos7.3 Cobbler自动化批量系统部署
- Cobbler全自动批量安装部署Linux系统
- Cobbler全自动批量安装部署Linux系统
- Cobbler全自动批量安装部署Linux系统
- Cobbler全自动批量安装部署Linux系统
- Cobbler全自动批量安装部署Linux系统
- Cobbler全自动批量安装部署Linux系统
- Cobbler全自动批量安装部署Linux系统
- CentOS7 安装cobbler自动部署ubuntu
- CentOS7 安装cobbler自动部署ubuntu
- centos7 部署cobbler
- cobbler部署centos7
- Cobbler批量部署RedHat
- cobbler批量安装linux(centos6.5)
- cobbler无人值守批量安装Linux系统
- centos7.3 安装cobbler 2.8.x
- SQL语句使用02------select语法
- java基础复习2 选择&循环
- Java的基本类型和引用类型
- 浅析SQL Server在可序列化隔离级别下,防止幻读的范围锁的锁定问题
- Kotlin学习(3):习惯用法
- cobbler实现批量部署Linux服务器(CentOS7.3含自定义安装)
- 自动化爬取网贷黑名单
- UGUI框架
- PLSQL中如何进行界面的基本使用和编辑。
- hive中的增删改如何实现
- SDUT 2872二分查找
- python
- Module not found: Error: Can't resolve 'sass-loader' in 'D:\vue_test_project\vuedemo\src'
- hdu5073-思维&方差-Galaxy