1
PPTVKenZhuspookyzn@gmail.com10/9 2012AgendaPPTVCobbler Cobbler Cobbler Quick-StartCobbler ks fileCobbler Tipsispkickstart serverkickstart serverCobbler kickstartGit Django RsyncdCobblerapache, pythonControlTie
BGPCobbler Mastercobblercobbler serverCobbler SecondaryCobblerControlTie
Cobbler kickstart serverGit Repository Git gitDjangocobbler API, NginxGit repository & Django applicationRsyncPythoncobblerpythonApachecobbler
CobblerCobbler Cobbler modelsCobbler KSGit Django Cobbler CobblerControlTieCobblerkickstart, linuxkickstart template, ksmeta, snippetsKoandhcp, tftp, dnslinuxRHEL, Debian, Suse, Ubuntu, Fedora etc.Cobbler Models
Cobbler ModelsDistro kernel, initrdProfile KS filetemplateSystem hostname, ipCobbler KSKS file snippetcobbler modelsks fileCheetah;python
Git cobbler serverkickstart files, snippets Cobbler Mastergit repositoryCobblergit clonekickstarts, snippets, triggers CrontabMastergit pullGit&
Git clonekickstart, snippets, triggersgit repository
...test -x /var/lib/cobbler && cd /var/lib/cobbler/ || {echo -ne "cobbler directory doesn't exist! \n"exit 0}rm -rf kickstartsrm -rf snippetsrm -rf triggersgit clone http:///cobbler-git/kickstarts.gitgit clone http:///cobbler-git/snippets.gitgit clone http:///cobbler-git/triggers.git...git pullgit repository
echo -ne "Kickstarts sync "cd $CB_DATA_PATH/kickstartsgit pull && echo -ne "[OK]\n" || echo -ne "[FAILED]\n"
echo -ne "Snippets sync "cd $CB_DATA_PATH/snippetsgit pull && echo -ne "[OK]\n" || echo -ne "[FAILED]\n"
echo -ne "Triggers sync "cd $CB_DATA_PATH/triggersgit pull && echo -ne "[OK]\n" || echo -ne "[FAILED]\n"Django cobblercobblerprofilecobbler serverdistrodjangocobbler apinginxdjango httpCrontab
Profile...from cobbler.api import BootAPI#cobbler api
#distroprofiledef profile_list(request, distro): cb_api = BootAPI() profiles = cb_api.find_profile(return_list=True, distro=distro) data = [] for profile in profiles: profile_url = "%s/%s.json" % (settings.PROFILES_URL, profile.name) data.append(profile_url) return HttpResponse("|".join(data), 'text/html')......DISTROS=$(cobbler distro list) #cobblerdistro
for distro in $DISTROSdo PROFILES=$(curl http:///profile_list/$distro/ 2>/dev/null | tr \| )#Profile for profile in $PROFILES do echo -ne "Download $profile \t\t" wget -q $profile && echo -ne "[OK]\n" || echo -ne "[FAILED]\n" donedone...Cobbler Cobbler ControlTie Task Cobbler Cobbler Cobbler Cobbler cobblerCobblerApache2.2.21 wsgi_modulePython2.7Cheetah, yaml, pykickstart python
CT - Cobbler iptables, selinux, yumyumrpm cobblerCT Cobbler #install required rpmsyum install createrepo dhcp curl-devel tftp-server yum-utils mkisofs git -y
#fetch cobbler packagecd /tmpwget http:///packages/cobbler_proxy-2.2.0.tar.bz2 --output-document=cobbler_proxy-2.2.0.tar.bz2
#cobbler installationcd /home/toolstar jxvf /tmp/cobbler_proxy-2.2.0.tar.bz2cd /home/tools/package; rpm -ihv *.rpmcd /home/tools/cobbler-2.2.0; make; make install;grep "tools" /etc/ld.so.conf || sed -i 'a/\/home\/tools\/python\/lib/' /etc/ld.so.conf && echo -ne ""CT Cobblercobbler Cobbler server next_serverdhcp ;ControlTie
CT Cobbler...COBBLER_SETTING=/etc/cobbler/settingsDHCP_SETTING=/etc/cobbler/dhcp.template
#Cobbler settingssed -i '/^server:/ cserver: ${option.server_ip}' $COBBLER_SETTINGsed -i '/^next_server:/ cnext_server: ${option.server_ip}' $COBBLER_SETTING
#DHCP settingssed -i '/^subnet.*/ csubnet ${option.netid} netmask ${option.netmask} {' $DHCP_SETTINGsed -i '/option domain-name-servers/ coption domain-name-servers 8.8.8.8;' $DHCP_SETTINGsed -i '/option subnet-mask/ coption subnet-mask ${option.netmask};' $DHCP_SETTINGsed -i '/range dynamic-bootp/ crange dynamic-bootp ${option.pool_range};' $DHCP_SETTINGsed -i '/option routers/ coption routers ${option.gateway};' $DHCP_SETTING...
CT ISPCT if [ ${option.isp} = "C1" ]then case ${option.release} in "5.4") echo -ne "sync 5.4 from T1 \n" cobbler import --path=rsync:///RHEL5.4 --name=RHEL_Server_5.4_PPLive --arch=x86_64 ;; "5.8") echo -ne "sync 5.8 from T1 \n" cobbler import --path=rsync:///RHEL5.8 --name=RHEL_Server_5.8_PPLive --arch=x86_64 ;; esacCobbler Quick-StartCobbler ks fileYUM configuration snippetCobbler tipsMachine without OSAccess idrac interface with web browser J2EE installedStart remote consoleReboot or startup machine via idracPress F12 to enter PXE mode when machine bootingChoose 1 profile you want to apply on this machine in cobbler menuStarting unattended installationConfigure network interface on the machine when installation finishedCobbler Menu
Machine with OSUse koan to reinstallyum install koan y
Create a new system on cobbler servercobbler system add --name=JA03469D1201 --profile=cob_5.4_base --ip-address= --gateway= --static=true --subnet=255.255.0.0
Execute koan on this machine to replace itself koan --server= --system=JA03469D1201 --replace-selfXen Virtual-machine installationCobbler server:
cmdbIPcobbler serversystemJA03469D1201D1JA03469D1201-1cobbler system name
cobbler serversystemcobbler system add --name=JA03469D1201-1 --profile=vs_5.4 --ip-address= --gateway= --static=true subnet =255.255.255.0
koanYum install koan y
Xen Virtual-machine installationkoan --server= --virt --system=JA03469D1201-1 --virt-name=D1 --virt-path=/dev/sdb --virt-bridge=xenbr0 -=nogfx
server: cobbler servervirt-system: system name you appended beforevirt-name: xen virtual server namevirt-path: disk device virt-bridge: network bridge
ks file RHEL5.4 KS file - distro:RHEL5.4 profile:vs_5.4#[SNIPPET] yum_configuration$SNIPPET('pptv/yum_configuration')
RHEL5.8 KS file - distro:RHEL5.8 profile:vs_5.8#[SNIPPET] yum_configuration$SNIPPET('pptv/yum_configuration')
Snippet/yum_confiuration#set distro=$getVar(distro_name,)distrodistroname
#if 5.4 in $distrodistro5.4##Start of YUM Configuration##End of YUM Configurationcat > /etc/yum.repos.d/PPLive.repo /etc/yum.repos.d/PPLive.repo /etc/yum.repos.d/PPLive.repo