cobbler |
一、首先準備好一臺虛擬機linux
二、給虛擬機添加一塊網卡,並設置成僅主機模式 vim
部署 |
1.查看版本信息centos
cat /etc/redhat-release網絡
2.配置網絡yum源app
將原來的網絡yum源移動到一個文件夾中,從新配置網絡yum源dom
下面是ali.repo 中的內容測試
[epel] name=epel enabled=1 gpgcheck=0 baseurl=https://mirrors.aliyun.com/epel/7/x86_64/ [centos] name=centos base enabled=1 gpgcheck=0 baseurl=http://mirrors.163.com/centos/7/os/x86_64/
下載:yum install cobbler dhcp tftp-server xinetd syslinux httpd pykickstart -yui
3.配置dhcp:this
注意:其中的192.168.24.0是僅主機模式下的ip
加密
重啓dhcpd:systemctl restart dhcpd
設置開機自啓:systemctl enable dhcpd
4.修改tftp:vim /etc/xinetd.d/tftp
重啓xinetd服務:systemctl restart xinetd
設置開機啓動:systemctl enable xinetd.service
5.配置cobbler:
一、先啓動httpd:systemctl restart httpd
二、cobbler check
[root@work cobbler]# cobbler check The following are potential configuration items that you may want to fix: 1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting featurt work. This should be a resolvable hostname or IP for
the boot server as reachable by all machines that will use it 2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 12nd should match the IP of the boot server on the PXE
network. 3 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to downloa, if you only want to handle x86/x86_64 netbooting,
you may ensure that you have installed a *recent* version of the ackage installed and can ignore this message entirely. Files in this directory, should you want to support
all archishould include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to rse requirements. 4 : enable and start rsyncd.service with systemctl 5 : debmirror package is not installed, it will be required to manage debian deployments and repositories 6 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/ttings) is still set to 'cobbler' and should be changed,
try: "openssl passwd -1 -salt 'random-phrase-here' 'your-pas'" to generate new one 7 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fs to use them Restart cobblerd and then run 'cobbler sync' to apply changes.
問題一:cobbler文件默認是127.0.0.1本地迴環地址,須要更改成提供cobbler服務的ip地址 192.168.24.137
sed i 's/server: 127.0.0.1/server: 192.168.24.137/g' /etc/cobbler/settings
問題二:netx_server也是默認本地127.0.0.1迴環地址,須要修改成提供cobbler服務的ip地址 192.168.24.137
sed i 's/next_server: 127.0.0.1/next_server: 192.168.24.137/g' /etc/cobbler/settings
問題三:忽略
問題四:啓動rsync便可
systemctl restart rsyncd
systemctl enable rsyncd
問題五:忽略
問題六:更改密碼,並把新生成的加密數據填寫進
/etc/cobbler/settings openssl passwd -1 -salt "123" "123"
將獲得的加密密碼複製:vim /etc/cobbler/settings
問題7:忽略
解決完問題以後咱們須要重啓cobbler服務:
service cobblerd restart
進行同步 cobbler sync
檢查是否更改完成,下圖表示完成
六、掛載光盤並進行導入
七、準備ks文件
一、cp anaconda-ks.cfg /var/lib/cobbler/kickstarts/ks.cfg
二、vim /var/lib/cobbler/kickstarts/ks.cfg
注意:其中ip是僅主機模式的ip地址,後面的路徑是 在/var/www/cobbler/ks_mirror/centos7.3/
八、自定義profile
cobbler profile add --distro="centos7.3-x86_64" -name="centos7.3_chen" --kickstart=/var/lib/cobbler/kickstarts/ks.cfg
cobbler sync
這就安裝成功啦 (注意:在這裏我把centos7.3-x86_64刪除了)
你能夠用cobbler profile remove -name="centos7.3-x86_64"
爲了保證明驗的成功率,你能夠在重啓一下服務
測試 |
打開一個未裝系統的虛擬機,將網卡設置成僅主機模式,同時內存最好調整爲3G
選擇下面的鏡像就ok啦