cobbler--centos7.3

centos7.3来做cobbler
第一步:
先安装cobbler相关软件包  --这一次直接使用我们准备好的公网yum源安装就可以了
# yum install cobbler cobbler-web tftp* rsync xinetd http* syslinux dhcp* pykickstart fence-agents xinetd debmirror system-config-kickstart
第二步:
再把上面准备好的这台机器换成虚拟机的私有网络,我这里仍然是使用昨天使用的vmnet1网络和192.168.1.2/24这个IP
cobbler server ------- client
192.168.1.2/24
修改虚拟机的网卡连接/dev/vmnet1网络
然后修改ip地址
# vim /etc/sysconfig/network-scripts/ifcfg-ens33 ----打开网卡配置文件,只修改ip和掩码,其它不变
......
IPADDR="192.168.1.2"
PREFIX="24"
......
# systemctl restart network.service
重启网络后,使用ifconfig查看验证一下是否获取到了192.168.1.2/24这个ip
第三步:启动服务,并使用cobbler check查询哪些需要修改
# systemctl start cobblerd.service
# systemctl start httpd.service
# cobbler check
第四步:按照cobbler check对应的信息修改
# sed -i 272s/127.0.0.1/192.168.1.2/ /etc/cobbler/settings
# sed -i 384s/127.0.0.1/192.168.1.2/ /etc/cobbler/settings
# sed -i 242s/0/1/ /etc/cobbler/settings
# openssl passwd -1 -salt 'xcvsfdsdfwq' '123456'
$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 start 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行修改成你对应的网段和ip
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.2;
option domain-name-servers 192.168.1.2;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.1.100 192.168.1.254;
第七步:使用cobbler sync同步,并启动xinetd服务
# cobbler sync
# systemctl start xinetd.service
第八步:新建另一个虚拟机(保证相同私有网络,并且最好2G内存,内存小的话会在安装时报空间不够的错误),进行安装测试 
第九步:使用system-config-kickstart图形自定义ks文件
# vim /etc/yum.repo.d/local.repo ----需要把软件仓库里改成development,图形才能选择包,否则图形在选择软件包那一步看不到
[development]
name=development
baseurl=file:///yum/
enabled=1
gpgcheck=0
# yum clean all
# system-config-kickstart -----图形自定义ks文件,过程省略
定义的ks.cfg文件:
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --iscrypted $1$s.qimPg3$T/Wp3yfp7/CZfQLfYcT69.
# Use network installation
# System language
lang en_US
# Firewall configuration
firewall --disabled
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
firstboot --disable
# SELinux configuration
selinux --disabled
# Network information
network --bootproto=dhcp --device=eth0
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --asprimary --fstype="xfs" --size=300
part swap --asprimary --fstype="swap" --size=2000
part / --asprimary --fstype="xfs" --grow --size=1
%post
touch /root/123
%end
%packages
@additional-devel
@desktop-debugging
@development
@fonts
@gnome-desktop
@input-methods
@legacy-x
@platform-devel
@remote-desktop-clients
@x11
initial-setup
initial-setup-gui
vinagre
%end
# mv /root/ks.cfg /var/lib/cobbler/kickstarts/myks1.ks
# cobbler profile add --name=my_profile1 --distro=centos7.3-x86_64 --kickstart=/var/lib/cobbler/kickstarts/myks1.ks
# cobbler profile list
centos7.3-x86_64
my_profile1
最后进行安装测试
posted @ 2018-06-19 21:37  Sky-wings  阅读(196)  评论(0编辑  收藏  举报