Upload
martin-etmajer
View
730
Download
4
Tags:
Embed Size (px)
Citation preview
1 #Dynatrace
South Florida User Group, Fort Lauderdale, 31st March 2015
Martin Etmajer, Technology Strategist @Dynatrace
Automated Deploymentswith Ansible
2 #Dynatrace
Insertimage here
Martin Etmajer
Technology Strategist @ Dynatrace
@metmajer
3 #Dynatrace
Introduction
4 #Dynatrace
The Phoenix Project
5 #Dynatrace
The Phoenix Project: Review
6 #Dynatrace
Continuous Delivery
Reliable Software Releases throughBuild, Test and Deployment Automation
7 #Dynatrace
Utmost Goal: Minimize Cycle Time
feature cycle time time
Customer Users
8 #Dynatrace
Utmost Goal: Minimize Cycle Time
feature cycle time time
Customer minimize Users
9 #Dynatrace
Utmost Goal: Minimize Cycle Time
feature cycle time time
Customer
This is when youcreate value!
minimize
10 #Dynatrace
Utmost Goal: Minimize Cycle Time
feature cycle time time
Customer
You
This is when youcreate value!
minimize
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!
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
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
14 #Dynatrace
Continuous Delivery Deployment Pipeline
✔
15 #Dynatrace
Continuous Delivery Deployment Pipeline
✔
16 #Dynatrace
Continuous Delivery Deployment Pipeline
✔
✔
17 #Dynatrace
Continuous Delivery Deployment Pipeline
✔
✔ ✔
18 #Dynatrace
Continuous Delivery Deployment Pipeline
✔
✔ ✔ ✔
19 #Dynatrace
✔
✔ ✔ ✔
✔
Continuous Delivery Deployment Pipeline
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
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
22 #Dynatrace
What?
» Operating Systems, Drivers
» Middleware, Databases, etc.
» Applications, Dependencies, Data
Automated Deployments
} + Configuration
23 #Dynatrace
How?
» Infrastructure as Code!
» Keep everything in Version Control
» Code
» Configuration
» Data
» Align Development and Operations
Automated Deployments
Everything that affectsapplication state
24 #Dynatrace
Align Development and Operations
OPERATIONS
DEVELOPMENT
current iteration
(e.g. 2 weeks)time
25 #Dynatrace
Align Development and Operations
OPERATIONS
DEVELOPMENT
current iteration
(e.g. 2 weeks)time
Planning
26 #Dynatrace
Align Development and Operations
OPERATIONS
DEVELOPMENT
current iteration
(e.g. 2 weeks)time
Planning
Implementingand testing
27 #Dynatrace
Align Development and Operations
OPERATIONS
DEVELOPMENT
current iteration
(e.g. 2 weeks)time
Planning
Implementingand testing
Working anddeployable code
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
29 #Dynatrace
SolutionsArchitectural Comparison
30 #Dynatrace
Agent-Based ArchitecturesExamples: Chef, Puppet
31 #Dynatrace
Agent-Based Architectures
32 #Dynatrace
Agent-Based Architectures
33 #Dynatrace
Agent-Based Architectures
34 #Dynatrace
Agentless ArchitecturesExamples: Ansible
35 #Dynatrace
Ansible’s Agentless Architecture
36 #Dynatrace
Ansible’s Agentless Architecture
37 #Dynatrace
Ansible’s Agentless Architecture
38 #Dynatrace
Ansible’s Agentless Architecture
39 #Dynatrace
Ansible is an Orchestration Engine
40 #Dynatrace
Ansible is an Orchestration Engine
41 #Dynatrace
Ansible is an Orchestration Engine
42 #Dynatrace
Ansible is an Orchestration Engine
43 #Dynatrace
Ansible is an Orchestration Engine
44 #Dynatrace
Ansible is an Orchestration Engine
45 #Dynatrace
Ansible is an Orchestration Engine
46 #Dynatrace
What about Demand?
47 #Dynatrace
Global Google Trends: Chef vs. Puppet vs. Ansible
Chef
Puppet
Year #1
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)
49 #Dynatrace
NYC, May 2014
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
51 #Dynatrace
What’s the Status?
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?
✓
✓
✓
✓
✓ ✓
53 #Dynatrace
Ansible Galaxy
54 #Dynatrace
Dynatrace GitHub Organization
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?
56 #Dynatrace
Introduction to Ansible Concepts
57 #Dynatrace
Ansible Concepts: Inventories
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
59 #Dynatrace
Ansible Concepts: Inventories
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
61 #Dynatrace
Ansible Concepts: Playbooks
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
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
64 #Dynatrace
Ansible Concepts: Playbooks
65 #Dynatrace
--- # playbook.yml
- include: dbservers.yml
- include: webservers.yml
- include: balancers.yml
- include: monitoring.yml
Ansible Concepts: Playbooks
One to rule them all
66 #Dynatrace
Ansible Concepts: Roles
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
68 #Dynatrace
Deployment Automation of Dynatracewith Ansible
in 3 simple steps
69 #Dynatrace
Simulated Production Environment: easyTravel
70 #Dynatrace
Simulated Production Environment: easyTravel
71 #Dynatrace
Deployment Scenario I: Install Server & Collector
72 #Dynatrace
Deployment Scenario II: Inject Agents
73 #Dynatrace
Deployment Scenario:Install Server & Collector
74 #Dynatrace
1. Gather Dependencies
75 #Dynatrace
Ansible Galaxy: Dynatrace-Server
76 #Dynatrace
2. Specify Environment
77 #Dynatrace
Identify Hosts
dynatrace.easytravel.com
Monitoring
78 #Dynatrace
3. Execute Playbook
79 #Dynatrace
Deployment Scenario:Inject Agents
80 #Dynatrace
1. Gather Dependencies
81 #Dynatrace
Identify Technologies
Apache HTTP Server
Apache Tomcat
82 #Dynatrace
Ansible Galaxy: Dynatrace-Apache-HTTPServer-Agent
83 #Dynatrace
Ansible Galaxy: Dynatrace-Tomcat-Agent
84 #Dynatrace
2. Specify Environment
85 #Dynatrace
Identify Hosts
www.easytravel.com
frontend.easytravel.com
backend.easytravel.com
Web Server
Application Servers
86 #Dynatrace
3. Execute Playbook
87 #Dynatrace
Dynatrace Client: Agent Connection Status5
88 #Dynatrace
Dynatrace Client: Transaction Flow
89 #Dynatrace
Questions?
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
91 #Dynatrace
Thank Youwww.dynatrace.com