频道栏目
首页 > 网络 > 其他 > 正文

利用cobbler 实现系统自动化安装-繁殇残雪的博客-51CTO博客

2019-04-21 12:11:38           
收藏   我要投稿
1 安装包和配置服务
root:~# yum install cobbler  dhcp -y
root:~# systemctl enable tftp dhcpd httpd cobblerd
root:~# systemctl start tftp  httpd cobblerd
2 修改cobbler 配置文件
vim /etc/cobbler/settings
server: cobblerIP  384

利用cobbler 实现系统自动化安装

next_server: cobblerIP 272 

利用cobbler 实现系统自动化安装

default_password_crypted: "$1$VBqc7U0W$F2qhI5oZwR8chJBU.mAly1"   101

利用cobbler 实现系统自动化安装

manage_dhcp: 1    242 #可自动配置dhcp

利用cobbler 实现系统自动化安装

root:~# cobbler get-loaders
task started: 2019-04-19_074328_get_loaders
task started (id=Download Bootloader Content, time=Fri Apr 19 07:43:28 2019)
downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
downloading https://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
downloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading https://cobbler.github.io/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***
root:~# cobbler sync
task started: 2019-04-19_074450_sync
*********
!!! TASK FAILED !!!
3 配置dhcp服务
root:~# vim /etc/cobbler/dhcp.template
subnet 192.168.64.0 netmask 255.255.255.0 {
     option routers             192.168.64.254;
     option domain-name-servers 1.1.1.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.64.100 192.168.64.254

root:~# cobbler sync
task started: 2019-04-19_075613_sync
task started (id=Sync, time=Fri Apr 19 07:56:13 2019)
running pre-sync triggers
..................................
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
4导入安装源文件 将光盘挂载好

root:~# dfFilesystem 1K-blocks Used Available Use% Mounted on/dev/mapper/centos-root 52403200 2066756 50336444 4% /devtmpfs 919432 0 919432 0% /devtmpfs 931612 0 931612 0% /dev/shmtmpfs 931612 9744 921868 2% /runtmpfs 931612 0 931612 0% /sys/fs/cgroup/dev/sda1 1038336 149004 889332 15% /boot/dev/mapper/centos-home 154057220 33100 154024120 1% /hometmpfs 186324 0 186324 0% /run/user/0/dev/sr0 10491772 10491772 0 100% /mnt/7/dev/sr1 3897932 3897932 0 100% /mnt/6

root:~# cobbler import --path=/mnt/6 --name=Centos-6.10 --arch=x86_64
task started: 2019-04-19_080352_import
task started (id=Media import, time=Fri Apr 19 08:03:52 2019)
Found a candidate signature: breed=redhat, version=rhel6
Found a matching signature: breed=redhat, version=rhel6
Adding distros from path /var/www/cobbler/ks_mirror/Centos-6.10-x86_64:
creating new distro: Centos-6.10-x86_64
trying symlink: /var/www/cobbler/ks_mirror/Centos-6.10-x86_64 -> /var/www/cobbler/links/Centos-6.10-x86_64
creating new profile: Centos-6.10-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-6.10-x86_64 for Centos-6.10-x86_64
processing repo at : /var/www/cobbler/ks_mirror/Centos-6.10-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/Centos-6.10-x86_64
looking for /var/www/cobbler/ks_mirror/Centos-6.10-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/Centos-6.10-x86_64/repodata
*** TASK COMPLETE ***
查看现有安装选项
root:~# cobbler profile list
   Centos-6.10-x86_64
现在已经可以自动化安装了,不过cobbler默认配置文件为最小化安装,想要自定义的花要修改配置文件 Centos 7.0下使用system-config-kickstart
修改CentOS-Base.repo

[base]                     修改 ---------->[development]  
name=CentOS-$releasever - Base
root:~# yum install -y system-config-kickstart.noarch
root:~  # env LANG=zh_CN.UTF-8 system-config-kickstart #生成自定义配置文件

利用cobbler 实现系统自动化安装

将所有选项选完即可左上角保存
相关TAG标签
上一篇:Linux下如何关闭命令行正在执行的程序或命令-wx5addac6d595e2的博客-51CTO博客
下一篇:智能DNS服务器配置-lnnkee-51CTO博客
相关文章
图文推荐
文章
推荐
热门新闻

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站