CentOS7 利用Cobbler安装部署centos系统

1.关闭防火墙firewall,selinux.

2.下载epel源yum -y install http://mirrors.163.com/centos/7/extras/x86_64/Packages/epel-release-7-9.noarch.rpm 

3.下载包 yum install cobbler cobbler-web dhcp tftp-server pykickstart httpd xinetd bind -y

4.启动服务.systemctl start xinetd.service && systemctl enable xinetd.service  && systemctl start httpd  && systemctl enable httpd  && systemctl start cobblerd.service  &&   systemctl enable cobblerd.service 

4.2 .

vim /etc/xinetd.d/tftp 
将“disable                = yes”修改为“disable                = no”


5.修改配置.  

生成系统的密码:      openssl passwd -1 -salt 'random-phrase-here' '12341234'    $1$random-p$NLH/1IYlMj3/JRYPvL4cQ/

>1 . vi  /etc/cobbler/settings 

next_server: 192.168.18.254         替换本机IP地址 (DHCP服务地址)

server: 192.168.18.254                替换本机IP地址(cobbler服务地址)

pxe_just_once: 1                    ks脚本关闭pxe,这样就不会重复安装
manage_dhcp: 1                    替换为 1(cobbler管理dhcp,后面用于同步更新配置信息[cobbler sync])
manage_rsync: 1                    替换为 1 (cobbler管理rsync功能)

manage_tftpd: 1                    替换为 1 (cobbler管理tftp功能)

default_password_crypted:    "$1$random-p$NLH/1IYlMj3/JRYPvL4cQ/"

注意:这里保存的密码,将会用于批量部署机器中,root账户的登录密码。

2>.获取loader文件。

 cobbler get-loaders

3>.配置dhcp文件。/etc/cobbler/dhcp.template 


    subnet 10.10.10.0 netmask 255.255.255.0 {
     option routers             10.10.10.5;
     option domain-name-servers 10.10.10.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        10.10.10.100 10.10.10.200;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;

4>

cobbler check

6.导入iso文件。

 ls /opt/iso/

CentOS-6.6-x86_64-bin-DVD1.iso

mount -o loop /opt/iso/CentOS-6.6-x86_64-bin-DVD1.iso    /mnt/

cobbler import --path=/mnt --name=CentOS-6.5 --arch=x86_64  --kickstart=/var/lib/cobbler/kickstarts/centos-6.5-x86_64.ks  

默认ks文件为 /var/lib/cobbler/kickstarts/sample_end.ks 文件。

ls  /var/www/cobbler/ks_mirror/     查看目录生成情况。

cobbler sync 同步信息。

7.创建一台虚机测试一下。










猜你喜欢

转载自blog.csdn.net/weixin_38098312/article/details/79091965
今日推荐