Successfully reported this slideshow.
Your SlideShare is downloading. ×

It's code but not as we know: Infrastructure as Code - Patrick Debois

Ad

Infrastructure as Code   Patrick Debois
                                                        http://www.tumblr.com/tagg...

Ad

Organizer Since 2009        Europe Organizer 2010     First Europe Training 2010            Speaker




        Monitoring...

Ad

http://cfengine.com/                                                          http://ansible.cc/
                http://pu...

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Loading in …3
×

Check these out next

1 of 102 Ad
1 of 102 Ad

It's code but not as we know: Infrastructure as Code - Patrick Debois

Configuration Management systems like CFEngine, Puppet and Chef, are often adopted as part of devops toolchains. It promises us infrastructure as code a concept that leads to 'Agile' infrastructure: In this session I'd like to give: - a brief explanation of the concept and why it's useful - an overview about the similarities this has with regular code - concepts such as TDD, BDD how well can they be translated - how it fits in with continuous Integration for systems Besides the concept translation I will add links to existing tools and project that working and evolving in the space. And finally, is it really the same? Does a coding background help you? Where do the tools/concepts need improvement? After this session I'm sure you'll be ready to give it a spin and explore more and possibly share some ideas back.

Configuration Management systems like CFEngine, Puppet and Chef, are often adopted as part of devops toolchains. It promises us infrastructure as code a concept that leads to 'Agile' infrastructure: In this session I'd like to give: - a brief explanation of the concept and why it's useful - an overview about the similarities this has with regular code - concepts such as TDD, BDD how well can they be translated - how it fits in with continuous Integration for systems Besides the concept translation I will add links to existing tools and project that working and evolving in the space. And finally, is it really the same? Does a coding background help you? Where do the tools/concepts need improvement? After this session I'm sure you'll be ready to give it a spin and explore more and possibly share some ideas back.

Advertisement
Advertisement

More Related Content

Similar to It's code but not as we know: Infrastructure as Code - Patrick Debois (20)

More from JAX London (20)

Advertisement

It's code but not as we know: Infrastructure as Code - Patrick Debois

  1. 1. Infrastructure as Code Patrick Debois http://www.tumblr.com/tagged/star-trek-quotes Wednesday 17 October 12
  2. 2. Organizer Since 2009 Europe Organizer 2010 First Europe Training 2010 Speaker Monitoring Chapter Technical Reviewer Co-Author Veewee / Sahara / Mccloud Libvirt - Fog Freelance consultant Engineer http://github.com/jedi4ever Blog: http://jedi.be/blog - Twitter: @patrickdebois - #devops Wednesday 17 October 12
  3. 3. http://cfengine.com/ http://ansible.cc/ http://puppetlabs.com/ http://palletops.com/ http://opscode.com/chef/ CONFIGURATION MANAGEMENT SYSTEMS Wednesday 17 October 12
  4. 4. Chef & Puppet focused based on my experience http://www.nerdnirvana.org/wp-content/uploads/2010/12/apology-form.jpg Wednesday 17 October 12
  5. 5. GIVE ME THE CODE: “LANGUAGE” Wednesday 17 October 12
  6. 6. EXAMPLE SYNTAX Puppet Chef class myapache { package “apache2” package “apache2” service “apache2 do action [:enable , :start] service “apache2”: end ensure => “running”, require => Package[“apache2”] } Wednesday 17 October 12
  7. 7. TERMINOLOGY Java Puppet Chef manifests recipes *.java *.pp *.rb package module cookbook Wednesday 17 October 12
  8. 8. TERMINOLOGY (2) Java Puppet Chef parametrized recipes with singleton classes attributes defines, definitions, class classes libraries Wednesday 17 October 12
  9. 9. SYNTAX Puppet Chef Limited DSL DSL + full ruby (by design) Extended by Light Weight Definitions Resource Providers / Custom Resource Definitions Providers, Light providers Weight Resource ERB & Custom Providers Libraries Libraries Wednesday 17 October 12
  10. 10. LOOPING CONSTRUCTS Puppet Chef pass array of elements erb template for loops do while , repeat etc. create_resource available through (:type, hash) native ruby Wednesday 17 October 12
  11. 11. VARIABLES Puppet Chef special syntax native ruby $bla = “aa” bla = “aa” string interpolation string interpolation $bla_string = “${bla}” bla_string = #{bla} Wednesday 17 October 12
  12. 12. SINGLE CLASS INHERITANCE Puppet Chef override via ‘module override via path’ ‘cookbook’ path +> operator “cookbook” attribute Wednesday 17 October 12
  13. 13. PROJECT STRUCTURE Puppet Module Chef Cookbook attributes/ definitions/ files/ files/ libraries/ lib/ metadata.rb README.rdoc providers/ manifests/ README.rdoc templates/ recipes/ resources/ templates/ Wednesday 17 October 12
  14. 14. EXECUTION MODEL Puppet Chef Compile catalog (directed graph Top Down execution model) Then Execute Wednesday 17 October 12
  15. 15. CODE EDITOR Wednesday 17 October 12
  16. 16. VIM SYNTAX HIGHLIGHTIING https://github.com/rodjek/vim-puppet https://github.com/t9md/vim-chef https://github.com/vim-scripts/Cfengine-version-3-syntax Wednesday 17 October 12
  17. 17. GEPPETTO - ECLIPSE IDE https://github.com/cloudsmith/geppetto http://cloudsmith.github.com/geppetto/ Wednesday 17 October 12
  18. 18. WYSIWYG CODING REACTOR8 http://beta.r8network.com/ Wednesday 17 October 12
  19. 19. http://redmine.djagios.org/projects/puppet-lexer https://github.com/rodjek/puppet-pygments-lexer Wednesday 17 October 12
  20. 20. CODE GENERATION Wednesday 17 October 12
  21. 21. REVERSE ENGINEERING Existing Server -> Manifest/Recipes https://github.com/devstructure/blueprint Wednesday 17 October 12
  22. 22. DSL ON TOP OF PUPPET ~GRAILS Note: Not vastly used https://github.com/jnewland/shadow_puppet Wednesday 17 October 12
  23. 23. CODING STYLE Wednesday 17 October 12
  24. 24. Puppet Chef http://puppet-lint.com/ http://acrmp.github.com/ foodcritic/ • FC001: Use strings in preference to symbols to access node attributes • Must use two-space soft tabs. • FC002: Avoid string interpolation where not required • Must not use literal tab characters. • FC003: Check whether you are running with chef server before using server- specific features • Must not contain trailing white space. • FC004: Use a service resource to start and stop services • Should not exceed an 80 character line width • FC005: Avoid repetition of resource declarations An exception has been made for source  =>  'puppet://...' lines as • FC006: Mode should be quoted or fully specified when setting file permissions splitting these over multiple lines decreases the readability of the • FC007: Ensure recipe dependencies are reflected in cookbook metadata manifests. • FC008: Generated cookbook metadata needs updating • Should align arrows (=>) within blocks of attributes. • FC009: Resource attribute not recognised • FC010: Invalid search syntax • .... • FC011: Missing README in markdown format • FC012: Use Markdown for README rather than RDoc • • FC013: Use file_cache_path rather than hard-coding tmp paths • https://github.com/ampledata/cookbook-style-guide http://docs.puppetlabs.com/guides/style_guide.html Wednesday 17 October 12
  25. 25. http://www.slideshare.net/PuppetLabs/modern-module- development-ken-barber-2012-edinburgh-puppet-camp Wednesday 17 October 12
  26. 26. http://projects.puppetlabs.com/projects/hiera https://github.com/crayfishx/hiera-gpg CODE VS CONFIG (THINK “PROFILES”) http://wiki.opscode.com/display/chef/Data+Bags Wednesday 17 October 12
  27. 27. “STOP THE FORK(ING)” https://github.com/jedi4ever/stop-the-fork Wednesday 17 October 12
  28. 28. PRE-COMMIT CHECKS Wednesday 17 October 12
  29. 29. DEPENDENCY MGMT Git Submodules à la Pom File Subtree Wednesday 17 October 12
  30. 30. UPSTREAM REPOS http://community.opscode.com/ http://forge.puppetlabs.com/ Wednesday 17 October 12
  31. 31. Puppet Chef https://github.com/rodjek/ https://github.com/ librarian-puppet applicationsonline/librarian http://berkshelf.com/ site  "http://community.opscode.com/api/v1" cookbook  "ntp" cookbook  "timezone",  "0.0.1" cookbook  "rvm",    :git  =>  "https://github.com/fnichol/chef-­‐rvm",    :ref  =>  "v0.7.1" cookbook  "cloudera",    :path  =>  "vendor/cookbooks/cloudera-­‐cookbook" Wednesday 17 October 12
  32. 32. CHEF METADATA Wednesday 17 October 12
  33. 33. Puppet Dependency Graphs http://bitfieldconsulting.com/puppet-dependency-graphs Wednesday 17 October 12
  34. 34. http://wham.cloudsmith.com Wednesday 17 October 12
  35. 35. DEBUGGING Wednesday 17 October 12
  36. 36. LOGGING WITH DIFFERENT LEVELS Info only, no exception Chef::Log.info('Some  useful  info') Fatal, raising exception Chef::Log.fatal('Something  bad') Wednesday 17 October 12
  37. 37. REPL - STYLE (READ EVAL PRINT) https://github.com/pry/pry http://wiki.opscode.com/display/chef/Shef Wednesday 17 October 12
  38. 38. https://github.com/vimeo/simple-black-box Wednesday 17 October 12
  39. 39. DEV ENVIRONMENT Wednesday 17 October 12
  40. 40. Virtualbox + (Fusion Soon) http://vagrantup.com/ Virtualbox, Fusion, KVM,Parallels, https://github.com/jedi4ever/veewee/ Wednesday 17 October 12
  41. 41. https://github.com/jedi4ever/mccloud/ EC2, KVM, FUSION, HOSTS, Vagrant Vagrant alike EC2 https://github.com/rtyler/blimpy Wednesday 17 October 12
  42. 42. UNIT TESTING Wednesday 17 October 12
  43. 43. https://github.com/nistude/cucumber-puppet Wednesday 17 October 12
  44. 44. https://github.com/rodjek/rspec-puppet https://github.com/acrmp/chefspec https://github.com/calavera/rspec-chef Wednesday 17 October 12
  45. 45. Wednesday 17 October 12
  46. 46. MOCKING Wednesday 17 October 12
  47. 47. https://github.com/customink/fauxhai Wednesday 17 October 12
  48. 48. AUTO-TRIGGER TESTS RUN https://github.com/guard/guard-rspec https://github.com/johnbintz/guard-puppet https://github.com/alister/guard-puppet-lint https://github.com/guard/guard-chef Wednesday 17 October 12
  49. 49. http://www.cucumber-chef.org/ EC2+LXC Faster testing via LXC Vagrant+LXC https://github.com/exceedhl/toft Wednesday 17 October 12
  50. 50. CI INTEGRATION Wednesday 17 October 12
  51. 51. https://github.com/nicksieger/ci_reporter Wednesday 17 October 12
  52. 52. https://github.com/rtyler/vagrant-plugin Wednesday 17 October 12
  53. 53. https://travis-ci.org/ Wednesday 17 October 12
  54. 54. CROSS OS-TESTING https://github.com/opscode/bento https://github.com/opscode/test-kitchen Wednesday 17 October 12
  55. 55. Windows https://github.com/tknerr/bills-kitchen Wednesday 17 October 12
  56. 56. INTEGRATION TESTING (ON REAL MACHINE) Wednesday 17 October 12
  57. 57. http://auxesis.github.com/cucumber-nagios/ Wednesday 17 October 12
  58. 58. RE-USABLE CUCUMBER STEPS http://www.cucumber-chef.org/ https://github.com/hedgehog/cuken https://github.com/cucumber/aruba Wednesday 17 October 12
  59. 59. Validate “inside” the provision-run cycle https://github.com/calavera/minitest-chef-handler https://github.com/jedi4ever/puppet-assert Wednesday 17 October 12
  60. 60. PERFORMANCE/METRICS Wednesday 17 October 12
  61. 61. https://github.com/rodjek/puppet-profiler Wednesday 17 October 12
  62. 62. execution time number of classes https://github.com/krux/puppet-module-graphite-report https://github.com/imeyer/chef-handler-graphite https://github.com/joemiller/puppet-graphite_event Wednesday 17 October 12
  63. 63. TARGETED TESTING IMPACT OF CHANGE https://github.com/jonlives/knife-preflight https://github.com/jedi4ever/puppet-cic Wednesday 17 October 12
  64. 64. Infrastructure as Code Patrick Debois http://www.tumblr.com/tagged/star-trek-quotes Wednesday 17 October 12
  65. 65. Wednesday 17 October 12
  66. 66. http://foodfightshow.org/ Wednesday 17 October 12
  67. 67. Wednesday 17 October 12
  68. 68. http://wiki.opscode.com/display/chef/Whyrun+Testing Wednesday 17 October 12
  69. 69. https://github.com/tbatchelli/vmfest Wednesday 17 October 12
  70. 70. Wednesday 17 October 12
  71. 71. CACHING - AMI, SNAPSHOTS Wednesday 17 October 12
  72. 72. https://github.com/lak/puppet-memcached Wednesday 17 October 12
  73. 73. https://github.com/lak/puppet-static-compiler Wednesday 17 October 12
  74. 74. http://puppetlabs.com/blog/what-is-user-experience-in- puppet/ Wednesday 17 October 12
  75. 75. AUDITING http://www.fusioninventory.org/ http://www.normation.com/en/solutions/rudder Wednesday 17 October 12
  76. 76. http://comodit.github.com/synapse-agent/ Wednesday 17 October 12
  77. 77. http://saltstack.org/ Wednesday 17 October 12
  78. 78. https://github.com/tobami/littlechef Wednesday 17 October 12
  79. 79. https://github.com/dwt/vagrant-hosts Wednesday 17 October 12
  80. 80. https://github.com/opscode/omnibus Wednesday 17 October 12
  81. 81. https://github.com/puppetlabs/puppet-module-tool Wednesday 17 October 12
  82. 82. http://wiki.opscode.com/display/chef/Recipes#Recipes- ExceptionsandLogging Wednesday 17 October 12
  83. 83. http://projects.puppetlabs.com/projects/puppet/wiki/ Anchor_Pattern Wednesday 17 October 12
  84. 84. VENDORING Wednesday 17 October 12
  85. 85. https://github.com/railsmachine/rump Wednesday 17 October 12
  86. 86. http://www.example42.com/? q=Puppi_A_Puppet_module_for_Deployment_Automation Wednesday 17 October 12
  87. 87. PLUGINS Wednesday 17 October 12
  88. 88. http://wiki.opscode.com/display/chef/Knife+Plugins Wednesday 17 October 12
  89. 89. FACES http://puppetlabs.com/blog/puppet-faces-what-the-heck-are- faces/ Wednesday 17 October 12
  90. 90. TESTING Wednesday 17 October 12
  91. 91. http://rundeck.org/ Wednesday 17 October 12
  92. 92. http://www.sonian.com/cloud-monitoring-sensu/ Wednesday 17 October 12
  93. 93. http://docs.puppetlabs.com/guides/parameterized_classes.html Wednesday 17 October 12
  94. 94. INHERITANCE Wednesday 17 October 12
  95. 95. NAMESPACING Wednesday 17 October 12
  96. 96. https://github.com/rerun/rerun Wednesday 17 October 12
  97. 97. AUTHENTICATION Wednesday 17 October 12
  98. 98. DASHBOARDS Wednesday 17 October 12
  99. 99. http://puppetlabs.com/puppet/related-projects/dashboard/ Wednesday 17 October 12
  100. 100. http://blog.mornati.net/2012/01/29/kermit-a-webui-for- mcollective/ Wednesday 17 October 12
  101. 101. http://www.opscode.com/hosted-chef/ Wednesday 17 October 12
  102. 102. http://theforeman.org/ Wednesday 17 October 12

×