• Like
  • Save
CodeFest 2013. Mosesohn M. — Automating environments with Cobbler
Upcoming SlideShare
Loading in...5

CodeFest 2013. Mosesohn M. — Automating environments with Cobbler






Total Views
Views on SlideShare
Embed Views



2 Embeds 107

http://2013.codefest.ru 106
http://www.grusha.prod 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    CodeFest 2013. Mosesohn M. — Automating environments with Cobbler CodeFest 2013. Mosesohn M. — Automating environments with Cobbler Presentation Transcript

    • Cobbler forDevelopersMatthew Mosesohn Mirantis IT
    • Developers? Uniformity?
    • Why Cobbler?Simple system to automate installation andpreparation of systems.Reduces the amount of time needed to beginan installation.Provides a flexible, intuitive means to managea large number of systems to meet your needs.
    • Why Cobbler?● Simple web UI and command line● Robust template interface via Cheetah● Built to save time● Open source● Mature
    • Cobbler historyDeveloped by DevOps engineer MichaelDeHaan (former Red Hat employee)Primary goal to simplify installationSoftware environments require frequentreinstallations
    • Manual network kickstart method● Set up DHCP server to point to TFTP server● Configure TFTP with pxelinux.0 and installation tree● Either handwrite MAC addresses for each host or present a menu and manually choose● No scaleability● No templating● No reporting
    • When do you need Cobbler?Scenarios:● Complex software with many components● Testing clustering software● Testing software suites with no reset option available● Continuous integration (CI) testing● Isolated network environment● Rapidly changing hardware
    • When Cobbler is not appropriateScenarios:● Simple application development● Legacy system development● Where automation is not possible● Windows
    • Continuous IntegrationOverview:● High pace development style● Automated deployment● Integrate and test software● Test every commit● Similar to production environment
    • Continuous IntegrationAdvantages:● Saves time and money● Enables sophisticated QA● Early warning of bugs● Communication● Develops metrics for analysis
    • Continuous IntegrationDisadvantages:● Setup time investment● Full automation development
    • CI example: JenkinsJenkins is a fork from HudsonJava basedSupports many SCM formats, including:● git● subversion● mercurial● cvsAutomate testing based on SCM changes orregular schedule
    • Typical Uses● DNS/DHCP management of a company infrastructure● Automation of installation of servers via PXE● Power cycling of systems via ipmitool● Local package repository mirror● Simplified, standard installation process
    • What you should know already● How to build virtual machines● How to configure a DHCP server ○ hostnames ○ MAC addresses ○ gateway● Where to find installation media for your system (DVD and/or package repositories)
    • ConsiderationsScale:● How many sites● Concurrent installations● Number of systemsComplexity:● Linux distros● System builds● Localization● Post-installation scripts
    • Simple case: single node with virt Internet:● Create a private OS files package virtual network repositories● Two VMs● VM 1 is CentOS VM 1 Linux host● VM 2 is Ubuntu Cobbler server VM 2 System OS files configurati packages on
    • Common use case: Development lab Internet: OS files package repositories Development Lab System1 System2 Cobbler server System3 System4 System5 System6 OS files System packages configuration
    • Unattended install script
    • Create kickstart file● Set up install method● Configure disks● Configure language/keyboard/time● Configure default package set● Specify scripts in %post for automation
    • Example kickstart for installationinstallrebootlang en_USnetwork --bootproto=dhcpkeyboard usclearpart --allpart / --size 500 --growpart swap --recommended#set timezonetimezone --utc US/Eastern
    • Example kickstart for installation#set root passwordrootpw changeme#rootpw --iscrypted $1$Rig3dbXb$OWcv00J/V2WsBGcgx0bmp1%packages@baseopenssh-serveropenssh-client%post#Your script here
    • Debian/Ubuntu preseed file#Langd-i debian-installer/locale string en_GB.UTF-8d-i console-setup/ask_detect boolean falsed-i keyboard-configuration/layoutcode string us#Netd-i netcfg/enable boolean trued-i netcfg/get_hostname string system01d-i netcfg/get_domain string example.com
    • Debian/Ubuntu preseed file### Mirror settingsd-i mirror/country string russiad-i mirror/http/hostname string archive.ubuntu.comd-i mirror/http/directory string /ubuntud-i mirror/suite string precised-i clock-setup/utc boolean trued-i time/zone string US/Eastern
    • Debian/Ubuntu preseed file## Account setupd-i passwd/root-password-crypted password [MD5 hash]d-i passwd/user-fullname string Ubuntu Userd-i passwd/username string ubuntud-i passwd/user-password-crypted password [MD5 hash]### Apt setupd-i apt-setup/restricted boolean trued-i apt-setup/universe boolean trued-i apt-setup/backports boolean truetasksel tasksel/first multiselect lamp-server, print-server
    • Debian/Ubuntu (contd)d-i preseed/early_command string your_pre_installation_scriptd-i preseed/late_command string your_post_installation_script
    • Preinstallation script● Useful for a disclaimer, warning, or safety message.● Disk configuration manual steps
    • Postinstallation script● Custom downloaded files/settings/scripts● Enable configuration management● Set up SSH keys● Custom authentication if not possible through preseed/kickstart
    • Cobbler kickstart extra features● You can store snippets and call them in multiple kickstarts● You can use Cheetah template code directly in a kickstart (just prepend with #). Syntax similar to PythonExamples:%post$SNIPPET(ntp_register)%packages#set $hostname = $getVar($hostname, None)#if test in $hostname or devel in $hostname@development#end if
    • Working with variablescobbler system dumpvars --name=systemBuilt-in variables:● $mac_address● $ip_address● $hostname● $distro● $profile● $server
    • Flexibility with variables● Set custom variables in ksmeta section.● Profile variables override distro variables.● System variables override profile variables.● Use getVar(var-name,default-value) in cases where an empty string would break your installation ○ RH: rootpw $getVar(rootpw,changeme) ○ Deb: d-i passwd/root-password-crypted password $getVar (rootmd5,$1$Rig3dbXb$OWcv00J/V2WsBGcgx0bmp1)
    • Adding systems to Cobbler
    • Add your distro● Download base OS media● mount -oloop /mnt/iso /path/to/os.iso● cobbler import --path /mnt/iso -- name=distro_name
    • Adding profiles to Cobbler● Log into Cobbler Web● Add new profile with your distro and kickstart
    • Remote install options● Manual entry of systems ○ Requires MAC address● PXE menu ○ Requires manual interaction on boot● koan/virt-install ○ Create a virtual machine or reinstall existing system and specify Cobbler server and profile to use
    • Koan examplesReinstall a host:● koan --server=cobbler.example.org -- replace-self --profile=nameCreate a new virtual machine:● koan --server=cobbler.example.org --virt -- system=name
    • Further automation Puppet Squid proxy Jenkins Continuous integration
    • Known limitationsUbuntu installation works, but there are someissues with virt-install for Ubuntu guestsScaling and redundancy
    • Summary● Cobbler allows you to automate installations● Cobbler fits into CI testing● Cobbler saves time● Cobbler is extendable via Cheetah template engine
    • Thank you!Questions?
    • Additional readinghttps://www.redhat.com/about/news/archive/2008/4/provisioning-our-new-middleware-architecturehttps://github.com/cobbler