Test Driven Infrastructure

Test Driven Infrastructure

An intro to Test Driven Infrastructure, using ServerSpec

7edec06b5435e0dac07a353b2cc26253?s=128

Gabriel Fortuna

April 28, 2015
Tweet

Transcript

  1. Test Driven Infrastructure Gabriel Fortuna // Zero One JOZI.RB

  2. TOPIC DevOps trends What is Test Driven Infrastructure? CMDB’s Your

    workflow and environment Uses Demo DevOps Trends The lay of the land Where DevOps was, is and will be. TDI? What’s it about? Automation safety nets. Role of CMDB’s ISO20k/ITIL What is vs. What should be Workflow Delivery Opportunities for integration into delivery pipeline Uses More than testing Obvious cases Right cases Wrong cases Demo TDI in action A small canned demo illustrating the tip of the iceberg Agenda What You Can Expect From This Talk
  3. DevOps Trends

  4. DevOps Trends The Lay Of The Land

  5. DevOps Trends The Lay Of The Land

  6. DevOps Trends The Lay Of The Land

  7. Trends Continued So Many Variables Container wars Docker? Not so

    fast. What about rkt? Canonical LXD? MS Drawbridge? 1 Good ol’ shell scripts Ansible? Chef? Puppet? Salt? CFEngine? Orchestration tools 2 Heroku? AWS? Google?
 EngineYard? CloudAfrica? The Cloud 3
  8. Trends Continued So Many Variables Ansible? Chef? Puppet? Salt? CFEngine?

    Orchestration tools 2 Heroku? AWS? Google?
 EngineYard? CloudAfrica? The cloud 3 No longer about simply on-demand deploy. That doesn’t scale. Mass system (not server) deploy on test pass Continuous Delivery 4
  9. Trends Continued So Many Variables Heroku? AWS? Google?
 EngineYard? CloudAfrica?

    The cloud 3 No longer about simply on-demand deploy. That doesn’t scale. Mass system (not server) deploy on test pass Continuous Delivery 4 Enterprise lagging behind. Is this a threat, or an opportunity? Still figuring this Devops thing out 5
  10. What Is Test Driven Infrastructure?

  11. What Is Test Driven Infrastructure Introducing Serverspec - What It

    Is
  12. What Is Test Driven Infrastructure Introducing Serverspec - What It

    Is Agnostic Open Source Based on RSpec
  13. What Is Test Driven Infrastructure Introducing Serverspec - What It

    Is Agnostic Open Source Based on RSpec Win or Linux Version 2 just released
  14. What Is Test Driven Infrastructure Introducing Serverspec - What It

    Is Agnostic Open Source Based on RSpec Win or Linux Version 2 just released SOME HIGHLIGHTS ON SERVERSPEC Serverspec tests your servers' actual state by executing commands locally, via SSH, WinRM, Docker API, The true aim of Serverspec is to help refactor infrastructure code.
  15. Serverspec Feature Showcase Super fast to setup. First tests can

    be ready in less than 5 minutes. BOOTSTRAPPED SETUP Hardware, Software, Packages, Containers, and lots more TONS OF RESOURCE TYPES
  16. Serverspec Feature Showcase Add to your existing Ruby Gemfile. Or,

    add to any other project. Or, create a dedicated project (Ops) RUNS WHEREVER RUBY DOES Gather facts about the system and verify their state. HOST INVENTORY
  17. Serverspec Feature Showcase Easy to read, browse and discover. Docs

    also available in Dash. SUPER GREAT DOCS Github search: serverspec & specinfra TONS OF PLUGINS
  18. The Role Of A CMDB in DevOps and TDI

  19. CMDB’S The ‘Well-Actually’s Of Enterprise 10% EXCEPTION REPORTING GOVERNANCE RISK

    MANAGEMENT PRINCIPLES What we think vs. What there actually is Change Control What doesn’t match with reality anymore? What’s out there that we aren’t aware of? Anything vulnerable out there? Anything we can’t support out there?
  20. CMDB’S The ‘Well-Actually’s Of Enterprise 25% EXCEPTION REPORTING GOVERNANCE RISK

    MANAGEMENT PRINCIPLES What we think vs. What there actually is Change Control What doesn’t match with reality anymore? What’s out there that we aren’t aware of? Anything vulnerable out there? Anything we can’t support out there?
  21. CMDB’S The ‘Well-Actually’s Of Enterprise 50% EXCEPTION REPORTING GOVERNANCE RISK

    MANAGEMENT PRINCIPLES What we think vs. What there actually is Change Control What doesn’t match with reality anymore? What’s out there that we aren’t aware of? Anything vulnerable out there? Anything we can’t support out there?
  22. CMDB’S The ‘Well-Actually’s Of Enterprise 75% EXCEPTION REPORTING GOVERNANCE RISK

    MANAGEMENT PRINCIPLES What we think vs. What there actually is Change Control What doesn’t match with reality anymore? What’s out there that we aren’t aware of? Anything vulnerable out there? Anything we can’t support out there?
  23. CMDB’S The ‘Well-Actually’s Of Enterprise 100% EXCEPTION REPORTING GOVERNANCE RISK

    MANAGEMENT PRINCIPLES What we think vs. What there actually is Change Control What doesn’t match with reality anymore? What’s out there that we aren’t aware of? Anything vulnerable out there? Anything we can’t support out there?
  24. Workflow And Environment

  25. Workflow And Environment Vision Of A Typical Workflow For TDI

    Time to figure out what your client wants 1. NEW WORK! Bootstrap your app environment. 2. GET STARTED What will this run on, and how? 3. ARCHITECTURE New requirements 6. CHANGES! Test all environments if possible. 5. INTEGRATE TO CI Reflect the new reality 7. REFACTOR! Get your infra back to green. 8. RETEST Steps 2 - 8 9. REPEAT Write tests that reflect your target arch. 4. GET TESTING!
  26. Uses For Test Driven Infrastructure

  27. Uses For TDI A Glide Path For Adoption, With Pitfall

    Warnings Right * Some clear examples where TDI adds real value. Wrong * Maybe not wrong, but possibly better achieved with other tools. Obvious * Start with these use cases to show immediate value.
  28. Uses For TDI A Glide Path For Adoption, With Pitfall

    Warnings Obvious * Start with these use cases to show immediate value. As ServerSpec is a relatively new thing, get out the gates with things that yield clear value quickly. This will help with buy-in down the road. QUICK, SIMPLE, CLEAR WINS Reports CI Release pipeline Early tests Set standards Manual stuff
  29. Obvious * Start with these use cases to show Uses

    For TDI A Glide Path For Adoption, With Pitfall Warnings TDI with ServerSpec can unlock massive value, and drastically reduce the ‘surprise’ factor of DevOps. Here are some clever wins that are available out-of-the-box once you’re more comfortable with it. SERVERSPEC BONANZA Security - HW Git Single Suite Change Mgmt Base Suite Version Pkgs Processes Right * Some clear examples where TDI adds real value.
  30. Uses For TDI A Glide Path For Adoption, With Pitfall

    Warnings Nina Smith Illustrator Life is short. Play with your dog. The power of ServerSpec means you could use it to solve the right problem the wrong way. Also, testing well is hard. HERE BE DRAGONS Right * Some clear examples where TDI adds real value. Wrong * Maybe not wrong, but possibly better achieved with other tools. Command abuse Net Ports Wrong order Static tests
  31. ServerSpec Demo

  32. Thanks For Watching @we_are_zero_one hello@zero-one.io http://zero-one.io