日常運(yùn)維工作中返吻,當(dāng)大規(guī)模服務(wù)器上架時(shí),系統(tǒng)安裝就變成了煩心事刚梭。吵鬧的IDC機(jī)房肠阱,無腦的下一步選擇, 頻繁的安裝系統(tǒng)且效率低下望浩。如果你是搞云計(jì)算的辖所,計(jì)算節(jié)點(diǎn)安裝肯定讓你印象深刻。如果你們用的是PXE安裝磨德,初期調(diào)試肯定也容易讓人崩潰缘回。系統(tǒng)單一吆视,安裝效率慢,安裝方式單一酥宴,為了解決這一系列由于裝機(jī)引起的問題啦吧,解決工作中的痛點(diǎn),我們引進(jìn)了Cobbler拙寡,一個(gè)讓部署系統(tǒng)簡單方便的自動(dòng)化部署工具授滓。同時(shí)還可以制作內(nèi)部Yum源,簡直是方便的不能在方便肆糕。
OK:不要干般堆,就是慫。Here we go!
</br>
Cobbler簡介
Cobbler是一個(gè)快速網(wǎng)絡(luò)安裝linux的服務(wù)诚啃,而且在經(jīng)過調(diào)整也可以支持網(wǎng)絡(luò)安裝windows淮摔。該工具使用python開發(fā),小巧輕便(才15k行python代碼)始赎,使用簡單的命令即可完成PXE網(wǎng)絡(luò)安裝環(huán)境的配置和橙,同時(shí)還可以管理DHCP、DNS造垛、TFTP魔招、RSYNC以及yum倉庫、構(gòu)造系統(tǒng)ISO鏡像五辽。
Cobbler支持命令行管理办斑,web界面管理,還提供了API接口奔脐,可以方便二次開發(fā)使用俄周。
Cobbler客戶端Koan支持虛擬機(jī)安裝和操作系統(tǒng)重新安裝,使重裝系統(tǒng)更便捷髓迎。
Cobbler各個(gè)組件之間關(guān)系
distro->profile-system(可選)
distro 發(fā)行版
面對(duì)不同的操作系統(tǒng)
面對(duì)同一個(gè)操作系統(tǒng)不同的版本
profile
核心特性是通過kickstart來部署
system
主要目的配置網(wǎng)絡(luò)接口
Cobbler功能
使用 Cobbler峦朗,您無需進(jìn)行人工干預(yù)即可安裝機(jī)器。Cobbler 設(shè)置一個(gè) PXE 引導(dǎo)環(huán)境(它還可使用 yaboot 支持 PowerPC)排龄,并控制與安裝相關(guān)的所有方面波势,比如網(wǎng)絡(luò)引導(dǎo)服務(wù)(DHCP 和 TFTP)與存儲(chǔ)庫鏡像。當(dāng)希望安裝一臺(tái)新機(jī)器時(shí)橄维,Cobbler 可以:
- 使用一個(gè)以前定義的模板來配置 DHCP 服務(wù)(如果啟用了管理 DHCP)
- 將一個(gè)存儲(chǔ)庫(yum 或 rsync)建立鏡像或解壓縮一個(gè)媒介尺铣,以注冊(cè)一個(gè)新操作系統(tǒng)
- 在 DHCP 配置文件中為需要安裝的機(jī)器創(chuàng)建一個(gè)條目,并使用您指定的參數(shù)(IP 和 MAC 地址)
- 在 TFTFP 服務(wù)目錄下創(chuàng)建適當(dāng)?shù)?PXE 文件
- 重新啟動(dòng) DHCP 服務(wù)以反映更改
- 重新啟動(dòng)機(jī)器以開始安裝(如果電源管理已啟用)
Cobbler版本支持
Cobbler 支持眾多的發(fā)行版:Red Hat争舞、Fedora凛忿、CentOS、Debian竞川、Ubuntu 和 SuSE店溢。當(dāng)添加一個(gè)操作系統(tǒng)(通常通過使用 ISO 文件)時(shí)叁熔,Cobbler 知道如何解壓縮合適的文件并調(diào)整網(wǎng)絡(luò)服務(wù),以正確引導(dǎo)機(jī)器床牧。
Cobbler和Kickstart
Cobbler 可使用 kickstart 模板荣回。基于 Red Hat 或 Fedora 的系統(tǒng)使用 kickstart 文件來自動(dòng)化安裝流程戈咳。通過使用模板心软,您就會(huì)擁有基本的 kickstart 模板,然后定義如何針對(duì)一種配置文件或機(jī)器配置而替換其中的變量著蛙。例如删铃,一個(gè)模板可能包含兩個(gè)變量 $domain和 $machine_name。在 Cobbler 配置中册踩,一個(gè)配置文件指定 domain=mydomain.com泳姐,并且每臺(tái)使用該配置文件的機(jī)器在machine_name 變量中指定其名稱。該配置文件中的所有機(jī)器都使用相同的 kickstart 安裝且針對(duì) domain=mydomain.com 進(jìn)行配置暂吉,但每臺(tái)機(jī)器擁有其自己的機(jī)器名稱。您仍然可以使用 kickstart 模板在不同的域中安裝其他機(jī)器并使用不同的機(jī)器名稱缎患。
Cobbler支持電源管理
為了協(xié)助管理系統(tǒng)慕的,Cobbler 可通過 fence scripts 連接到各種電源管理環(huán)境。
Cobbler 支持 apc_snmp挤渔、bladecenter肮街、bullpap、drac判导、ether_wake嫉父、ilo、integrity眼刃、ipmilan绕辖、ipmitool、lpar擂红、rsa仪际、virsh 和 wti。要重新安裝一臺(tái)機(jī)器昵骤,可運(yùn)行 reboot system foo命令树碱,而且 Cobbler 會(huì)使用必要的憑據(jù)和信息來為您運(yùn)行恰當(dāng)?shù)?fence scripts(比如機(jī)器插槽數(shù))。
Cobbler的其他特性
除了這些特性变秦,還可使用一個(gè)配置管理系統(tǒng) (CMS)成榜。您有兩種選擇:該工具內(nèi)的一個(gè)內(nèi)部系統(tǒng),或者集成一個(gè)現(xiàn)有的外部 CMS蹦玫,比如 Chef 或 Puppet赎婚。借助內(nèi)部系統(tǒng)刘绣,您可以指定文件模板,這些模板會(huì)依據(jù)配置參數(shù)進(jìn)行處理(與 kickstart 模板的處理方式一樣)惑淳,然后復(fù)制到您指定的位置额港。如果必須自動(dòng)將配置文件部署到特定機(jī)器,那么此功能很有用歧焦。
使用 koan 客戶端移斩,Cobbler 可從客戶端配置虛擬機(jī)并重新安裝系統(tǒng)。我不會(huì)討論配置管理和koan 特性绢馍,因?yàn)樗鼈儾粚儆诒疚牡慕榻B范疇向瓷。但是,它們是值得研究的有用特性
基礎(chǔ)實(shí)驗(yàn)環(huán)境準(zhǔn)備
[root@cobbler-node1 ~]# cat /etc/redhat-release #系統(tǒng)版本
CentOS Linux release 7.1.1503 (Core)
[root@cobbler-node1 ~]# uname –r#內(nèi)核版本
3.10.0-229.el7.x86_64
[root@cobbler-node1 ~]# getenforce #檢測(cè)selinux是否關(guān)閉(必須關(guān)閉)
Disabled
[root@cobbler-node1 ~]# systemctl stop firewalld #關(guān)閉防火墻
[root@cobbler-node1 ~]# ifconfig eth0|awk -F '[ :]+' 'NR==2 {print $3}'#查看IP地址
10.0.0.101
[root@cobbler-node1 ~]# hostname #查看主機(jī)名
cobbler-node1
[root@cobbler-node1 ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo#cobbler安裝必須使用到epel源
提示:
虛擬機(jī)網(wǎng)卡采用NAT模式舰涌,因?yàn)槲覀儠?huì)搭建DHCP服務(wù)器猖任,在同一局域網(wǎng)多個(gè)DHCP服務(wù)會(huì)有沖突,并且導(dǎo)致實(shí)踐失敗瓷耙。
安裝Cobbler
[root@cobbler-node1 ~]# yum install cobbler cobbler-web pykickstart httpd tftp dhcp xinetd
RPM包詳解:
cobbler:
cobbler程序包
cobbler-web:
cobbler的web服務(wù)包
pykickstart:
cobbler檢查kickstart語法錯(cuò)誤
httpd:
Apache web服務(wù)
tftp:
tftp服務(wù)
dhcp:
dhcp服務(wù)
Cobbler目錄詳解
/etc/cobbler # 配置文件目錄
/etc/cobbler/settings # cobbler主配置文件
/etc/cobbler/dhcp.template # DHCP服務(wù)的配置模板
/etc/cobbler/tftpd.template # tftp服務(wù)的配置模板
/etc/cobbler/rsync.template # rsync服務(wù)的配置模板
/etc/cobbler/iso # iso模板配置文件目錄
/etc/cobbler/pxe # pxe模板文件目錄
/etc/cobbler/power # 電源的配置文件目錄
/etc/cobbler/users.conf # Web服務(wù)授權(quán)配置文件
/etc/cobbler/users.digest # web訪問的用戶名密碼配置文件
/etc/cobbler/dnsmasq.template # DNS服務(wù)的配置模板
/etc/cobbler/modules.conf # Cobbler模塊配置文件
/var/lib/cobbler # Cobbler數(shù)據(jù)目錄
/var/lib/cobbler/config # 配置文件
/var/lib/cobbler/kickstarts # 默認(rèn)存放kickstart文件
/var/lib/cobbler/loaders # 存放的各種引導(dǎo)程序
/var/www/cobbler # 系統(tǒng)安裝鏡像目錄
/var/www/cobbler/ks_mirror # 導(dǎo)入的系統(tǒng)鏡像列表
/var/www/cobbler/images # 導(dǎo)入的系統(tǒng)鏡像啟動(dòng)文件
/var/www/cobbler/repo_mirror # yum源存儲(chǔ)目錄
/var/log/cobbler # 日志目錄
/var/log/cobbler/install.log # 客戶端系統(tǒng)安裝日志
/var/log/cobbler/cobbler.log # cobbler日志
/var/www/cobbler/repo_mirror # repo源存放路徑
檢測(cè)Cobbler
cobbler的運(yùn)行依賴于dhcp朱躺、tftp、rsync及dns服務(wù)搁痛,其中dhcp可由dhcpd(isc)提供长搀,也可由dnsmasq提供;tftp可由tftp-server程序包提供鸡典,也可由cobbler功能提供源请,rsync有rsync程序包提供,dns可由bind提供彻况,也可由dnsmasq提供谁尸。
cobbler可自行管理這些服務(wù)中的部分甚至是全部,但需要配置/etc/cobbler/settings文件中的“manange_dhcp”纽甘、“manager_tftpd”良蛮、“manager_rsync”、“manager_dns”分別來進(jìn)行定義贷腕。
另外背镇,由于各種服務(wù)都有著不同的實(shí)現(xiàn)方式,如若需要進(jìn)行自定義泽裳,需要通過修改/etc/cobbler/modules.conf配置文件中各服務(wù)的模塊參數(shù)的值來實(shí)現(xiàn)瞒斩。
[root@cobbler-node1 ~]# systemctl start httpd #啟動(dòng)apache服務(wù)
[root@cobbler-node1 ~]# systemctl start cobblerd #啟動(dòng)cobbler程序
## 檢查配置文件,需要在cobblerd和httpd啟動(dòng)的情況下檢查
[root@cobbler-node1 ~]# 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 features will not 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 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
5 : enable and start rsyncd.service with systemctl
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
8 : 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.
上述問的解決方法如下所示
1.修改/etc/cobbler/settings文件中的server參數(shù)的值為提供cobbler服務(wù)的主機(jī)相應(yīng)的IP地址或主機(jī)名涮总,如server: 10.0.0.101胸囱;
[root@cobbler-node1 ~]# sed -i 's/server: 127.0.0.1/server: 10.0.0.7/' /etc/cobbler/settings
2.修改/etc/cobbler/settings文件中的next_server參數(shù)的值為提供PXE服務(wù)的主機(jī)相應(yīng)的IP地址,如next_server: 10.0.0.101瀑梗;
[root@cobbler-node1 ~]# sed -i 's/next_server: 127.0.0.1/next_server: 10.0.0.7/' /etc/cobbler/settings
3.修改/etc/xinetd.d/tftp文件中的disable參數(shù)修改為disable = no
4.執(zhí)行cobbler get-loaders命令即可烹笔;否則裳扯,需要安裝syslinux程序包,而后復(fù)制/usr/share/syslinux/{pxelinux.0,memu.c32}等文件至/var/lib/cobbler/loaders/目錄中谤职;
5.執(zhí)行systemctl enable rsyncd命令即可饰豺;
6.如果有強(qiáng)迫癥可以選擇yum –y install debmirror然后根據(jù)錯(cuò)誤進(jìn)行解決,一般錯(cuò)誤如下。
## 注釋/etc/dedmirror.conf文件中的@dists=”sid”;@arches=”i386”;
7.[root@cobbler-node1 ~]# openssl passwd -1 -salt '$(openssl rand -hex 4)' 'EC' $1$$(openss$yWzTjLjGmjQJUbnsOQnx8/
[root@cobbler-node1 ~]# grep "default_password_crypted" /etc/cobbler/settings #替換/etc/cobbler/setting內(nèi)的default_password_crypted
default_password_crypted: "$1$$(openss$yWzTjLjGmjQJUbnsOQnx8/"
8.yum –y install cman fence-agents
systemctl restart cobblerd #最后重啟Cobbler
配置DHCP
[root@cobbler-node1 ~]# sed -i 's#manage_dhcp: 0#manage_dhcp: 1#g' /etc/cobbler/settings
#使用cobbler管理dhcp
[root@cobbler-node1 ~]# vim /etc/cobbler/dhcp.template
#修改cobbler的dhcp模版允蜈,因?yàn)閏obbler會(huì)替換冤吨。
subnet 10.0.0.0 netmask 255.255.255.0 {
option routers 10.0.0.2;
option domain-name-servers 10.0.0.2;
option subnet-mask 255.255.255.0;
range dynamic-bootp 10.0.0.200 10.0.0.250;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
同步Cobbler
[root@cobbler-node1 ~]# systemctl restart xinetd
#重啟xinetd
[root@cobbler-node1 ~]# systemctl restart cobblerd
#重啟cobbler
[root@cobbler-node1 ~]# cobbler sync
#同步最新cobbler配置,可以看具體做了哪些操作
task started: 2016-07-29_234117_sync
task started (id=Sync, time=Fri 29 10:34:21 2016)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout:
received on stderr:
running: service dhcpd restart
received on stdout:
received on stderr: Redirecting to /bin/systemctl restart dhcpd.service
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
管理Cobbler
管理distro
cobbler變得可用的第一步為定義distro饶套,其可以通過為其指定外部的安裝引導(dǎo)內(nèi)核及ramdisk文件的方式實(shí)現(xiàn)漩蟆。
如果已經(jīng)有完成的安裝樹(如os的安裝鏡像)則推薦使用improt之間導(dǎo)入的方式進(jìn)行。
[root@cobbler-node1 ~]# mount /dev/cdrom /mnt/#掛在ISO光盤至服務(wù)器
mount: /dev/sr0 is write-protected, mounting read-only
[root@cobbler-node1 ~]# cobbler import --path=/mnt/ --name=CentOS-7.1-x86_64-distro --arch=x86_64
# --path 鏡像路徑
# --name 為安裝源定義一個(gè)名字
# --arch 指定安裝源是32位妓蛮、64位怠李、ia64, 目前支持的選項(xiàng)有: x86│x86_64│ia64
# 安裝源的唯一標(biāo)示就是根據(jù)name參數(shù)來定義,本例導(dǎo)入成功后蛤克,安裝源的唯一標(biāo)示就是:CentOS-7.1-distro-x86_64捺癞。
# 鏡像存放目錄,cobbler會(huì)將鏡像中的所有安裝文件拷貝到本地一份构挤,放在/var/www/cobbler/ks_mirror下的CentOS-7.1-x86_64-distro-x86_64目錄下翘簇。因此/var/www/cobbler目錄必須具有足夠容納安裝文件的空間。
task started: 2016-07-30_010122_import
task started (id=Media import, time=Sat 30 11:05:02 2016)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64-distro-x86_64:
creating new distro: CentOS-7.1-distro-x86_64
trying symlink: /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64-distro-x86_64 -> /var/www/cobbler/links/CentOS-7.1-distro-x86_64
creating new profile: CentOS-7.1-distro-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64-distro-x86_64 for CentOS-7.1-distro-x86_64
processing repo at : /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64-distro-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64-distro-x86_64
looking for /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64-distro-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/CentOS-7.1-x86_64-distro-x86_64/repodata
*** TASK COMPLETE ***
[root@cobbler-node1 ~]# cobbler distro list #列出所有的distro
CentOS-7.1-distro-x86_64
[root@cobbler-node1 ~]# cobbler profile list #導(dǎo)入distro會(huì)自動(dòng)生成profile
CentOS-7.1-distro-x86_64
如果有kickstart文件儿倒,也可以使用--kickstart=/path/to/kickstart_file進(jìn)行導(dǎo)入,因此import會(huì)自動(dòng)為導(dǎo)入的distro生成一個(gè)profile
管理profile
cobbler使用profile來為特定的需求類別提供鎖需要安裝的配置呜笑,即在distro的基礎(chǔ)上通過提供kiskstart文件來生成一個(gè)特定的系統(tǒng)安裝配置夫否。distro的profile可以出現(xiàn)在pxe的引導(dǎo)菜單中作為安裝的選擇之一。
Cobbler-CentOS-7.1-x86_64.cfg
默認(rèn)是有kickstart文件的叫胁,所以edit凰慈,如果沒有kickstart文件可以add。
[root@cobbler-node1 ~]# cobbler profile edit --name=Centos7.1-distro-x86_64 --kickstart=/var/lib/cobbler/kickstarts/Cobbler-CentOS-7.1-x86_64.cfg
#指定ks路徑
#CentOS7系統(tǒng)網(wǎng)卡名變成eno...這種驼鹅,為了運(yùn)維標(biāo)準(zhǔn)化微谓,我們需要修改為我們常用的eth0,使用下面的參數(shù)输钩。但要注意是CentOS7才需要下面的步驟豺型,CentOS6不需要。
[root@cobbler-node1 ~]# cobbler profile edit --name=Centos7.1-distro-x86_64 --kopts='net.ifnames=0 biosdevname=0'
#修改centos7內(nèi)核
#新部署機(jī)器安裝yum源买乃,并同步姻氨。建議使用內(nèi)網(wǎng)yum源,在這里使用阿里云yum源
[root@cobbler-node1 ~]# cobbler repo add --name=centos-7-base --mirror=http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/ --arch=x86_64 --breed=yum
#添加yum源
[root@cobbler-node1 ~]# cobbler reposync
#同步y(tǒng)um源
[root@cobbler-node1 ~]# cobbler sync
#每次修改profile都需要同步
以上添加和同步Y(jié)um源剪验,就是在制作內(nèi)部Yum源肴焊,Cobbler會(huì)將你添加的源地址下載到本地 /var/www/cobbler/repo_mirror目錄下前联。下載完畢直接通過http訪問就可以了,和用互聯(lián)網(wǎng)源沒有什么區(qū)別娶眷。
部署操作系統(tǒng)
新建一臺(tái)虛擬機(jī)似嗤,通過網(wǎng)絡(luò)啟動(dòng)即可。(我這里虛擬機(jī)使用的是NAT模式,并且關(guān)閉DHCP功能)
用戶:root
密碼:ec123456
openssl生成時(shí)指定
開始部署:
安裝完畢:
查看版本:
定制化安裝
由于kickstart指定某臺(tái)服務(wù)器使用某個(gè)ks文件比較復(fù)雜届宠,所以引用Cobbler就很簡單烁落。通過物理MAC地址來區(qū)分。
自定義安裝
system主要目的配置網(wǎng)絡(luò)接口席揽,通過system來固定機(jī)器的IP顽馋、掩碼、網(wǎng)關(guān)幌羞、DNS寸谜、主機(jī)名、等等實(shí)現(xiàn)基礎(chǔ)環(huán)境標(biāo)準(zhǔn)化,根據(jù)機(jī)器的MAC地址属桦,自動(dòng)綁定IP熊痴,網(wǎng)關(guān),dns等.
開始安裝
[root@cobbler-node1 ~]#cobbler system add --name=EC-pc --mac=00:0C:29:6E:41:CB --profile=Centos7.1-profile-x86_64 \\\\
--ip-address=10.0.0.110 --subnet=255.255.255.0 --gateway=10.0.0.2 --interface=eth0 \\\\
--static=1 --hostname=EC.com --name-servers="114.114.114.114 8.8.8.8"
[root@cobbler-node1 ~]# cobbler sync
[root@linux-node1 ~]# cobbler system list
自定義登陸界面
企業(yè)聲明,可以通過這種方式
[root@cobbler-node1 ~]# grep "EC" /etc/cobbler/pxe/pxedefault.template MENU TITLE EC | http://EC.com
#自定義裝機(jī)頁面
[root@cobbler-node1 ~]# cobbler sync
#同步
web管理Cobbler
新版cobbler的web界面使用的是https聂宾,登錄https://10.0.0.7/cobbler_web
cobbler_web支持多種認(rèn)證方式果善,如authn_configfil、authn_ldap或authn_pam等系谐,默認(rèn)為authn_denyall,即拒絕所有用戶登陸巾陕。
用戶認(rèn)證
下面說明三種能認(rèn)證用戶登錄cobbler_web的方式
- 使用authn_pam模塊認(rèn)證cobbler_web用戶
首先修改modules中的[authentication]段中的module參數(shù)的值為authn_pam
接著創(chuàng)建系統(tǒng)用戶,并為用戶設(shè)定密碼
而后將設(shè)定的系統(tǒng)用戶添加至cobbler_web的admin組中纪他,修改/etc/cobbler/users.conf 文件鄙煤,將設(shè)定的用戶添加為admin參數(shù)的值即可 - 使用authn_configfile模塊認(rèn)證cobbler_web用戶
首先修改modules中的[authentication]段中的module參數(shù)的值為authn_configfile
添加第一用戶時(shí),需要為htdigest命令使用“-c”etc/cobbler/users.digest茶袒,后續(xù)添加其他用戶則不能再使用梯刚,同步cobbler重啟httpd以及cobbler - 使用cobbler默認(rèn)的web賬號(hào)密碼認(rèn)證
user:cobbler
pass:cobbler
END.
OK今天就為大家介紹這么多了。
我是EC君薪寓,如果你喜歡我的文章亡资,請(qǐng)幫忙點(diǎn)個(gè)關(guān)注!點(diǎn)個(gè)喜歡吧向叉!
也可以點(diǎn)擊作者信息锥腻,掃描微信二維碼關(guān)注我的個(gè)人微信公眾號(hào)。
你的鼓勵(lì)將是我們共同進(jìn)步的源泉植康。