SlideShare a Scribd company logo
1 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
System Architects with DevOps / Security Group Meetup, Vienna
18th December 2014
Martin Etmajer, @metmajer, Technology Strategist @ Dynatrace
Introduction to
Automated Deployments with Ansible
2 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
• Automated Deployments in Continuous Delivery
• Agent-based vs. Agentless Solution Architectures
• Introduction to Ansible
Agenda
3 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Automated Deployments
in Continuous Delivery
4 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
feature cycle time time
Customer Users
Utmost Goal: Minimize Cycle Time
5 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
feature cycle time time
Customer Users
Utmost Goal: Minimize Cycle Time
minimize
6 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
feature cycle time time
Customer
Utmost Goal: Minimize Cycle Time
This is when you
create value!
minimize
7 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
feature cycle time time
Customer
Utmost Goal: Minimize Cycle Time
You
This is when you
create value!
minimize
8 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
The definition of a deployment pipeline,
which is at the heart of Continuous Delivery:
“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
“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
The Role of Automation in Continuous Delivery
9 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Manual deployments:
• are slow and prone to human errors
• are neither repeatable nor reliable
• are not consistent across environments
• are done by a few experts: hinders collaboration
• require extensive documentation: often outdated
The Problem with Manual Deployments
We are just not good at it!
10 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agent-based vs. Agentless
Solution Architectures
11 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agent-Based Solutions
12 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agent-Based Deployments (Chef, Puppet)
13 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agent-Based Deployments (Chef, Puppet)
14 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agent-Based Deployments (Chef, Puppet)
15 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
» Can be used in client-server or client-only modes
» Client must be installed on each host to be provisioned
» Clients have dependencies
» Not laid out for server orchestration by design
(do something on server A, then on server B, etc.)
» Chef and Puppet are widely considered to have a large entrance
barrier and are complex to use
Agent-Based Deployments (Chef, Puppet)
16 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agentless Solutions
17 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agentless Deployments (Ansible)
18 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agentless Deployments (Ansible)
19 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agentless Deployments (Ansible)
20 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Agentless Deployments (Ansible)
21 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible
22 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
» Written and extensible in Python
» Human- and machine-readable configuration (YAML)
» No boot-strapping required on deployment hosts (SSH)
» Statements are executed in the order they were specified
» Simple, easy to ramp up with (think of new employees!)
» Clear and concise documentation
Ansible
23 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts:
Ad-hoc Commands
24 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts: Ad-hoc Commands
ansible [-i inventory] <host-pattern> [options]
Examples?
» ansible localhost -m copy –a ‘src=/usr/bin/a dest=/usr/bin/b’
» ansible webserver –a ‘/sbin/reboot’ –f 3
–u deploy ––sudo ––ask–sudo–pass
Module Arguments
25 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts: Ad-hoc Commands
ansible [-i inventory] <host-pattern> [options]
Examples?
» ansible localhost -m copy –a ‘src=/usr/bin/a dest=/usr/bin/b’
» ansible webserver –a ‘/sbin/reboot’ –f 3
–u deploy ––sudo ––ask–sudo–pass
Processes
User Use sudo
Ask password
interactively
26 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts:
Inventories
27 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts: Inventories
» Ansible provisions groups of servers at once
» Groups and hosts are stored in inventory files
» An inventory file is expressed in the INI format
28 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts: Inventories
# production.ini
[web]
web[0-1].example.com
[frontends]
frontend.example.com
[backends]
backend.example.com
Group
Host
29 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts:
Playbooks
30 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts: Playbooks
ansible-playbook [–i <inventory>] <playbook>
Playbooks
» describe policies your remote systems shall enforce
» consist of variables, tasks, handlers, files and roles
» are expressed in the YAML format
31 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
--- # webservers.yml
- hosts: web
vars_files:
- variables.yml
handlers:
- name: reload apache2
service: name=apache2 state=reloaded
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
Ansible Concepts: Playbooks
Play
Module
32 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
...
- name: Install Apache Configuration
template: >
src=apache-config.conf.j2
dest={{ apache_conf_home }}/myapp
mode=0644
notify: reload apache2
remote_user: deploy
sudo: yes
Ansible Concepts: Playbooks
33 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
--- # variables.yml
apache_conf_home: /etc/apache2/conf.d
Ansible Concepts: Playbooks
34 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
--- # playbook.yml
- include: appservers.yml
- include: dbservers.yml
- include: webservers.yml
Ansible Concepts: Playbooks
Includes multiple plays
into a single playbook
35 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts: Playbooks
ansible-playbook –i production.ini webservers.yml
PLAY [web]
******************************************************
TASK: [Install Apache HTTP Server]
************************
changed: [web0.example.com]
changed: [web1.example.com]
...
PLAY RECAP
************************************************************************
web0.example.com : ok=3 changed=3 unreachable=0 failed=0
web1.example.com : ok=3 changed=3 unreachable=0 failed=0
Run!
36 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Modules Library
37 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Modules Library
» Cloud: AWS, Azure, DigitalOcean, Docker, Google, OpenStack,...
» Database: MySQL, Postgresql,...
» Packaging: apt, yum, easy_install, npm, homebrew, zypper,...
» Source Control: git, subversion, mercurial,...
» Web Infrastructure: apache2_module, jira,...
» System: mount, selinux, ufw, user,...
38 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts: Roles (Outlook)
39 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts: Playbooks » Roles
Roles
» Are the preferred means to organize and reuse related tasks
» Build on the idea of include files to form clean abstractions
» Can be shared and found on Ansible Galaxy
40 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace
Ansible Concepts: Playbooks » Roles
Reusing Roles in a Play
--- # webservers.yml
- hosts: web
roles:
- { role: common }
- { role: apache2 }
remote_user: deploy
sudo: yes
41 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace

More Related Content

PPTX
Automated Deployments
PPTX
(R)Evolutionize APM - APM in Continuous Delivery and DevOps
PPTX
Deploying On-Prem as SaaS: Why we go with Ansible
PDF
Continuous Delivery 101
PPTX
OSDC2014: Testing Server Infrastructure with #serverspec
PDF
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
PPTX
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
PDF
Git Power Routines
Automated Deployments
(R)Evolutionize APM - APM in Continuous Delivery and DevOps
Deploying On-Prem as SaaS: Why we go with Ansible
Continuous Delivery 101
OSDC2014: Testing Server Infrastructure with #serverspec
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Git Power Routines

What's hot (20)

PPTX
Introduction to Test Kitchen and InSpec
KEY
Michelin Starred Cooking with Chef
PPTX
Effective Testing with Ansible and InSpec
PPTX
Automated Infrastructure Testing
PDF
Bay Area Chef Meetup February
PPTX
Effective Testing with Ansible and InSpec
PDF
DevTernity - DevOps with smell
PDF
Hadoop Summit 2013 : Continuous Integration on top of hadoop
PPTX
InSpec at DevOps ATL Meetup January 22, 2020
PDF
Drupal Continuous Integration (European Drupal Days 2015)
PDF
Introduction to Infrastructure as Code & Automation / Introduction to Chef
PDF
At Your Service: Using Jenkins in Operations
PDF
Prescriptive System Security with InSpec
PDF
Rise of the Machines - Automate your Development
PDF
DevOp with Me!
PDF
Puppet Release Workflows at Jive Software
ODP
A CI/CD Pipeline to Deploy and Maintain OpenStack - cfgmgmtcamp2015
PDF
Code Reviews vs. Pull Requests
PDF
Webinar slides: Replication Topology Changes for MySQL and MariaDB
PPTX
Role of Pipelines in Continuous Delivery
Introduction to Test Kitchen and InSpec
Michelin Starred Cooking with Chef
Effective Testing with Ansible and InSpec
Automated Infrastructure Testing
Bay Area Chef Meetup February
Effective Testing with Ansible and InSpec
DevTernity - DevOps with smell
Hadoop Summit 2013 : Continuous Integration on top of hadoop
InSpec at DevOps ATL Meetup January 22, 2020
Drupal Continuous Integration (European Drupal Days 2015)
Introduction to Infrastructure as Code & Automation / Introduction to Chef
At Your Service: Using Jenkins in Operations
Prescriptive System Security with InSpec
Rise of the Machines - Automate your Development
DevOp with Me!
Puppet Release Workflows at Jive Software
A CI/CD Pipeline to Deploy and Maintain OpenStack - cfgmgmtcamp2015
Code Reviews vs. Pull Requests
Webinar slides: Replication Topology Changes for MySQL and MariaDB
Role of Pipelines in Continuous Delivery
Ad

Viewers also liked (20)

PPTX
Automated Deployments with Ansible
PDF
Ansible - Introduction
PPTX
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
PPT
Ansible presentation
PDF
Ansible Introduction
PDF
Infrastructure as Data with Ansible for easier Continuous Delivery
PDF
Monitoring @haptik
PDF
Ansible is the simplest way to automate. SymfonyCafe, 2015
PDF
Talk about Ansible and Infrastructure as Code
PPTX
Automating aws infrastructure and code deployments using Ansible @WebEngage
PPTX
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
PPTX
Ansible presentation
PPTX
Ansible presentation
PDF
Présentation des nouveautés de Zabbix 3.2 - Zabbix Toulouse #1 - ZUG
PDF
Ansible Overview - System Administration and Maintenance
PDF
Ansible과 CloudFormation을 이용한 배포 자동화
PDF
Ansible Oxford - Cows & Containers
PDF
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix Scale
PDF
Monitoring all Elements of Your Database Operations With Zabbix
PDF
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Automated Deployments with Ansible
Ansible - Introduction
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Ansible presentation
Ansible Introduction
Infrastructure as Data with Ansible for easier Continuous Delivery
Monitoring @haptik
Ansible is the simplest way to automate. SymfonyCafe, 2015
Talk about Ansible and Infrastructure as Code
Automating aws infrastructure and code deployments using Ansible @WebEngage
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Ansible presentation
Ansible presentation
Présentation des nouveautés de Zabbix 3.2 - Zabbix Toulouse #1 - ZUG
Ansible Overview - System Administration and Maintenance
Ansible과 CloudFormation을 이용한 배포 자동화
Ansible Oxford - Cows & Containers
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix Scale
Monitoring all Elements of Your Database Operations With Zabbix
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ad

Similar to Introduction to Automated Deployments with Ansible (20)

PDF
Automated Deployment and Configuration Engines. Ansible
PPTX
Learn you some Ansible for great good!
PDF
DevOps for Humans - Ansible for Drupal Deployment Victory!
PDF
Automated deployment
PDF
Ansible.pdf
PDF
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
PDF
Network Automation With Ansible 1st Edition by Jason Edelman ISBN
PDF
Network Automation With Ansible 1st Edition by Jason Edelman ISBN
PDF
Smau Milano 2016 - Fabio Alessandro Locati
PDF
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
PDF
Network Automation With Ansible 1st Edition by Jason Edelman ISBN
PDF
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
PDF
Learning Ansible 2 2nd Edition Fabio Alessandro Locati
PDF
Learning Ansible 2 2nd Edition Fabio Alessandro Locati
PDF
Devops with Python by Yaniv Cohen DevopShift
PPTX
Go Faster with Ansible (PHP meetup)
PDF
Ansible at work
PDF
What we talk about when we talk about DevOps
PDF
Getting Started with Ansible - Jake.pdf
PPTX
Mastering_Ansible_PAnsible_Presentation our score increases as you pick a
Automated Deployment and Configuration Engines. Ansible
Learn you some Ansible for great good!
DevOps for Humans - Ansible for Drupal Deployment Victory!
Automated deployment
Ansible.pdf
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
Network Automation With Ansible 1st Edition by Jason Edelman ISBN
Network Automation With Ansible 1st Edition by Jason Edelman ISBN
Smau Milano 2016 - Fabio Alessandro Locati
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Network Automation With Ansible 1st Edition by Jason Edelman ISBN
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Learning Ansible 2 2nd Edition Fabio Alessandro Locati
Learning Ansible 2 2nd Edition Fabio Alessandro Locati
Devops with Python by Yaniv Cohen DevopShift
Go Faster with Ansible (PHP meetup)
Ansible at work
What we talk about when we talk about DevOps
Getting Started with Ansible - Jake.pdf
Mastering_Ansible_PAnsible_Presentation our score increases as you pick a

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Modernizing your data center with Dell and AMD
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Empathic Computing: Creating Shared Understanding
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Machine learning based COVID-19 study performance prediction
The Rise and Fall of 3GPP – Time for a Sabbatical?
Modernizing your data center with Dell and AMD
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Empathic Computing: Creating Shared Understanding
Reach Out and Touch Someone: Haptics and Empathic Computing
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
CIFDAQ's Market Insight: SEC Turns Pro Crypto

Introduction to Automated Deployments with Ansible

  • 1. 1 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace System Architects with DevOps / Security Group Meetup, Vienna 18th December 2014 Martin Etmajer, @metmajer, Technology Strategist @ Dynatrace Introduction to Automated Deployments with Ansible
  • 2. 2 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace • Automated Deployments in Continuous Delivery • Agent-based vs. Agentless Solution Architectures • Introduction to Ansible Agenda
  • 3. 3 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Automated Deployments in Continuous Delivery
  • 4. 4 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace feature cycle time time Customer Users Utmost Goal: Minimize Cycle Time
  • 5. 5 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace feature cycle time time Customer Users Utmost Goal: Minimize Cycle Time minimize
  • 6. 6 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace feature cycle time time Customer Utmost Goal: Minimize Cycle Time This is when you create value! minimize
  • 7. 7 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace feature cycle time time Customer Utmost Goal: Minimize Cycle Time You This is when you create value! minimize
  • 8. 8 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace The definition of a deployment pipeline, which is at the heart of Continuous Delivery: “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 “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 The Role of Automation in Continuous Delivery
  • 9. 9 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Manual deployments: • are slow and prone to human errors • are neither repeatable nor reliable • are not consistent across environments • are done by a few experts: hinders collaboration • require extensive documentation: often outdated The Problem with Manual Deployments We are just not good at it!
  • 10. 10 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agent-based vs. Agentless Solution Architectures
  • 11. 11 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agent-Based Solutions
  • 12. 12 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agent-Based Deployments (Chef, Puppet)
  • 13. 13 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agent-Based Deployments (Chef, Puppet)
  • 14. 14 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agent-Based Deployments (Chef, Puppet)
  • 15. 15 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace » Can be used in client-server or client-only modes » Client must be installed on each host to be provisioned » Clients have dependencies » Not laid out for server orchestration by design (do something on server A, then on server B, etc.) » Chef and Puppet are widely considered to have a large entrance barrier and are complex to use Agent-Based Deployments (Chef, Puppet)
  • 16. 16 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agentless Solutions
  • 17. 17 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agentless Deployments (Ansible)
  • 18. 18 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agentless Deployments (Ansible)
  • 19. 19 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agentless Deployments (Ansible)
  • 20. 20 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Agentless Deployments (Ansible)
  • 21. 21 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible
  • 22. 22 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace » Written and extensible in Python » Human- and machine-readable configuration (YAML) » No boot-strapping required on deployment hosts (SSH) » Statements are executed in the order they were specified » Simple, easy to ramp up with (think of new employees!) » Clear and concise documentation Ansible
  • 23. 23 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Ad-hoc Commands
  • 24. 24 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Ad-hoc Commands ansible [-i inventory] <host-pattern> [options] Examples? » ansible localhost -m copy –a ‘src=/usr/bin/a dest=/usr/bin/b’ » ansible webserver –a ‘/sbin/reboot’ –f 3 –u deploy ––sudo ––ask–sudo–pass Module Arguments
  • 25. 25 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Ad-hoc Commands ansible [-i inventory] <host-pattern> [options] Examples? » ansible localhost -m copy –a ‘src=/usr/bin/a dest=/usr/bin/b’ » ansible webserver –a ‘/sbin/reboot’ –f 3 –u deploy ––sudo ––ask–sudo–pass Processes User Use sudo Ask password interactively
  • 26. 26 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Inventories
  • 27. 27 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Inventories » Ansible provisions groups of servers at once » Groups and hosts are stored in inventory files » An inventory file is expressed in the INI format
  • 28. 28 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Inventories # production.ini [web] web[0-1].example.com [frontends] frontend.example.com [backends] backend.example.com Group Host
  • 29. 29 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Playbooks
  • 30. 30 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Playbooks ansible-playbook [–i <inventory>] <playbook> Playbooks » describe policies your remote systems shall enforce » consist of variables, tasks, handlers, files and roles » are expressed in the YAML format
  • 31. 31 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace --- # webservers.yml - hosts: web vars_files: - variables.yml handlers: - name: reload apache2 service: name=apache2 state=reloaded 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 Ansible Concepts: Playbooks Play Module
  • 32. 32 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace ... - name: Install Apache Configuration template: > src=apache-config.conf.j2 dest={{ apache_conf_home }}/myapp mode=0644 notify: reload apache2 remote_user: deploy sudo: yes Ansible Concepts: Playbooks
  • 33. 33 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace --- # variables.yml apache_conf_home: /etc/apache2/conf.d Ansible Concepts: Playbooks
  • 34. 34 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace --- # playbook.yml - include: appservers.yml - include: dbservers.yml - include: webservers.yml Ansible Concepts: Playbooks Includes multiple plays into a single playbook
  • 35. 35 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Playbooks ansible-playbook –i production.ini webservers.yml PLAY [web] ****************************************************** TASK: [Install Apache HTTP Server] ************************ changed: [web0.example.com] changed: [web1.example.com] ... PLAY RECAP ************************************************************************ web0.example.com : ok=3 changed=3 unreachable=0 failed=0 web1.example.com : ok=3 changed=3 unreachable=0 failed=0 Run!
  • 36. 36 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Modules Library
  • 37. 37 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Modules Library » Cloud: AWS, Azure, DigitalOcean, Docker, Google, OpenStack,... » Database: MySQL, Postgresql,... » Packaging: apt, yum, easy_install, npm, homebrew, zypper,... » Source Control: git, subversion, mercurial,... » Web Infrastructure: apache2_module, jira,... » System: mount, selinux, ufw, user,...
  • 38. 38 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Roles (Outlook)
  • 39. 39 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Playbooks » Roles Roles » Are the preferred means to organize and reuse related tasks » Build on the idea of include files to form clean abstractions » Can be shared and found on Ansible Galaxy
  • 40. 40 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace Ansible Concepts: Playbooks » Roles Reusing Roles in a Play --- # webservers.yml - hosts: web roles: - { role: common } - { role: apache2 } remote_user: deploy sudo: yes
  • 41. 41 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Dynatrace

Editor's Notes

  • #5: 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
  • #6: 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
  • #7: 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
  • #8: 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
  • #9: Doubtlessly, automation if of high relevance in Continuous Delivery...
  • #10: Speaking of deployments...
  • #13: Note: terms “agent” and “client” are used interchangeably
  • #14: Note: terms “agent” and “client” are used interchangeably
  • #15: Note: terms “agent” and “client” are used interchangeably
  • #25: Ad-hoc commands are a great way to test commands on the command line, however, for real server orchestration, there’s a much more powerful concept: Ansible Playbooks.
  • #26: Ad-hoc commands are a great way to test commands on the command line, however, for real server orchestration, there’s a much more powerful concept: Ansible Playbooks.
  • #31: ad “-i inventory”: if not specified, will assume an inventory file in /etc/ansible/hosts
  • #32: Everything you see here is executed in order. ad “play”: A play maps a group of hosts to a set of tasks. By composing a playbook of multiple plays, it is possible to orchestrate multi-server deployments: run certain tasks on the group of webservers, then some tasks on the group of dbservers, then some more commands back on the webservers group, etc.