Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

DevOps Trends

Slide 4

Slide 4 text

DevOps Trends The Lay Of The Land

Slide 5

Slide 5 text

DevOps Trends The Lay Of The Land

Slide 6

Slide 6 text

DevOps Trends The Lay Of The Land

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

What Is Test Driven Infrastructure?

Slide 11

Slide 11 text

What Is Test Driven Infrastructure Introducing Serverspec - What It Is

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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.

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

Serverspec Feature Showcase Easy to read, browse and discover. Docs also available in Dash. SUPER GREAT DOCS Github search: serverspec & specinfra TONS OF PLUGINS

Slide 18

Slide 18 text

The Role Of A CMDB in DevOps and TDI

Slide 19

Slide 19 text

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?

Slide 20

Slide 20 text

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?

Slide 21

Slide 21 text

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?

Slide 22

Slide 22 text

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?

Slide 23

Slide 23 text

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?

Slide 24

Slide 24 text

Workflow And Environment

Slide 25

Slide 25 text

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!

Slide 26

Slide 26 text

Uses For Test Driven Infrastructure

Slide 27

Slide 27 text

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.

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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.

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

ServerSpec Demo

Slide 32

Slide 32 text

Thanks For Watching @we_are_zero_one [email protected] http://zero-one.io