automated deployments with ansible

91
South Florida User Group, Fort Lauderdale, 31 st March 2015 Martin Etmajer, Technology Strategist @Dynatrace Automated Deployments with Ansible

Upload: martin-etmajer

Post on 16-Jul-2015

730 views

Category:

Software


4 download

TRANSCRIPT

Page 1: Automated Deployments with Ansible

1 #Dynatrace

South Florida User Group, Fort Lauderdale, 31st March 2015

Martin Etmajer, Technology Strategist @Dynatrace

Automated Deploymentswith Ansible

Page 2: Automated Deployments with Ansible

2 #Dynatrace

Insertimage here

Martin Etmajer

Technology Strategist @ Dynatrace

[email protected]

@metmajer

Page 3: Automated Deployments with Ansible

3 #Dynatrace

Introduction

Page 4: Automated Deployments with Ansible

4 #Dynatrace

The Phoenix Project

Page 6: Automated Deployments with Ansible

6 #Dynatrace

Continuous Delivery

Reliable Software Releases throughBuild, Test and Deployment Automation

Page 7: Automated Deployments with Ansible

7 #Dynatrace

Utmost Goal: Minimize Cycle Time

feature cycle time time

Customer Users

Page 8: Automated Deployments with Ansible

8 #Dynatrace

Utmost Goal: Minimize Cycle Time

feature cycle time time

Customer minimize Users

Page 9: Automated Deployments with Ansible

9 #Dynatrace

Utmost Goal: Minimize Cycle Time

feature cycle time time

Customer

This is when youcreate value!

minimize

Page 10: Automated Deployments with Ansible

10 #Dynatrace

Utmost Goal: Minimize Cycle Time

feature cycle time time

Customer

You

This is when youcreate value!

minimize

Page 11: Automated Deployments with Ansible

11 #Dynatrace

Utmost Goal: Minimize Cycle Time

feature cycle time time

Customer

You

minimizeIt’s about getting your features into your user’s hands

as quickly as possible!

Page 12: Automated Deployments with Ansible

12 #Dynatrace

“Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.”

#1 Principle of the Agile Manifesto

Agile Manifesto: Principle #1

Page 13: Automated Deployments with Ansible

13 #Dynatrace

...which is at the heart of Continuous Delivery, defined as:

“A deployment pipeline is, in essence, an automated implementation

of your application’s build, deploy, test and release process.”

Jez Humble & Dave Farley in Continuous Delivery

Continuous Delivery Deployment Pipeline

Page 14: Automated Deployments with Ansible

14 #Dynatrace

Continuous Delivery Deployment Pipeline

Page 15: Automated Deployments with Ansible

15 #Dynatrace

Continuous Delivery Deployment Pipeline

Page 16: Automated Deployments with Ansible

16 #Dynatrace

Continuous Delivery Deployment Pipeline

Page 17: Automated Deployments with Ansible

17 #Dynatrace

Continuous Delivery Deployment Pipeline

✔ ✔

Page 18: Automated Deployments with Ansible

18 #Dynatrace

Continuous Delivery Deployment Pipeline

✔ ✔ ✔

Page 19: Automated Deployments with Ansible

19 #Dynatrace

✔ ✔ ✔

Continuous Delivery Deployment Pipeline

Page 20: Automated Deployments with Ansible

20 #Dynatrace

Why?

» Create application runtime environments on demand

» Fast, reliable, repeatable and predictable outcomes

» Consistent environments in staging and production

» Establish fast feedback loops you can react upon

» Makes release days riskless, almost boring

Automated Deployments

Page 21: Automated Deployments with Ansible

21 #Dynatrace

“Use machines for what they’re good at, use people for what they’re good at.”

Dave Farley at PIPELINE Conference 2014 @vimeo.com/96173993

Solve problemsand be creative!

Repetitive tasks

Page 22: Automated Deployments with Ansible

22 #Dynatrace

What?

» Operating Systems, Drivers

» Middleware, Databases, etc.

» Applications, Dependencies, Data

Automated Deployments

} + Configuration

Page 23: Automated Deployments with Ansible

23 #Dynatrace

How?

» Infrastructure as Code!

» Keep everything in Version Control

» Code

» Configuration

» Data

» Align Development and Operations

Automated Deployments

Everything that affectsapplication state

Page 24: Automated Deployments with Ansible

24 #Dynatrace

Align Development and Operations

OPERATIONS

DEVELOPMENT

current iteration

(e.g. 2 weeks)time

Page 25: Automated Deployments with Ansible

25 #Dynatrace

Align Development and Operations

OPERATIONS

DEVELOPMENT

current iteration

(e.g. 2 weeks)time

Planning

Page 26: Automated Deployments with Ansible

26 #Dynatrace

Align Development and Operations

OPERATIONS

DEVELOPMENT

current iteration

(e.g. 2 weeks)time

Planning

Implementingand testing

Page 27: Automated Deployments with Ansible

27 #Dynatrace

Align Development and Operations

OPERATIONS

DEVELOPMENT

current iteration

(e.g. 2 weeks)time

Planning

Implementingand testing

Working anddeployable code

Page 28: Automated Deployments with Ansible

28 #Dynatrace

“Enable the reconstruction of the business from nothing but a source code repository, an application data backup, and bare metal resources.”

Adam Jacob, CTO of Opscode

Page 29: Automated Deployments with Ansible

29 #Dynatrace

SolutionsArchitectural Comparison

Page 30: Automated Deployments with Ansible

30 #Dynatrace

Agent-Based ArchitecturesExamples: Chef, Puppet

Page 31: Automated Deployments with Ansible

31 #Dynatrace

Agent-Based Architectures

Page 32: Automated Deployments with Ansible

32 #Dynatrace

Agent-Based Architectures

Page 33: Automated Deployments with Ansible

33 #Dynatrace

Agent-Based Architectures

Page 34: Automated Deployments with Ansible

34 #Dynatrace

Agentless ArchitecturesExamples: Ansible

Page 35: Automated Deployments with Ansible

35 #Dynatrace

Ansible’s Agentless Architecture

Page 36: Automated Deployments with Ansible

36 #Dynatrace

Ansible’s Agentless Architecture

Page 37: Automated Deployments with Ansible

37 #Dynatrace

Ansible’s Agentless Architecture

Page 38: Automated Deployments with Ansible

38 #Dynatrace

Ansible’s Agentless Architecture

Page 39: Automated Deployments with Ansible

39 #Dynatrace

Ansible is an Orchestration Engine

Page 40: Automated Deployments with Ansible

40 #Dynatrace

Ansible is an Orchestration Engine

Page 41: Automated Deployments with Ansible

41 #Dynatrace

Ansible is an Orchestration Engine

Page 42: Automated Deployments with Ansible

42 #Dynatrace

Ansible is an Orchestration Engine

Page 43: Automated Deployments with Ansible

43 #Dynatrace

Ansible is an Orchestration Engine

Page 44: Automated Deployments with Ansible

44 #Dynatrace

Ansible is an Orchestration Engine

Page 45: Automated Deployments with Ansible

45 #Dynatrace

Ansible is an Orchestration Engine

Page 46: Automated Deployments with Ansible

46 #Dynatrace

What about Demand?

Page 47: Automated Deployments with Ansible

47 #Dynatrace

Global Google Trends: Chef vs. Puppet vs. Ansible

Chef

Puppet

Year #1

Ansible

Page 48: Automated Deployments with Ansible

48 #Dynatrace

» Named #1 to watch in 2015 by SD Times

» Named a Top 10 open source project by Red Hat’s opensource.com

» > 1 Million Downloads

» > 40 dedicated Ansible meetups (happen regularly)

» > 300 customers across all verticals (Ansible Tower)

» > 900 contributors on GitHub (one of GitHub’s most active projects)

» AnsibleFest conferences in San Francisco, Austin & New York

» “Ansible: Up and Running” book preview released by O’Reilly

Ansible: Recap of 2014 (first full year of sales)

Page 49: Automated Deployments with Ansible

49 #Dynatrace

NYC, May 2014

Page 50: Automated Deployments with Ansible

50 #Dynatrace

» They integrate nicely into your automated processes!

» Automated Deployments

» Configuration Management

» Immutable Infrastructure

» Ansible inside the Dynatrace SaaS Orchestration Platform

» Whether on-prem or SaaS: automatically tested

Dynatrace Automated Deployments. So what?

Agents, Collectors, Servers, Clients, etc.with either of Chef, Puppet or Ansible

Page 51: Automated Deployments with Ansible

51 #Dynatrace

What’s the Status?

Page 52: Automated Deployments with Ansible

52 #Dynatrace

Ansible Roles

» Dynatrace installations

» Client, Server, Collector, Agents

» Fix Packs, Plugins, Licenses

» Dynatrace Agent injections

» Platforms: Linux Windows (soon)

» Soon to come: Agent Groups, PWH Connectivity, etc.

Automated Deployments: What’s the Status?

✓ ✓

Page 53: Automated Deployments with Ansible

53 #Dynatrace

Ansible Galaxy

Page 54: Automated Deployments with Ansible

54 #Dynatrace

Dynatrace GitHub Organization

Page 55: Automated Deployments with Ansible

55 #Dynatrace

Chef Cookbook

» Customers have provided their own implementions

» We will clean them up and open-source them soon

Puppet Module

» Being developed in-house in our Linz lab

Automated Deployments: What’s the Status?

Page 56: Automated Deployments with Ansible

56 #Dynatrace

Introduction to Ansible Concepts

Page 57: Automated Deployments with Ansible

57 #Dynatrace

Ansible Concepts: Inventories

Page 58: Automated Deployments with Ansible

58 #Dynatrace

Specify the environment Ansible operates in.

» Groups and hosts are defined in inventories

» Use inventories for staging and production

» Text files expressed in an INI-like format

Ansible Concepts: Inventories

Page 59: Automated Deployments with Ansible

59 #Dynatrace

Ansible Concepts: Inventories

Page 60: Automated Deployments with Ansible

60 #Dynatrace

Ansible Concepts: Inventories

GroupHost

Numeric Range

Alphabetic Range

# production

[balancers]

www.example.com

[webservers]

www[0-9].example.com

[dbservers]

db[a:f].example.com

[monitoring]

dynatrace.example.com

Page 61: Automated Deployments with Ansible

61 #Dynatrace

Ansible Concepts: Playbooks

Page 62: Automated Deployments with Ansible

62 #Dynatrace

Defines sequences of tasks (Plays) to be executed on a group of hosts.

» Describes policies machines under management shall enforce

» Contains variables, tasks, handlers, files, templates and roles

» Expressed in YAML

Ansible Concepts: Playbooks

Page 63: Automated Deployments with Ansible

63 #Dynatrace

--- # webservers.yml

- hosts: webservers

tasks:

- name: Install Apache HTTP Server

apt: name=apache2 update_cache=yes

- name: Install Apache Modules

apache2_module: name={{ item }} state=present

with_items:

- proxy

- proxy_httpd

notify: reload apache2

handlers:

- name: reload apache2

service: name=apache2 state=reloaded

remote_user: deploy

sudo: yes

Ansible Concepts: Playbooks

List of plays

Group of hosts

DocumentationModule Arguments

Variable

Notify handler

Only on state changeDebounced

List of tasks

Restart service

Page 64: Automated Deployments with Ansible

64 #Dynatrace

Ansible Concepts: Playbooks

Page 65: Automated Deployments with Ansible

65 #Dynatrace

--- # playbook.yml

- include: dbservers.yml

- include: webservers.yml

- include: balancers.yml

- include: monitoring.yml

Ansible Concepts: Playbooks

One to rule them all

Page 66: Automated Deployments with Ansible

66 #Dynatrace

Ansible Concepts: Roles

Page 67: Automated Deployments with Ansible

67 #Dynatrace

The best way to organize your playbooks.

» Structure content into related vars, tasks, files, handlers, etc.

» File structure for automated inclusion of role-specific content

» Roles can be shared and pulled from Ansible Galaxy, GitHub, etc.

Ansible Concepts: Roles

Page 68: Automated Deployments with Ansible

68 #Dynatrace

Deployment Automation of Dynatracewith Ansible

in 3 simple steps

Page 69: Automated Deployments with Ansible

69 #Dynatrace

Simulated Production Environment: easyTravel

Page 70: Automated Deployments with Ansible

70 #Dynatrace

Simulated Production Environment: easyTravel

Page 71: Automated Deployments with Ansible

71 #Dynatrace

Deployment Scenario I: Install Server & Collector

Page 72: Automated Deployments with Ansible

72 #Dynatrace

Deployment Scenario II: Inject Agents

Page 73: Automated Deployments with Ansible

73 #Dynatrace

Deployment Scenario:Install Server & Collector

Page 74: Automated Deployments with Ansible

74 #Dynatrace

1. Gather Dependencies

Page 75: Automated Deployments with Ansible

75 #Dynatrace

Ansible Galaxy: Dynatrace-Server

Page 76: Automated Deployments with Ansible

76 #Dynatrace

2. Specify Environment

Page 77: Automated Deployments with Ansible

77 #Dynatrace

Identify Hosts

dynatrace.easytravel.com

Monitoring

Page 78: Automated Deployments with Ansible

78 #Dynatrace

3. Execute Playbook

Page 79: Automated Deployments with Ansible

79 #Dynatrace

Deployment Scenario:Inject Agents

Page 80: Automated Deployments with Ansible

80 #Dynatrace

1. Gather Dependencies

Page 81: Automated Deployments with Ansible

81 #Dynatrace

Identify Technologies

Apache HTTP Server

Apache Tomcat

Page 82: Automated Deployments with Ansible

82 #Dynatrace

Ansible Galaxy: Dynatrace-Apache-HTTPServer-Agent

Page 83: Automated Deployments with Ansible

83 #Dynatrace

Ansible Galaxy: Dynatrace-Tomcat-Agent

Page 84: Automated Deployments with Ansible

84 #Dynatrace

2. Specify Environment

Page 85: Automated Deployments with Ansible

85 #Dynatrace

Identify Hosts

www.easytravel.com

frontend.easytravel.com

backend.easytravel.com

Web Server

Application Servers

Page 86: Automated Deployments with Ansible

86 #Dynatrace

3. Execute Playbook

Page 87: Automated Deployments with Ansible

87 #Dynatrace

Dynatrace Client: Agent Connection Status5

Page 88: Automated Deployments with Ansible

88 #Dynatrace

Dynatrace Client: Transaction Flow

Page 89: Automated Deployments with Ansible

89 #Dynatrace

Questions?

Page 90: Automated Deployments with Ansible

90 #Dynatrace

Blogs

» Continuous Delivery 101: Automated Deployments

» How to Automate Enterprise Application Monitoring with Ansible

Presentations

» Automated Deployments: Hands-On Training

» Dynatrace Inside Continuous Delivery

Tutorials

» Automated Deployments with Dynatrace and Ansible

Additional Resources

Page 91: Automated Deployments with Ansible

91 #Dynatrace

Thank Youwww.dynatrace.com