drupal development, deployment, and automation with puppet

18
Drupal Development, Deployment and Automation with Puppet David Porter Rackspace Hosting Puppet Camp Austin April 2013

Upload: puppet-labs

Post on 09-Jun-2015

3.939 views

Category:

Technology


0 download

DESCRIPTION

"Drupal development, deployment, and automation with Puppet" by David Porter at Puppet Camp Austin 2013.

TRANSCRIPT

Page 1: Drupal development, deployment, and automation with Puppet

Drupal Development, Deployment and Automation with Puppet

David Porter Rackspace Hosting

Puppet Camp Austin April 2013

Page 2: Drupal development, deployment, and automation with Puppet

2

Tools

• Ubuntu • Apache HTTP Server • MySQL (Rackspace Cloud Databases) • PHP • Drupal • Varnish Cache

To get started, you need a fresh cloud server instance (or other server) running Ubuntu, with root or sudo access. You will also need a fresh database, with the host and user credentials handy to complete the Drupal install.

That's it! Now that you have these items, lets begin.

Page 3: Drupal development, deployment, and automation with Puppet

3

Step 1: Update your package manager

apt-get update

Updating your package manager ensures you have access to the latest software packages

Page 4: Drupal development, deployment, and automation with Puppet

4

Step 2: Install Puppet

apt-get install puppet

Puppet is available via the common repos. Installation is easy and we will add our own drupalstack puppet module to set everything up.

Page 5: Drupal development, deployment, and automation with Puppet

5

Step 3: Install git

apt-get install git-core

We will need git to clone this repo and obtain the base Drupal application code and drupalstack Puppet module.

Page 6: Drupal development, deployment, and automation with Puppet

6

Step 4: Clone this repo

git clone https://github.com/bighappyface/drupal-cloud-tutorial.git

Now that we have the code we can configure this server to run our Drupal application

Page 7: Drupal development, deployment, and automation with Puppet

7

Step 5: Copy module to the Puppet modules folder cp -r drupal-cloud-tutorial/drupalstack /etc/puppet/modules/drupalstack

All Puppet modules from the Puppet Forge will be installed here as well.

Page 8: Drupal development, deployment, and automation with Puppet

8

Step 6: Install Apache and configure

puppet apply -e "include drupalstack::apache"

This class follows a standard pattern in Puppet:

Package/File/Service

Page 9: Drupal development, deployment, and automation with Puppet

9

Step 7: Install PHP

puppet apply -e "include drupalstack::php"

This class is very simple: install PHP and the necessary extensions for Drupal. Also, it installs libapache2-mod-php5 to ensure Apache and PHP work together.

Page 10: Drupal development, deployment, and automation with Puppet

10

Step 8: Install and centralize Drupal

puppet apply -e "include drupalstack::drupalcore"

This technique provides a simple method of upgrading/downgrading Drupal Core without modifying or deploying your application code.

To change Drupal Core, simply update the "$drupal_version" variable to the desired version and run the class.

Page 11: Drupal development, deployment, and automation with Puppet

11

Step 9: Configure Drupal requirements

puppet apply -e "include drupalstack::drupalapp"

This class provides the most common final steps of setting up a new Drupal site.

Page 12: Drupal development, deployment, and automation with Puppet

12

Lessons Learned - Development

Our Drupal application code is decoupled from a full copy of Drupal core.

• Application-specific code under version control • Small file size • Easy upgrade of Drupal core via symlink update

Page 13: Drupal development, deployment, and automation with Puppet

13

Our Drupal application is wrapped within a Puppet module that defines the full application stack necessary to run our whole application.

• Application-specific stack configuration and essentials • Fire-and-forget design to deploy servers and application in isolation

• Configuration under version control to adapt deployment process with application overtime.

Lessons Learned - Deployment

Page 14: Drupal development, deployment, and automation with Puppet

14

Our Puppet module provides a convenient and reliable method for maintaining our application configurations and dependencies.

• Application-specific package, service, and file inventory and documentation

• Configuration under version control to adapt dependencies with application overtime

• Limitless expansion and enhancement options for logging, monitoring, caching, etc.

Lessons Learned - Automation

Page 15: Drupal development, deployment, and automation with Puppet

15

Install Varnish cache, an HTTP accelerator. We can install it on our server using a Drupal-specific configuration and store the raw HTTP output of our application in memory, along with all resources.

To get it going, apply the Puppet class as shown below: puppet apply -e "include drupalstack::varnish"

Bonus – HTTP Accelerator

Page 16: Drupal development, deployment, and automation with Puppet

16

Can you think of a class that could combine these steps into a single step?

With tools like Vagrant, could we tie our Puppet module into a provisioning service to automate spawning instances and applying our module?

For deployment, could offerings such as Cloud Backup, Cloud Load Balancers, and Cloud Monitoring be integrated to improve your applications stability, scalability, and reliability?

Next Steps

Page 17: Drupal development, deployment, and automation with Puppet

17

Discussion

Page 18: Drupal development, deployment, and automation with Puppet

18