puppet @techlifecookpad

3,753 views

Published on

techlife cookpad lighting talk - puppet -

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,753
On SlideShare
0
From Embeds
0
Number of Embeds
224
Actions
Shares
0
Downloads
60
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

puppet @techlifecookpad

  1. 1. puppet + cobbler Naoya Nakazawa @techlifecookpad 2009/12/3
  2. 2. About me • • • id:n0ts • : Carpe Diem • http://www.sssg.org/blogs/naoya/
  3. 3. Motivation • • • •
  4. 4. Hardware •D 1U • 30 1 • 6
  5. 5. Software • CentOS 5.x x86_64 • Puppet 0.24.7 • Cobbler 1.6.4
  6. 6. • https://fedorahosted.org/cobbler/ • •
  7. 7. Manage Server • puppetmaster+cobblerd • Manage puppet • yum
  8. 8. How to set up my servers
  9. 9. 0 1) 2) 3)
  10. 10. 1 1. 2. BIOS/IPMI • PXE 3. eth0 MAC 4. PXE pause
  11. 11. 2 1. manage manifest 2. manage puppetrun cobbler_add_system_base { "s1": mac1 => "xx:xx:xx:xx:xx:xx", xen_domu_num => 3, }
  12. 12. 3 • puppet manifest • PXE
  13. 13. 4 • • 10 20 • SSH
  14. 14. Tips & Tricks
  15. 15. puppetd at kickstart • %post puppet #if $hostname /usr/sbin/puppetd --fqdn "$hostname" --logdest /root/puppet.log --verbose --no-daemonize --onetime --report #end if
  16. 16. koan • • Xen, KVM,VMWare • cobbler
  17. 17. koan at kickstart 1 • /etc/rc.local koan Xen DomU • cobbler system cobbler_add_system_web { "s1-u1": } cobbler_add_system_lvs { "s1-u2": } cobbler_add_system_dbm { "s1-u3": }
  18. 18. koan at kickstart 2 #set $xen_domu_num = $int($getVar('$xen_domu_num', 0)) #if $hostname != "" and $xen_domu_num > 0 /bin/cat << EOF >> /etc/rc.local FACTER=/usr/bin/facter if [ -x $FACTER ]; then VIRTUAL=`$FACTER virtual` if [ $VIRTUAL == "xen0" ]; then EOF #for $i in $range(1, $xen_domu_num + 1) /bin/cat << EOF >> /etc/rc.local if [ ! -f /etc/xen/`/bin/hostname -s`-u$i ]; then sleep 10 /usr/bin/koan --server=cobbler.`/bin/hostname -d` --system=`/bin/hostname -s`-u$i --virt --nogfx ln -s /etc/xen/`/bin/hostname -s`-u$i /etc/xen/auto/`/bin/hostname -s`-u$i fi EOF #end for /bin/cat << EOF >> /etc/rc.local fi fi EOF #end if
  19. 19. matrix 1 • DSAS like MATRIX s1: s1-u1: hoge_web s1-u2: hoge_lvs s1-u3: hoge_dbm
  20. 20. matrix 2 • matrix puppet node $ ./tools/puppet_node.rb ./nodes/matrix s1-u1.example.com --- parameters: classes: - hoge_web - puppet.conf - # An external command that can produce node information. external_nodes = "$confdir/tools/puppet_node.rb $confdir/nodes/matrix" # Where to find information about nodes. node_terminus = exec
  21. 21. facter • facter $ sudo facter -p bios_vendor DXXX Inc. class baseclass { if $bios_vendor == "DXXX Inc." { include dXXX } }
  22. 22. puppet directory tree • puppet • /etc/sysconfig/puppetmaster PUPPETMASTER_EXTRA_OPTS="--confdir=/hoge/puppet"
  23. 23. puppet module • Puppet Best Practices 2.0 http://reductivelabs.com/trac/puppet/wiki/PuppetBestPractice
  24. 24. my puppet module • CentOS • http://github.com/n0ts/puppet
  25. 25. Challenges • iptables • BIOS/IPMI • D • DomU
  26. 26. Puppet at Velocity • Velocity Puppet http://www.sssg.org/~naoya/puppet/project.html
  27. 27. Thank You!

×