Drupal development, deployment, and automation with Puppet

4,916 views

Published on

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

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,916
On SlideShare
0
From Embeds
0
Number of Embeds
356
Actions
Shares
0
Downloads
15
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Drupal development, deployment, and automation with Puppet

  1. 1. Drupal Development, Deploymentand Automation with PuppetDavid PorterRackspace HostingPuppet Camp AustinApril 2013
  2. 2. 2Tools•  Ubuntu•  Apache HTTP Server•  MySQL (Rackspace Cloud Databases)•  PHP•  Drupal•  Varnish CacheTo get started, you need a fresh cloud server instance (or other server)running Ubuntu, with root or sudo access. You will also need a freshdatabase, with the host and user credentials handy to complete the Drupalinstall.Thats it! Now that you have these items, lets begin.
  3. 3. 3Step 1: Update your package managerapt-get updateUpdating your package manager ensures you haveaccess to the latest software packages
  4. 4. 4Step 2: Install Puppetapt-get install puppetPuppet is available via the common repos. Installation iseasy and we will add our own drupalstack puppetmodule to set everything up.
  5. 5. 5Step 3: Install gitapt-get install git-coreWe will need git to clone this repo and obtain the baseDrupal application code and drupalstack Puppetmodule.
  6. 6. 6Step 4: Clone this repogit clone https://github.com/bighappyface/drupal-cloud-tutorial.gitNow that we have the code we can configure this serverto run our Drupal application
  7. 7. 7Step 5: Copy module to the Puppetmodules foldercp -r drupal-cloud-tutorial/drupalstack /etc/puppet/modules/drupalstackAll Puppet modules from the Puppet Forge will beinstalled here as well.
  8. 8. 8Step 6: Install Apache and configurepuppet apply -e "includedrupalstack::apache"This class follows a standard pattern in Puppet:Package/File/Service
  9. 9. 9Step 7: Install PHPpuppet apply -e "include drupalstack::php"This class is very simple: install PHP and the necessaryextensions for Drupal. Also, it installs libapache2-mod-php5 to ensure Apache and PHP work together.
  10. 10. 10Step 8: Install and centralize Drupalpuppet apply -e "includedrupalstack::drupalcore"This technique provides a simple method of upgrading/downgrading Drupal Core without modifying ordeploying your application code.To change Drupal Core, simply update the"$drupal_version" variable to the desired version andrun the class.
  11. 11. 11Step 9: Configure Drupal requirementspuppet apply -e "includedrupalstack::drupalapp"This class provides the most common final steps ofsetting up a new Drupal site.
  12. 12. 12Lessons Learned - DevelopmentOur Drupal application code is decoupled from a full copyof Drupal core.• Application-specific code under version control• Small file size• Easy upgrade of Drupal core via symlink update
  13. 13. 13Our Drupal application is wrapped within a Puppetmodule that defines the full application stack necessaryto run our whole application.• Application-specific stack configuration and essentials• Fire-and-forget design to deploy servers and applicationin isolation• Configuration under version control to adapt deploymentprocess with application overtime.Lessons Learned - Deployment
  14. 14. 14Our Puppet module provides a convenient and reliablemethod for maintaining our application configurationsand dependencies.• Application-specific package, service, and file inventoryand documentation• Configuration under version control to adaptdependencies with application overtime• Limitless expansion and enhancement options forlogging, monitoring, caching, etc.Lessons Learned - Automation
  15. 15. 15Install Varnish cache, an HTTP accelerator. We caninstall it on our server using a Drupal-specificconfiguration and store the raw HTTP output of ourapplication in memory, along with all resources.To get it going, apply the Puppet class as shown below:puppet apply -e "includedrupalstack::varnish"Bonus – HTTP Accelerator
  16. 16. 16Can you think of a class that could combine these stepsinto a single step?With tools like Vagrant, could we tie our Puppet moduleinto a provisioning service to automate spawninginstances and applying our module?For deployment, could offerings such as Cloud Backup,Cloud Load Balancers, and Cloud Monitoring beintegrated to improve your applications stability,scalability, and reliability?Next Steps
  17. 17. 17Discussion
  18. 18. 18

×