[authentication]
module = authn_configfile
[authorization]
module = authz_allowall
[dns]
module = manage_bind
[dhcp]
module = manage_isc #如果是dnsmasq就应该为manage_dnsmasq
[tftpd]
module = manage_in_tftpd 5、修改/etc/cobbler/dhcp.template
[root@localhost cobbler]# cat /etc/cobbler/dhcp.template |grep '^[^#]'
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.11.0 netmask 255.255.255.0 {
option routers 192.168.11.252;
option domain-name-servers 192.168.11.252;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.11.100 192.168.11.200;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if option pxe-system-type = 00:02 {
filename "ia64/elilo.efi";
} else if option pxe-system-type = 00:06 {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
}
}
## group could be subnet if your dhcp tags line up with your subnets
## or really any valid dhcpd.conf construct ... if you only use the
## default dhcp tag in cobbler, the group block can be deleted for a
## flat configuration
group {
#for mac in $dhcp_tags[$dhcp_tag].keys():
#set iface = $dhcp_tags[$dhcp_tag][$mac]
host $iface.name {
hardware ethernet $mac;
#if $iface.ip_address:
fixed-address $iface.ip_address;
#end if
#if $iface.hostname:
option host-name "$iface.hostname";
#end if
#if $iface.netmask:
option subnet-mask $iface.netmask;
#end if
#if $iface.gateway:
option routers $iface.gateway;
#end if
#if $iface.enable_gpxe:
if exists user-class and option user-class = "gPXE" {
filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
} else if exists user-class and option user-class = "iPXE" {
filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
} else {
filename "undionly.kpxe";
}
#else
filename "$iface.filename";
#end if
## Cobbler defaults to $next_server, but some users
## may like to use $iface.system.server for proxied setups
next-server $next_server;
## next-server $iface.next_server;
}
#end for
} 6、重启cobbler httpd服务
[root@cobbler-server ~]# systemctl restart cobblerd
[root@cobbler-server ~]# systemctl restart httpd
四、检查cobbler配置
[root@cobbler-server ~]# cobbler check
The following are potential configuration items that you may want to fix:
1 : debmirror package is not installed, it will be required to manage debian deployments and repositories
2 : 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
Restart cobblerd and then run 'cobbler sync' to apply changes.
以上两点都可以忽略
第二点是修改部署系统默认的root密码
若提示enabled rsyncd or use systemctl to start rsyncd.service
是叫你把rsync加到开机启动
[root@cobbler-server ~]# systemctl enable rsyncd
执行以上命令后就不会出现这个提示了 五、导入镜像并查看导入情况 1、导入镜像
[root@cobbler-server ~]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
[root@cobbler-server ~]#cobbler import --path=/mnt/cdrom/ --name=ubuntu-12.04.5 --arch=x86_64
task started: 2016-10-07_221950_import
task started (id=Media import, time=Fri Oct 7 22:19:50 2016)
Found a candidate signature: breed=freebsd, version=10.1
Found a candidate signature: breed=freebsd, version=10.0
Found a candidate signature: breed=freebsd, version=8.3
Found a candidate signature: breed=freebsd, version=8.2
Found a candidate signature: breed=freebsd, version=8.4
Found a candidate signature: breed=freebsd, version=10.2
Found a candidate signature: breed=freebsd, version=9.0
Found a candidate signature: breed=freebsd, version=9.1
Found a candidate signature: breed=freebsd, version=9.2
Found a candidate signature: breed=freebsd, version=9.3
Found a candidate signature: breed=ubuntu, version=precise
running: /usr/bin/file /var/www/cobbler/ks_mirror/ubuntu-12.04.5-x86_64/dists/precise/Release
received on stdout: /var/www/cobbler/ks_mirror/ubuntu-12.04.5-x86_64/dists/precise/Release: ASCII text
received on stderr:
Found a matching signature: breed=ubuntu, version=precise
Adding distros from path /var/www/cobbler/ks_mirror/ubuntu-12.04.5-x86_64:
creating new distro: ubuntu-12.04.5-x86_64
trying symlink: /var/www/cobbler/ks_mirror/ubuntu-12.04.5-x86_64 -> /var/www/cobbler/links/ubuntu-12.04.5-x86_64
creating new profile: ubuntu-12.04.5-x86_64
associating repos
checking for apt repo(s)
adding apt repo for ubuntu-12.04.5-x86_64
Added repos for ubuntu-12.04.5-x86_64
*** TASK COMPLETE ***
有些镜像是不支持的,不支持就会导入错误 2、查看
查看导入的镜像和使用到的kickstart文件信息
[root@cobbler-server ~]# cobbler distro list
CentOS-7.2-x86_64
ESXi-6.0.0-x86_64
ubuntu-12.04.5-x86_64
[root@cobbler-server ~]# cobbler profile report
Name : ESXi-6.0.0-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : ESXi-6.0.0-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_esxi5.ks
Kickstart Metadata : {}
Management Classes : []
Management Parameters : <<inherit>>
Name Servers : []
Name Servers Search Path : []
Owners : ['admin']
Parent Profile :
Internal proxy :
Red Hat Management Key : <<inherit>>
Red Hat Management Server : <<inherit>>
Repos : []
Server Override : <<inherit>>
Template Files : {}
Virt Auto Boot : 1
Virt Bridge : xenbr0
Virt CPUs : 1
Virt Disk Driver Type : raw
Virt File Size(GB) : 5
Virt Path :
Virt RAM (MB) : 512
Virt Type : kvm
Name : CentOS-7.2-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : CentOS-7.2-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.ks
Kickstart Metadata : {}
Management Classes : []
Management Parameters : <<inherit>>
Name Servers : []
Name Servers Search Path : []
Owners : ['admin']
Parent Profile :
Internal proxy :
Red Hat Management Key : <<inherit>>
Red Hat Management Server : <<inherit>>
Repos : []
Server Override : <<inherit>>
Template Files : {}
Virt Auto Boot : 1
Virt Bridge : xenbr0
Virt CPUs : 1
Virt Disk Driver Type : raw
Virt File Size(GB) : 5
Virt Path :
Virt RAM (MB) : 512
Virt Type : kvm