1. 程式人生 > >cobbler--centos7.3

cobbler--centos7.3

inux work addition pan 127.0.0.1 scripts 驗證 proto password

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這個IPcobbler 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行修改成你對應的網段和ipsubnet 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=developmentbaseurl=file:///yum/enabled=1gpgcheck=0# yum clean all# system-config-kickstart -----圖形自定義ks文件,過程省略定義的ks.cfg文件:#platform=x86, AMD64, or Intel EM64T#version=DEVEL# Install OS instead of upgradeinstall# Keyboard layoutskeyboard ‘us‘# Root passwordrootpw --iscrypted $1$s.qimPg3$T/Wp3yfp7/CZfQLfYcT69.# Use network installationurl --url="http://192.168.1.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# System bootloader configurationbootloader --location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart --all --initlabel# Disk partitioning informationpart /boot --asprimary --fstype="xfs" --size=300part swap --asprimary --fstype="swap" --size=2000part / --asprimary --fstype="xfs" --grow --size=1%posttouch /root/123%end%packages@additional-devel@desktop-debugging@development@fonts@gnome-desktop@input-methods@legacy-x@platform-devel@remote-desktop-clients@x11initial-setupinitial-setup-guivinagre%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 listcentos7.3-x86_64my_profile1最後進行安裝測試

cobbler--centos7.3