SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
.




                                      Voice · Data · Managed Services
Speakeasy Inc. – A Best Buy Company
Provisioning machines with
Cobbler

         Garrett Honeycutt
         Presented at GSLUG
         September 13th 2008
What is Cobbler?

Cobbler is an integrated solution for provisioning OS's on
Linux systems
 RedHat (Fedora, RHEL) focused
 Works with SuSE and even Debian to a limited degree
 Can be used to install images (windows, firmware, etc)
Can manage DHCP, TFTP, and now DNS
Multiple interfaces
 CLI
 Web GUI
 XMLRPC
 Python API
Why?

Scalability
 Using a CD is time consuming
 Popping a CD into a machine into a machine to which you do not
 have physical access is problematic
Repeatability
 Consistently build identical machines
Get your own software repository running
Avoid describing the same thing in multiple places
 Sure you could do this yourself by manually editing entries in the
 /tftpboot tree and dhcpd.conf – but that way lies madness
Installation

Use EPEL
 http://fedoraproject.org/wiki/EPEL
Source RPM's
 http://people.fedoraproject.org/~mdehaan/files/cobbler/
check out the source with GIT
 # git clone git://git.fedorahosted.org/cobbler
Hierarchy

Distros

 Profiles

   Systems
Hierarchy with options

Distros
 kernel & initrd locations
 architecture (i386, x86_64, ia64)
 breed (RedHat based, Debian, SuSE)
Profiles
 kickstart file location
 kickstart metadata – variables you can pass to kickstart
 all of the above
Systems
 hostname
 IP info
 MAC
 all of the above
Repo's

Mirror an existing repo
 # cobbler repo add --
 mirror=http://mirrors.kernel.org/fedora/core/updates/6/i386/ --
 name=fc6i386updates
 # cobbler reposync
We will use this in our kickstart later
Importing Distros

ISO
 # mount -o loop rhel5.iso /mnt
 # cobbler import –mirror=/mnt –name=rhel5
From DVD
 # cobbler import --mirror=/media/dvd –name=rhel5
rsync from a mirror
 # cobbler import --mirror=rsync://foo.org/path –name=rhel5
NFS – Does not mirror content
 # cobbler import --mirror=/path/nfsmount --name=filer --available-
 as=nfs://nfs.foo.org:/path
Profiles

kernel options
 serial console=ttyS1,9600
kickstart metadata – variables you can use in your
kickstart
 uses Cheetah - a python powered template engine
 ksmeta=eth_device='eth0' rhel_key='c0ffee'
 rhn_passwd='passwd' rhn_user='spkfoo'
Kickstart config

Easy way to get a working kickstart config
 install by hand and check out /root/anaconda-ks.cfg

Show an example...
Systems

Hostname
MAC
IP Info
Yum repo
 Probably a bad idea – use profiles for this
system specific kernel options and kickstart metadata
 Probably a bad idea – use profiles for this
Triggers

  add, delete, install, sync
  pre/post for each
  Can use the Cobbler API or any executable
  script/program
  Simple example:

/var/lib/cobbler/triggers/add/system/post/test.sh

#!/bin/bash
echo "Hi, my name is $1 and I'm a newly added system"
Example Trigger using API
#!/usr/bin/python
import os
import sys
from cobbler import api
cobbler_api = api.BootAPI()
# this is the systemname, not the hostname, so be sure to use the FQDN in the systemname
machine = sys.argv[1]
# location of getcert.sh script
getcert_cmd = "/usr/local/sbin/getcert.sh"
# set return code to 0 by default
rc = 0
# build the command string
cmd = getcert_cmd + " " + machine
# log to cobbler's logs
cobbler_api.log("running - " + cmd)
# run the command and set the return code
rc = os.system(cmd)
# exit with return code
sys.exit(rc)
/etc/cobbler

dhcp.template
settings

Show examples...
Logging

Syslog server built in
 25150/udp
 /var/log/cobbler/syslog/<hostname>
other places to look
 /var/log/cobbler/cobbler.log
 /var/log/cobbler/install.log
 http access logs
demo time

WebUI
CLI
/tftpboot/pxelinux.cfg
/etc/dhcpd.conf
/etc/cobbler
Thanks!

https://fedorahosted.org/cobbler - Official site - sourced
throughout presentation
GSLUG - http://gslug.org - Providing a forum to learn and
share ideas about Linux

Más contenido relacionado

Destacado

Cobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioningCobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioningRUDDER
 
Automated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStack
Automated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStackAutomated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStack
Automated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStackNTT Communications Technology Development
 
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMasterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMalcolm Duncanson, CISSP
 
The art of infrastructure elasticity
The art of infrastructure elasticityThe art of infrastructure elasticity
The art of infrastructure elasticityHarish Ganesan
 
Auto scaling using Amazon Web Services ( AWS )
Auto scaling using Amazon Web Services ( AWS )Auto scaling using Amazon Web Services ( AWS )
Auto scaling using Amazon Web Services ( AWS )Harish Ganesan
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSBamdad Dashtban
 
Cloud computing simple ppt
Cloud computing simple pptCloud computing simple ppt
Cloud computing simple pptAgarwaljay
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 

Destacado (11)

PXE Lot or PXE Lite
PXE Lot or PXE LitePXE Lot or PXE Lite
PXE Lot or PXE Lite
 
Cobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioningCobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioning
 
Automated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStack
Automated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStackAutomated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStack
Automated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStack
 
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMasterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM Roles
 
The art of infrastructure elasticity
The art of infrastructure elasticityThe art of infrastructure elasticity
The art of infrastructure elasticity
 
Auto scaling using Amazon Web Services ( AWS )
Auto scaling using Amazon Web Services ( AWS )Auto scaling using Amazon Web Services ( AWS )
Auto scaling using Amazon Web Services ( AWS )
 
A Puppet Story
A Puppet StoryA Puppet Story
A Puppet Story
 
AWS + Puppet = Dynamic Scale
AWS + Puppet = Dynamic ScaleAWS + Puppet = Dynamic Scale
AWS + Puppet = Dynamic Scale
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
 
Cloud computing simple ppt
Cloud computing simple pptCloud computing simple ppt
Cloud computing simple ppt
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 

Más de garrett honeycutt

Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...garrett honeycutt
 
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...garrett honeycutt
 
(2016-06-11) Packer: Make Multi-Platform Images
(2016-06-11) Packer: Make Multi-Platform Images(2016-06-11) Packer: Make Multi-Platform Images
(2016-06-11) Packer: Make Multi-Platform Imagesgarrett honeycutt
 
20150613 self-puppet v4-avoiding_dragons
20150613 self-puppet v4-avoiding_dragons20150613 self-puppet v4-avoiding_dragons
20150613 self-puppet v4-avoiding_dragonsgarrett honeycutt
 
20150314 - Functional Testing for Configuration Management @ Cascadia IT Con...
20150314  - Functional Testing for Configuration Management @ Cascadia IT Con...20150314  - Functional Testing for Configuration Management @ Cascadia IT Con...
20150314 - Functional Testing for Configuration Management @ Cascadia IT Con...garrett honeycutt
 
2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14
2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA142014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14
2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14garrett honeycutt
 
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattlegarrett honeycutt
 
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicagogarrett honeycutt
 
20140406 loa days-tdd-with_puppet_tutorial
20140406 loa days-tdd-with_puppet_tutorial20140406 loa days-tdd-with_puppet_tutorial
20140406 loa days-tdd-with_puppet_tutorialgarrett honeycutt
 
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07garrett honeycutt
 
20130407 load puppevtv3-and_hiera
20130407 load puppevtv3-and_hiera20130407 load puppevtv3-and_hiera
20130407 load puppevtv3-and_hieragarrett honeycutt
 
20120331 - Expanded Intro to Puppet for LOAD
20120331 - Expanded Intro to Puppet for LOAD20120331 - Expanded Intro to Puppet for LOAD
20120331 - Expanded Intro to Puppet for LOADgarrett honeycutt
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...garrett honeycutt
 
20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_self20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_selfgarrett honeycutt
 
20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnwgarrett honeycutt
 
Fighting Spam With A Perimeter Mail System 20071108 Sasag
Fighting Spam With A Perimeter Mail System 20071108 SasagFighting Spam With A Perimeter Mail System 20071108 Sasag
Fighting Spam With A Perimeter Mail System 20071108 Sasaggarrett honeycutt
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasaggarrett honeycutt
 

Más de garrett honeycutt (18)

20180823 - Sensu + Puppet
20180823 - Sensu + Puppet20180823 - Sensu + Puppet
20180823 - Sensu + Puppet
 
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
 
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
 
(2016-06-11) Packer: Make Multi-Platform Images
(2016-06-11) Packer: Make Multi-Platform Images(2016-06-11) Packer: Make Multi-Platform Images
(2016-06-11) Packer: Make Multi-Platform Images
 
20150613 self-puppet v4-avoiding_dragons
20150613 self-puppet v4-avoiding_dragons20150613 self-puppet v4-avoiding_dragons
20150613 self-puppet v4-avoiding_dragons
 
20150314 - Functional Testing for Configuration Management @ Cascadia IT Con...
20150314  - Functional Testing for Configuration Management @ Cascadia IT Con...20150314  - Functional Testing for Configuration Management @ Cascadia IT Con...
20150314 - Functional Testing for Configuration Management @ Cascadia IT Con...
 
2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14
2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA142014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14
2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14
 
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
 
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago
 
20140406 loa days-tdd-with_puppet_tutorial
20140406 loa days-tdd-with_puppet_tutorial20140406 loa days-tdd-with_puppet_tutorial
20140406 loa days-tdd-with_puppet_tutorial
 
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
 
20130407 load puppevtv3-and_hiera
20130407 load puppevtv3-and_hiera20130407 load puppevtv3-and_hiera
20130407 load puppevtv3-and_hiera
 
20120331 - Expanded Intro to Puppet for LOAD
20120331 - Expanded Intro to Puppet for LOAD20120331 - Expanded Intro to Puppet for LOAD
20120331 - Expanded Intro to Puppet for LOAD
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
 
20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_self20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_self
 
20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw
 
Fighting Spam With A Perimeter Mail System 20071108 Sasag
Fighting Spam With A Perimeter Mail System 20071108 SasagFighting Spam With A Perimeter Mail System 20071108 Sasag
Fighting Spam With A Perimeter Mail System 20071108 Sasag
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 

Provisioning Machines With Cobbler Gslug 20080913

  • 1. . Voice · Data · Managed Services Speakeasy Inc. – A Best Buy Company
  • 2. Provisioning machines with Cobbler Garrett Honeycutt Presented at GSLUG September 13th 2008
  • 3. What is Cobbler? Cobbler is an integrated solution for provisioning OS's on Linux systems RedHat (Fedora, RHEL) focused Works with SuSE and even Debian to a limited degree Can be used to install images (windows, firmware, etc) Can manage DHCP, TFTP, and now DNS Multiple interfaces CLI Web GUI XMLRPC Python API
  • 4. Why? Scalability Using a CD is time consuming Popping a CD into a machine into a machine to which you do not have physical access is problematic Repeatability Consistently build identical machines Get your own software repository running Avoid describing the same thing in multiple places Sure you could do this yourself by manually editing entries in the /tftpboot tree and dhcpd.conf – but that way lies madness
  • 5. Installation Use EPEL http://fedoraproject.org/wiki/EPEL Source RPM's http://people.fedoraproject.org/~mdehaan/files/cobbler/ check out the source with GIT # git clone git://git.fedorahosted.org/cobbler
  • 7. Hierarchy with options Distros kernel & initrd locations architecture (i386, x86_64, ia64) breed (RedHat based, Debian, SuSE) Profiles kickstart file location kickstart metadata – variables you can pass to kickstart all of the above Systems hostname IP info MAC all of the above
  • 8. Repo's Mirror an existing repo # cobbler repo add -- mirror=http://mirrors.kernel.org/fedora/core/updates/6/i386/ -- name=fc6i386updates # cobbler reposync We will use this in our kickstart later
  • 9. Importing Distros ISO # mount -o loop rhel5.iso /mnt # cobbler import –mirror=/mnt –name=rhel5 From DVD # cobbler import --mirror=/media/dvd –name=rhel5 rsync from a mirror # cobbler import --mirror=rsync://foo.org/path –name=rhel5 NFS – Does not mirror content # cobbler import --mirror=/path/nfsmount --name=filer --available- as=nfs://nfs.foo.org:/path
  • 10. Profiles kernel options serial console=ttyS1,9600 kickstart metadata – variables you can use in your kickstart uses Cheetah - a python powered template engine ksmeta=eth_device='eth0' rhel_key='c0ffee' rhn_passwd='passwd' rhn_user='spkfoo'
  • 11. Kickstart config Easy way to get a working kickstart config install by hand and check out /root/anaconda-ks.cfg Show an example...
  • 12. Systems Hostname MAC IP Info Yum repo Probably a bad idea – use profiles for this system specific kernel options and kickstart metadata Probably a bad idea – use profiles for this
  • 13. Triggers add, delete, install, sync pre/post for each Can use the Cobbler API or any executable script/program Simple example: /var/lib/cobbler/triggers/add/system/post/test.sh #!/bin/bash echo "Hi, my name is $1 and I'm a newly added system"
  • 14. Example Trigger using API #!/usr/bin/python import os import sys from cobbler import api cobbler_api = api.BootAPI() # this is the systemname, not the hostname, so be sure to use the FQDN in the systemname machine = sys.argv[1] # location of getcert.sh script getcert_cmd = "/usr/local/sbin/getcert.sh" # set return code to 0 by default rc = 0 # build the command string cmd = getcert_cmd + " " + machine # log to cobbler's logs cobbler_api.log("running - " + cmd) # run the command and set the return code rc = os.system(cmd) # exit with return code sys.exit(rc)
  • 16. Logging Syslog server built in 25150/udp /var/log/cobbler/syslog/<hostname> other places to look /var/log/cobbler/cobbler.log /var/log/cobbler/install.log http access logs
  • 18. Thanks! https://fedorahosted.org/cobbler - Official site - sourced throughout presentation GSLUG - http://gslug.org - Providing a forum to learn and share ideas about Linux