cobbler:
Cobbler由python語言開發(fā)启涯,是對PXE和Kickstart以及DHCP的封裝蹲姐。融合很多特性,提供了CLI和Web的管理形式渔肩。更加方便的實行網(wǎng)絡(luò)安裝飒焦。
cobbler的工作流程;
![image](https://timgsa.baidu.com/timg?image&quality=80&size=b10000_10000&sec=1501464617&di=3716e1bd730c54aad10625539ea86a1c&imgtype=jpg&src=http://d.hiphotos.baidu.com/image/pic/item/a8014c086e061d95392ee1bf71f40ad163d9cac9.jpg)
image
配置cobbler:
1 準備環(huán)境:
(1)所選主機需有2個網(wǎng)卡因妇,其中一個為靜態(tài)ip且僅主機模式董朝;另一個為dhcp獲取的橋接模式灰瞻,可獲取yum源腥例。
(2)禁用selinux,關(guān)閉防火墻酝润。
iptables -F
[root@centos7 ~]#getenforce
Permissive
(3)安裝各種所需服務(wù)并啟用
yum install dhcp cobbler cobbler-web
systemctl enable dhcpd (該服務(wù)會被cobbler接管燎竖,在cobbler配置文件中可以配置)
systemctl enable httpd
systemctl enable tftpd
systemctl enable cobblerd
systemctl start dhcpd
systemctl start httpd
systemctl start tftpd
systemctl start cobblerd
2 更改cobbler的配置文件
在更改文件的時候最好備份一份,防止破壞文件無法恢復(fù)要销。
vim /etc/cobbler/settings
(1) 文件的384行:
server: 192.168.52.142 -----------》改成僅主機模式的那塊網(wǎng)卡的ip
(2)文件的272行:
next_server: 192.168.52.142---------》同上
(3)文件的242行 :
manage_dhcp: 1 ------------------》原文件為0构回,改成1,表示dhcp服務(wù)由cobler接管疏咐。
(4)更改完文件后需輸入命令 cobbler sync 寫入 纤掸;
可用cobbler check 檢查有無遺漏。
[root@centos7 ~]#cobbler check
The following are potential configuration items that you may want to fix:
1 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
https://github.com/cobbler/cobbler/wiki/Selinux
2 : enable and start rsyncd.service with systemctl
3 : debmirror package is not installed, it will be required to manage debian deployments and repositories
4 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
Restart cobblerd and then run 'cobbler sync' to apply changes.
(5)此時去查看dhcp服務(wù)的配置文件會顯示已被cobbler接管浑塞。
[root@centos7 ~]#cat /etc/dhcp/dhcpd.conf
# ******************************************************************
# Cobbler managed dhcpd.conf file
# generated from cobbler dhcp.conf template (Mon Jul 24 07:19:37 2017)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
# ******************************************************************
3 下載加載程序并導(dǎo)入光盤
cobbler get-loaders
cobbler sync
systemctl restart cobblerd.service
cobbler import --path=/misc/cd --name=centos7.3
cobbler import --path=/misc/cd --name=centos6.9
cobbler sync
導(dǎo)入完成后
[root@centos7 ~]#cobbler distro list
centos6.9-x86_64
centos7.3-x86_64
自動回生成2個ks文件茁肠,默認為最小化安裝。
![image](https://timgsa.baidu.com/timg?image&quality=80&size=b10000_10000&sec=1501486394&di=3e5fd23d216392e015747f7d0f8f4ae7&imgtype=jpg&src=http://h.hiphotos.baidu.com/image/pic/item/d8f9d72a6059252d3b46708c3e9b033b5ab5b9e1.jpg)
image