SlideShare a Scribd company logo
Ansible + Drupal
A fortuitous DevOps Match
#MidCamp 2015
Jeff Geerling
Technical Architect, Acquia
________________________________________
/ "Automation shouldn't be your day job" 
 #ansible #pycon2014 /
----------------------------------------
 ^__^
 (oo)_______
(__) )/
||----w |
|| ||
Who am I?
Jeff Geerling (geerlingguy)

Technical Architect, Acquia

Owner, Midwestern Mac LLC

Dev (mainly)
Ansible for DevOps
On LeanPub

Nearly complete!

50% off: http://bit.ly/midcamp-a4d
Problems
Growing infrastructure.

Drupal deployments are complex.

More deployments, more downtime.

<insert your problem here>
“Configuration management for humans.” (— Me, 2014)

Uses SSH

Secure, fast, simple

Don't need configuration management to manage your configuration
management.
Over 270 modules built-in

Over 3,000 roles on Ansible Galaxy

Extensible, modular APIs (JSON, language-agnostic)
Installation
Mac: brew install ansible

Python pip: sudo pip install ansible

RHEL/CentOS: sudo yum install ansible

Deb/Ubuntu: sudo apt-add-repository ppa:ansible/ansible

sudo apt-get update

sudo apt-get install ansible
Ansible 101
1. Inventory: Describe your infrastructure

2. Ad-Hoc commands: Run one-off tasks

3. Playbooks: "Infrastructure as code"
________________________________________
/ Drupal 8 on a cluster of Raspberry Pis 
 #dramble /
----------------------------------------
 ^__^
 (oo)_______
(__) )/
||----w |
|| ||
http://robmyers.org/cc-ironies/no_flash_photography_sign/
Please help me avoid the

Xenon Death Flash
The #Dramble
CPU 24 cores / 5.4 GHz
RAM 6 GB
Storage 96 GB microSD
Network 10/100 over Gigabit network
Ansible + Drupal: A Fortuitous DevOps Match
Inventory
Like a hosts file for Ansible (/etc/ansible/hosts)

INI syntax
[webservers]
www1.pidramble.com
www2.pidramble.com
www3.pidramble.com
Inventory
Like a hosts file for Ansible (/etc/ansible/hosts)

INI syntax
[webservers]
www1.pidramble.com
www2.pidramble.com
www3.pidramble.com
Group
Servers in group
Ad-Hoc commands
Test Ansible's connection with the ping module.
$ ansible webservers -m ping
Ad-Hoc commands
Test Ansible's connection with the ping module.
$ ansible webservers -m ping
Group
Module
Ansible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps Match
Ad-Hoc commands
Have fun with RGB LEDs!
$ ansible webservers -a "rgb red" -s
Ad-Hoc commands
Have fun with RGB LEDs!
$ ansible webservers -a "rgb red" -s
Group
'Use sudo'
Command
________
< Shiny! >
--------
 ^__^
 (oo)_______
(__) )/
||----w |
|| ||
Ad-Hoc commands
$ ansible webservers -a "sudo apt-get install php5-common"
Ad-Hoc commands
$ ansible webservers -m apt -a "name=php5-common state=installed" -s
Module Arguments
Playbooks
Ad-Hoc commands don't solve the
snowflake problem

"infrastructure as code"

Simple YAML files

Run with: ansible-playbook
Unique, by Pen Waggener
Playbooks
---
- hosts: webservers
sudo: yes
tasks:
- name: Ensure PHP is installed.
apt: name=php5-common state=installed
Playbooks
---
- hosts: webservers
sudo: yes
tasks:
- name: Ensure PHP is installed.
apt: name=php5-common state=installed
Group
Module
Documentation
Arguments
Playbooks
Includes: include playbooks in other playbooks

Variables: flexible - defaults and easy overrides

Templates: use Jinja2 (Twig-like syntax!)

Roles: encapsulate 'chunks' of configuration (like PHP classes)
Back to the #Dramble
“Drupal 8 on a cluster
of Raspberry Pis”
Architecture
Architecture
Architecture
Architecture
Architecture
---
- hosts: database
sudo: yes
vars_files:
- ../vars.yml
- vars.yml
roles:
- geerlingguy.firewall
- geerlingguy.mysql
- geerlingguy.munin-node
- ../roles/leds
Fully functioning MySQL server
in 13 lines of YAML!
Provisioning the Servers
No live demo: "Never rely on Conference WiFi"

But we can talk about it later :-)
Deploying Drupal 8
Demo
See: raspberry-pi-dramble on GitHub
Deploying Drupal 8
1. First deploy: install

$ ansible-playbook main.yml
2. Second deploy: update, import config, rebuild caches

$ ansible-playbook main.yml --extra-vars "drupal_version=1.1.1"
3. Third deploy: enable Redis

$ ansible-playbook main.yml --extra-vars "drupal_version=1.1.1
drupal_redis_enabled=true"
Ansible + Drupal: A Fortuitous DevOps Match
$ wrk -t4 -c100 -d20 http://pidramble.com/
Running 20s test @ http://pidramble.com/
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 45.19ms 21.19ms 350.10ms 89.04%
Req/Sec 555.98 43.24 804.00 92.67%
44183 requests in 20.00s, 222.31MB read
Requests/sec: 2209.20
Transfer/sec: 11.12MB
$ wrk -t4 -c24 -d20 http://pidramble.com/?nocache=true
Running 20s test @ http://pidramble.com/?nocache=true
4 threads and 24 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.62s 240.73ms 2.16s 63.33%
Req/Sec 3.10 0.61 4.00 63.33%
288 requests in 20.03s, 1.45MB read
Socket errors: connect 0, read 0, write 0, timeout 10
Requests/sec: 14.38
Transfer/sec: 73.89KB
Cached req/s:
2209.20
Uncached req/s:
14.38
____________________________________
/ Drupal 8 is scalable, but not fast 
 ...yet. /
------------------------------------
 ^__^
 (oo)_______
(__) )/
||----w |
|| ||
MORE DRAMBLE!
Tons of benchmarks

D8 performance and deployment discovery

See the Raspberry Pi Dramble Wiki
MORE ANSIBLE!
Docker integration

AWS, DigitalOcean, Rackspace, Softlayer, Linode, etc.

Notifications

Rolling updates

Ansible Vault

Dynamic inventory

etc...
Resources
• Ansible documentation

• Ansible Vagrant examples

• Ansible for DevOps

• Raspberry Pi Dramble
Feedback
• https://joind.in/13825

• Speaker name: @geerlingguy

• #MidCamp

• #Dramble
50% off Ansible or DevOps:

http://bit.ly/midcamp-a4d

More Related Content

PDF
Ansible for Drupal infrastructure and deployments
PDF
DevOps for Humans - Ansible for Drupal Deployment Victory!
PDF
Ansible 101 - Presentation at Ansible STL Meetup
PDF
High Performance Drupal
PDF
Ansible Intro - June 2015 / Ansible Barcelona User Group
PPT
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
PDF
Ansible 2 and Ansible Galaxy 2
PDF
Network Automation with Ansible
Ansible for Drupal infrastructure and deployments
DevOps for Humans - Ansible for Drupal Deployment Victory!
Ansible 101 - Presentation at Ansible STL Meetup
High Performance Drupal
Ansible Intro - June 2015 / Ansible Barcelona User Group
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Ansible 2 and Ansible Galaxy 2
Network Automation with Ansible

What's hot (20)

PDF
Drupal VM for Drupal 8 Dev - MidCamp 2017
PDF
Ansible Case Studies
PDF
Highly available Drupal on a Raspberry Pi cluster
PDF
Ansible
PDF
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
PPTX
DevOps, A brief introduction to Vagrant & Ansible
PDF
Ansible - Hands on Training
PDF
How Ansible Makes Automation Easy
PDF
Ansible 101
PPTX
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
PPTX
Introduction to ansible
PDF
Ansible and AWS
ODP
ansible why ?
PPTX
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
PDF
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
PDF
Deploying PHP Applications with Ansible
PDF
Ansible introduction - XX Betabeers Galicia
PDF
DevOps with Ansible
PPTX
Cyansible
PPTX
Network automation (NetDevOps) with Ansible
Drupal VM for Drupal 8 Dev - MidCamp 2017
Ansible Case Studies
Highly available Drupal on a Raspberry Pi cluster
Ansible
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
DevOps, A brief introduction to Vagrant & Ansible
Ansible - Hands on Training
How Ansible Makes Automation Easy
Ansible 101
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Introduction to ansible
Ansible and AWS
ansible why ?
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
Deploying PHP Applications with Ansible
Ansible introduction - XX Betabeers Galicia
DevOps with Ansible
Cyansible
Network automation (NetDevOps) with Ansible
Ad

Viewers also liked (20)

PDF
ProTips for Staying Sane while Working from Home
PPTX
Drupal cambs ansible for drupal april 2015
PPTX
Ansible fest Presentation slides
PDF
Turbinando Drupal com Redis
KEY
Drupal In The Cloud
PDF
Orchestration with Ansible at Fedora Project
PPTX
High Performance on Drupal 7
PPTX
Building enterprise high availability application with drupal
PDF
High Performance Drupal
PPT
Implementing High Performance Drupal Sites
KEY
Drupal High Availability High Performance 2012
PDF
Enterprise Drupal Application & Hosting Infrastructure Level Monitoring
PDF
Amazon Web Services Building Blocks for Drupal Applications and Hosting
PDF
How we build a startup with Drupal
PDF
Drupal 8 - A Brief Introduction
PDF
V2 and beyond
PPTX
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
PDF
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
PDF
Ansible tips & tricks
PDF
Growth Hacking
ProTips for Staying Sane while Working from Home
Drupal cambs ansible for drupal april 2015
Ansible fest Presentation slides
Turbinando Drupal com Redis
Drupal In The Cloud
Orchestration with Ansible at Fedora Project
High Performance on Drupal 7
Building enterprise high availability application with drupal
High Performance Drupal
Implementing High Performance Drupal Sites
Drupal High Availability High Performance 2012
Enterprise Drupal Application & Hosting Infrastructure Level Monitoring
Amazon Web Services Building Blocks for Drupal Applications and Hosting
How we build a startup with Drupal
Drupal 8 - A Brief Introduction
V2 and beyond
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
Ansible tips & tricks
Growth Hacking
Ad

Similar to Ansible + Drupal: A Fortuitous DevOps Match (20)

PDF
Ansible new paradigms for orchestration
PDF
Building and Maintaining a Distribution in Drupal 7 with Features
PDF
Lean Php Presentation
PDF
Devops with Python by Yaniv Cohen DevopShift
PDF
Drupal 8 - Core and API Changes
PDF
Ansible Tutorial.pdf
PDF
Ansible is the simplest way to automate. MoldCamp, 2015
PPTX
There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018
PDF
Hands on Docker - Launch your own LEMP or LAMP stack
PPTX
A Fabric/Puppet Build/Deploy System
PDF
Ansible Introduction
KEY
Rapid Prototyping FTW!!!
PPTX
Harmonious Development: Via Vagrant and Puppet
PDF
Lean Drupal Repositories with Composer and Drush
PDF
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
PDF
Deployer - Deployment tool for PHP
PDF
Drupal 8 DevOps . Profile and SQL flows.
PDF
Debugging Drupal - How to Debug your Drupal Application
PDF
Buildr - build like you code
PDF
Simplicity 2.0 - Get the power back
Ansible new paradigms for orchestration
Building and Maintaining a Distribution in Drupal 7 with Features
Lean Php Presentation
Devops with Python by Yaniv Cohen DevopShift
Drupal 8 - Core and API Changes
Ansible Tutorial.pdf
Ansible is the simplest way to automate. MoldCamp, 2015
There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018
Hands on Docker - Launch your own LEMP or LAMP stack
A Fabric/Puppet Build/Deploy System
Ansible Introduction
Rapid Prototyping FTW!!!
Harmonious Development: Via Vagrant and Puppet
Lean Drupal Repositories with Composer and Drush
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
Deployer - Deployment tool for PHP
Drupal 8 DevOps . Profile and SQL flows.
Debugging Drupal - How to Debug your Drupal Application
Buildr - build like you code
Simplicity 2.0 - Get the power back

More from Jeff Geerling (11)

PDF
Continuous Testing with Molecule, Ansible, and GitHub Actions
PDF
2020 Drupal Local Development Tools Survey - CMS Philly
PDF
There's a role for that! (AnsibleFest 2019)
PDF
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
PDF
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
PDF
Make your Ansible playbooks maintainable, flexible, and scalable
PDF
Ansible and Kubernetes
PDF
HTTPS and Ansible
PDF
Server Check.in case study - Drupal and Node.js
PPT
Florissant TIF - Cross Keys Redevelopment
PDF
How to Build a Drupal Module
Continuous Testing with Molecule, Ansible, and GitHub Actions
2020 Drupal Local Development Tools Survey - CMS Philly
There's a role for that! (AnsibleFest 2019)
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Make your Ansible playbooks maintainable, flexible, and scalable
Ansible and Kubernetes
HTTPS and Ansible
Server Check.in case study - Drupal and Node.js
Florissant TIF - Cross Keys Redevelopment
How to Build a Drupal Module

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Introduction to Artificial Intelligence
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Nekopoi APK 2025 free lastest update
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
history of c programming in notes for students .pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
medical staffing services at VALiNTRY
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
L1 - Introduction to python Backend.pptx
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
CHAPTER 2 - PM Management and IT Context
Odoo Companies in India – Driving Business Transformation.pdf
Introduction to Artificial Intelligence
How to Choose the Right IT Partner for Your Business in Malaysia
Nekopoi APK 2025 free lastest update
How to Migrate SBCGlobal Email to Yahoo Easily
history of c programming in notes for students .pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
medical staffing services at VALiNTRY
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
VVF-Customer-Presentation2025-Ver1.9.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PTS Company Brochure 2025 (1).pdf.......
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Odoo POS Development Services by CandidRoot Solutions
L1 - Introduction to python Backend.pptx
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
CHAPTER 2 - PM Management and IT Context

Ansible + Drupal: A Fortuitous DevOps Match