Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Test Driven Infrastructure

Test Driven Infrastructure

An intro to Test Driven Infrastructure, using ServerSpec

Gabriel Fortuna

April 28, 2015
Tweet

More Decks by Gabriel Fortuna

Other Decks in Programming

Transcript

  1. 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
  2. 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
  3. 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
  4. 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
  5. What Is Test Driven Infrastructure Introducing Serverspec - What It

    Is Agnostic Open Source Based on RSpec Win or Linux Version 2 just released
  6. 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.
  7. 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
  8. 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
  9. Serverspec Feature Showcase Easy to read, browse and discover. Docs

    also available in Dash. SUPER GREAT DOCS Github search: serverspec & specinfra TONS OF PLUGINS
  10. 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?
  11. 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?
  12. 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?
  13. 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?
  14. 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?
  15. 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!
  16. 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.
  17. 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
  18. 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.
  19. 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