This presentation starts with an introduction to the rationale behind automated deployments in Continuous Delivery and DevOps. Then, I compare agent-based architectures, such as Chef and Puppet with the agentless architecture of the server orchestration engine Ansible. The presentation concludes with an automated deployment of Dynatrace into a simulated production environment.
1. 1 #Dynatrace
South Florida User Group, Fort Lauderdale, 31st March 2015
Martin Etmajer, Technology Strategist @Dynatrace
Automated Deployments
with Ansible
9. 9 #Dynatrace
Utmost Goal: Minimize Cycle Time
feature cycle time time
Customer
This is when you
create value!
minimize
10. 10 #Dynatrace
Utmost Goal: Minimize Cycle Time
feature cycle time time
Customer
You
This is when you
create value!
minimize
11. 11 #Dynatrace
Utmost Goal: Minimize Cycle Time
feature cycle time time
Customer
You
minimize
It’s about getting your features into your user’s hands
as quickly as possible!
12. 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. 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
20. 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. 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 problems
and be creative!
Repetitive tasks
22. 22 #Dynatrace
What?
» Operating Systems, Drivers
» Middleware, Databases, etc.
» Applications, Dependencies, Data
Automated Deployments
}+ Configuration
23. 23 #Dynatrace
How?
» Infrastructure as Code!
» Keep everything in Version Control
» Code
» Configuration
» Data
» Align Development and Operations
Automated Deployments
Everything that affects
application state
26. 26 #Dynatrace
Align Development and Operations
OPERATIONS
DEVELOPMENT
current iteration
(e.g. 2 weeks)
time
Planning
Implementing
and testing
27. 27 #Dynatrace
Align Development and Operations
OPERATIONS
DEVELOPMENT
current iteration
(e.g. 2 weeks)
time
Planning
Implementing
and testing
Working and
deployable code
28. 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
48. 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)
50. 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
55. 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?
58. 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
62. 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. 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
Documentation
Module Arguments
Variable
Notify handler
Only on state changeDebounced
List of tasks
Restart service
67. 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
Cycle time is the most relevant metric in the software delivery process.
“How long would it take your organization to deploy a change that involves just one single line of code?” Mary Poppendieck
Cycle time is the most relevant metric in the software delivery process.
“How long would it take your organization to deploy a change that involves just one single line of code?” Mary Poppendieck
Cycle time is the most relevant metric in the software delivery process.
“How long would it take your organization to deploy a change that involves just one single line of code?” Mary Poppendieck
Cycle time is the most relevant metric in the software delivery process.
“How long would it take your organization to deploy a change that involves just one single line of code?” Mary Poppendieck
Cycle time is the most relevant metric in the software delivery process.
“How long would it take your organization to deploy a change that involves just one single line of code?” Mary Poppendieck
Doubtlessly, automation if of high relevance in Continuous Delivery...
Manage complex multi-tier deployments in a controlled fashion:
Deploy the database before deploying web servers and enabling new web server code
Configure the database with the web servers IP addresses so they can connect to it
Add the web servers to a load balancing pool
Add the servers to a pool of monitored hosts
Manage complex multi-tier deployments in a controlled fashion:
Deploy the database before deploying web servers and enabling new web server code
Configure the database with the web servers IP addresses so they can connect to it
Add the web servers to a load balancing pool
Add the servers to a pool of monitored hosts
Manage complex multi-tier deployments in a controlled fashion:
Deploy the database before deploying web servers and enabling new web server code
Configure the database with the web servers IP addresses so they can connect to it
Add the web servers to a load balancing pool
Add the servers to a pool of monitored hosts
Suppose that later on we want to update our web servers:
Take a web server node out of monitoring and load balancing pools
Update the web server code, adapt the database schema and run smoke tests
Reintegrate
Suppose that later on we want to update our web servers:
Take a web server node out of monitoring and load balancing pools
Update the web server code, adapt the database schema and run smoke tests
Reintegrate
Suppose that later on we want to update our web servers:
Take a web server node out of monitoring and load balancing pools
Update the web server code, adapt the database schema and run smoke tests
Reintegrate
Other prominent customers who leverage Ansible Tower are: GoPro, Electronic Arts, Hughes and the NASA.
Manage complex multi-tier deployments in a controlled fashion:
Deploy the database before deploying web servers and enabling new web server code
Configure the database with the web servers IP addresses so they can connect to it
Add the web servers to a load balancing pool
Add the servers to a pool of monitored hosts
Manage complex multi-tier deployments in a controlled fashion:
Deploy the database before deploying web servers and enabling new web server code
Configure the database with the web servers IP addresses so they can connect to it
Add the web servers to a load balancing pool
Add the servers to a pool of monitored hosts