Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Puppet at GitHub

4 037 vues

Publié le

"Puppet at GitHub" by Will Farrington of GitHub at Puppet Camp Raleigh 2013. You can find Will's slides in their native habitat here: https://speakerdeck.com/wfarr/puppet-at-github-puppetcamp-raleigh-2013

  • Soyez le premier à commenter

Puppet at GitHub

  1. 1. and other adventures in ChatOpsPuppet at GitHub
  2. 2. @wfarrGitHub OperationsKnown Aliases: King of KebabsThe Computer GuyMr. RealTalkProbably a delinquent
  3. 3. The State of Puppet at GitHub
  4. 4.  The State of Puppet at GitHubboxen/puppet-*
  5. 5.  The State of Puppet at GitHub~1 YEAR OLD
  6. 6.  The State of Puppet at GitHubOPEN SOURCED 3 MONTHS AGO
  7. 7.  The State of Puppet at GitHub~180 PUBLIC MODULES
  8. 8.  The State of Puppet at GitHub2 EXTERNAL MAINTAINERS@fromonesrc @JHaals
  9. 9. The State of Puppet at GitHubTHE STACK
  10. 10. The State of Puppet at GitHubPUPPET 3.2
  11. 11. The State of Puppet at GitHubMASTER-LESS
  12. 12. The State of Puppet at GitHubRUBY 1.8.7
  13. 13. The State of Puppet at GitHubRUN MANUALLY
  14. 14.  The State of Puppet at GitHubgithub/puppet
  15. 15.  The State of Puppet at GitHub~5 YEARS OLD
  16. 16. 2010201120122013
  17. 17. CODE COMMITS The State of Puppet at GitHub
  18. 18. CODE ADDITIONS The State of Puppet at GitHub
  19. 19. CODE DELETIONS The State of Puppet at GitHub
  20. 20. CONTRIBUTIONS (PAST YEAR)~2k commits~150 commits The State of Puppet at GitHub
  21. 21. CONTRIBUTIONS (PAST YEAR)~23% of all commits The State of Puppet at GitHub
  22. 22. The State of Puppet at GitHubAN AVERAGE WEEKAbout 50 Pull Requests and 25 Issues comprising300 commits across 24 authors
  23. 23. The State of Puppet at GitHubTHE STACK
  24. 24. The State of Puppet at GitHubPUPPET 2.7.GITHUB
  25. 25. The State of Puppet at GitHubSINGLE PUPPETMASTER
  26. 26. The State of Puppet at GitHubRUBY 1.8.7
  27. 27. The State of Puppet at GitHubRUN VIA CRON JOB
  28. 28. The State of Puppet at GitHubPUPPETDB
  29. 29. The State of Puppet at GitHubCUSTOM NODE DEFINITIONS
  30. 30. How GitHub writes Puppet
  31. 31.  How GitHub Writes PuppetPUPPETLABS/STDLIB
  32. 32.  How GitHub Writes PuppetPARAMETER VALIDATION
  33. 33.  How GitHub Writes Puppetclass redis::server($data_dir = /var/lib/redis,$manage_service = false,$package = redis-server) {validate_bool($manage_service)validate_absolute_path($data_dir)validate_re($package, ^redis2?-server$,"Redis::Server[${name}]: package must be either redis-server or redis2-server: ${package}")}
  34. 34.  How GitHub Writes PuppetDATA MUNGING
  35. 35.  How GitHub Writes Puppetdefine ruby::version($env = {}) {$default_environment = {CC => clang,CFLAGS => -O2}$ruby_build_environment = merge($default_environment, $env)exec { "install ruby version ${name}":environment => join_keys_to_values($ruby_build_environment, =)}}
  36. 36.  How GitHub Writes PuppetRESOURCE HANDLING
  37. 37.  How GitHub Writes Puppetclass redis::server($data_dir = /var/lib/redis) {if ! defined_with_params(User[redis], { ensure => present }) {user { redis: ensure => present, group => redis }}}
  38. 38.  How GitHub Writes Puppet$latest_tcs_version = "${::ruby::root}/versions/1.9.3-p231-tcs-github-1.0.30"$tcs_alias = "${::ruby::root}/versions/1.9.3-p231-tcs-github"$desired_params = {ensure => link,target => $latest_tcs_version,force => true}File <| title == $tcs_version |> {ensure => link,target => $latest_tcs_version,force => true}ensure_resource(file, $tcs_alias, $desired_params)
  39. 39.  How GitHub Writes PuppetGITHUB::ROLE::*
  40. 40.  How GitHub Writes PuppetNODE CONFIGURATION
  41. 41. node /^github-redisd+[a-z]?-rs1-prd.iad.github.net$/ {class { github::role::redis:env => production,private_ipv4 => $::ipaddress,}} How GitHub Writes Puppet
  42. 42.  How GitHub Writes PuppetROLE CONFIGURATION
  43. 43. class github::role::redis($env, $private_ipv4) {validate_re($env, ^(vagrant|staging|production)$)validate_re($private_ipv4, ^d+.d+.d+.d+$)$monitor = $env ? { production => true, default => false }class {github::core:monitor => $monitor,private_address => $private_ipv4 ;redis::server:bind_address => $private_ipv4,monitor => $monitor ;}} How GitHub Writes Puppet
  44. 44. ABSTRACTIONHow GitHub Writes Puppet
  45. 45. class github::core($monitor) {include github::common_packagesinclude github::staffclass {github::ssh:monitor => $monitor ;github::ipv6:ensure => absent ;}} How GitHub Writes Puppet
  46. 46. class github::ipv6($ensure = present) {if $::lsbdistcodename != squeeze {file { /etc/modprobe.d/ipv6:ensure => $ensure,mode => 0444,source => puppet:///modules/github//etc/modprobe.d/ipv6,}} else {$value = $ensure ? { present => 0, default => 1 }sysctl { net.ipv6.conf.all.disable_ipv6:value => $value,}}} How GitHub Writes Puppet
  47. 47. AUGEASHow GitHub Writes Puppet
  48. 48. class redis::server($bind_address, $data_dir, $monitor, $port) {redis::config {dir:value => $data_dir,require => File[$data_dir];bind:value => $bind_address;port:value => $port;daemonize:value => yes;}} How GitHub Writes Puppet
  49. 49. define redis::config($value, $ensure = present) {validate_re($ensure, ^(present|absent)$)$changes = $ensure ? { present => "set ${name} ${value}", default => "rm ${name}" }augeas { "Set Redis config ${name} to ${value}":changes => $changes,context => /files/etc/redis/redis.conf,lens => Redis.lns,incl => /etc/redis/redis.conf,require => File[/etc/redis/redis.conf]}} How GitHub Writes Puppet
  50. 50.  How GitHub Writes PuppetCODE SHARE
  51. 51. LIBRARIAN-PUPPETHow GitHub Writes Puppet
  52. 52. HENSONHow GitHub Writes Puppet
  53. 53. How GitHub deploys Puppet
  54. 54. KEEP IT CLEAN How GitHub Deploys Puppet
  55. 55. rodjek/puppet-lint How GitHub Deploys Puppet
  56. 56. KEEP IT GREEN How GitHub Deploys Puppet
  57. 57. rodjek/rspec-puppet How GitHub Deploys Puppet
  58. 58. tmm1/test-queue How GitHub Deploys Puppet
  59. 59. KEEP IT LEAN How GitHub Deploys Puppet
  60. 60. $ git commit -am "cant lint this"modules/github/manifests/role/redis.pp: syntax okmodules/github/manifests/role/redis.pp - WARNING: => is not properly aligned on line 1181 errors found, aborting commit. How GitHub Deploys Puppet
  61. 61.  How GitHub Deploys Puppet
  62. 62.  How GitHub Deploys Puppet
  63. 63. CHATOPS How GitHub Deploys Puppet
  64. 64. /puppet env worker#=>worker1.rs.github.com: productionworker2.rs.github.com: productionworker3.rs.github.com: productionworker4.rs.github.com: productionworker5.rs.github.com: productionworker6.rs.github.com: production How GitHub Deploys Puppet
  65. 65. /puppet run worker2#=> Running puppet on worker2.rs.github.com/production How GitHub Deploys Puppet
  66. 66. /puppet noop feature_branch worker2#=> Running puppet on worker2.rs.github.com/feature_branch --noop How GitHub Deploys Puppet
  67. 67. /puppet force feature_branch worker2#=> Running puppet on worker2.rs.github.com/feature_branch How GitHub Deploys Puppet
  68. 68. /puppet disable worker2#=> Disabling puppet on worker2.rs.github.com How GitHub Deploys Puppet
  69. 69. /puppet enable worker2#=> Disabling puppet on worker2.rs.github.com How GitHub Deploys Puppet
  70. 70. /puppet last_run worker2 How GitHub Deploys Puppet
  71. 71. /puppet certs#=>"wills-macbook-pro.local" (A4:5B:AC:B9:E1:85:8B:2B:0E:8B:62:F9:03:32:C9:03) How GitHub Deploys Puppet
  72. 72. The Future of Puppet at GitHub
  73. 73. boxen/puppet-*The Future of Puppet at GitHub
  74. 74. SHELL "REMEMBER TO RUN" SUPPORTThe Future of Puppet at GitHub
  75. 75. You havent run Boxen in over a week. =(We really recommend running Boxen regularly. Its way better that way!Do you want to run boxen now? (y/N) y# boxenUpdating Boxen....The Future of Puppet at GitHub
  76. 76. OPT-OUTThe Future of Puppet at GitHub
  77. 77. touch $HOME/.boxen-never-prompt-for-updatesThe Future of Puppet at GitHub
  78. 78. PUPPETMASTER SUPPORTThe Future of Puppet at GitHub
  79. 79. OPT-IN ONLYThe Future of Puppet at GitHub
  80. 80. HIERA SUPPORTThe Future of Puppet at GitHub
  81. 81. "uncomfortunities"The Future of Puppet at GitHub
  82. 82. UBUNTU SUPPORTThe Future of Puppet at GitHub
  83. 83. UBUNTU PRECISEThe Future of Puppet at GitHub
  84. 84. github/puppetThe Future of Puppet at GitHub
  85. 85. The Future of Puppet at GitHubRUBY 1.9.3
  86. 86. The Future of Puppet at GitHubPUPPET 3.X
  87. 87. The Future of Puppet at GitHubGPANEL: ENC
  88. 88. The Future of Puppet at GitHublol censored
  89. 89. The Future of Puppet at GitHubMCOLLECTIVE
  90. 90. The Future of Puppet at GitHubREPLACING PARTS OF GITHUB/SHELL
  91. 91. The Future of Puppet at GitHubSTRUCTURED DATA > SED/AWK
  92. 92. The Future of Puppet at GitHubHIERA
  93. 93. THANKSspeakerdeck.com/wfarr/puppet-at-github-puppetcamp-raleigh-2013

×