#!/bin/sh#coding=utf8################################################################### Modify the IP address of your cobbler server as follows to ip=192.168.63.182# the net net=192.168.63.0 #修改成dhcp计划分配的IP段begin of your cobbler segment as follows: 192.168.63.250end=192.168.63.253echo "$ip www.xiaoluo.com" >>/etc/hostsyum install cobbler Cobbler-web pykickst Art DHCP debmirror syslinux cman fence-agents vim-y/etc/init.d/iptables stop/etc/init.d/httpd start/etc/init.d/ Cobblerd StartService cobblerd restartsed-i-E ' s/= yes/= no/g '/etc/xinetd.d/rsyncsed-i-e ' s/= yes/= no/g '/etc/xinetd . D/tftpsed-i ' [email protected]_server: [email protected]_server: ' $ip ' @g '/etc/cobbler/settingssed-i ' [ Email protected]: [email protected]: ' $ip ' @g '/etc/cobbler/settingscp/usr/share/syslinux/pxelinux.0/var /lib/cobbler/loaders/cp/usr/share/syslinux/meminfo.c32/var/lib/cobbler/loaders/sed-i ' [email protected]=] I386 "$# @arches =" i386 "$g '/etc/debmirror.confsed-i ' [email protected]=" Sid "$# @dists =" Sid "$g '/ETc/debmirror.confsed-i ' [email protected][email protected]#[email protected] '/etc/cobbler/ Settingsecho "default_password_crypted:" $1$ac756ac7$erf27ljjp3rditlvqhlog/"" >>/etc/cobbler/ Settingscobbler get-loadersservice cobblerd restartcobbler sync### #用cobbler Check to see what steps have not been completed. Cobbler Check#dhcp cat >/etc/dhcp/dhcpd.conf <<eofoption domain-name "xiaoluo.com"; option Domain-name-servers $ip;d efault-lease-time 43200;max-lease-time 86400;log-facility local7;subnet $net netmask 255.255.255.0 {range $begin $end; option routers $ip;} Next-server $ip; filename= "pxelinux.0"; EOF/ETC/INIT.D/DHCPD restartservice xinetd restartservice cobblerd restartmkdir/opt/xiaoluomount/dev/cdrom/opt/ Xiaoluo Cobbler Import--name=centos-6.5-x86_64--path=/opt/xiaoluo
Reprint: https://github.com/roncoo/roncoo-cmdb/blob/master/devops/install/cobbler.sh
Cobbler Automatic Installation Script