Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automating Development Environments (Drupal Dev Days 2013)

Automating Development Environments (Drupal Dev Days 2013)

In this talk, I explained how we're using Chef to automate the setup of Vagrant VMs for our development environment freistilbox Solo.

Jochen Lillich

June 30, 2013

More Decks by Jochen Lillich

Other Decks in Technology


  1. “Well, I’ve been doing that for ages with... •... snapshots!”

    •...VM images!” •...somethingorother!”
  2. “No matter how complex the realities of your business, Chef

    makes it easy to deploy servers and scale applications throughout your entire infrastructure.” http://www.opscode.com/chef/
  3. Attribute A value used in resource definitions that can differ

    from node to node. •PHP memory limit •Number of CPU’s
  4. +

  5. Vagrant $ mkdir drupaldev $ cd drupaldev $ vagrant init

    precise32 \ http://files.vagrantup.com/precise32.box $ vagrant up
  6. Cookbooks $ gem install librarian-chef $ librarian-chef init site ”http://community.opscode.com/api/v1”

    cookbook 'apt', '= 1.10.0' cookbook 'apache2' cookbook 'php' cookbook 'mysql' $ librarian-chef install
  7. Role name "drupal" description "Drupal dev VM" run_list( "recipe[apache2]", "recipe[apache2::mod_expires]",

    "recipe[apache2::mod_rewrite]", "recipe[apache2::mod_php5]", "recipe[php]", "recipe[php::module_mysql]", "recipe[mysql::client]", "recipe[mysql::server]" )
  8. Provisioning config.vm.provision :chef_solo do |chef| chef.cookbooks_path = ”cookbooks” chef.roles_path =

    ”roles” chef.add_role ”drupal” end $ vagrant reload $ vagrant provision
  9. Tips Keep all building blocks local: •Cache packages •Store your

    own base boxes •Use a central cookbook repository