DevOps with Vagrant and Chef

DevOps with Vagrant and Chef

You can find software nearly everywhere in the nowadays business. Who want to be uptodate and a player in the market needs to deliver feature and bug fixes continously. At the same time applications and there required stack (e.g. apache, mysql, elastic, solr, mongo db) is getting more and more complex. In the end this is a huge challenge for the development and operations team.


The developers mostlikely want to use the newest technology to implement cool feature. At the same time, the operations team needs to make sure, that the service is available and reliable. To achieve both is a tough challenge!

The buzzword "DevOps" describes technologies that make the work and interaction between development and operations easier. Vagrant and Chef offer the possibility to define the infrastructure configuration with code. With this pattern you are able to automate a lot of things.


You can find the files for each step of this tutorial on github:


  • Our first vagrant box
    • Step 1: Create a simple development box with Vagrant
    • What is Vagrant?
    • What is Chef?
    • Hello Vagrant
    • Start the Vagrant Box
  • Creating a custom cookbook with Chef
    • Step 2: A simple cookbook with chef
    • Creating a custom cookbook with chef
    • Use chef a provisioner in Vagrant file and trigger recipe in custom cookbook
    • The anatomy of a chef cookbook
    • Add metadata to your cookbook
    • Implement a simple recipe
    • Start the box and check the result of our first cookbook
  • Configure a Apache VirtualHost with a chef cookbook
    • Step 3: Create a VHost with the Apache2 Cookbook
    • Maintain dependencies in metadata.rb
    • Use Berkshelf to resolve dependencies
    • Implement the cookbook to create the apache virtual host
    • Create a local DNS entry in /etc/hosts and open the dummy site
    • The Berksfile.lock
  • Vagrant and Chef Performancetunning
    • Step 4: DevOps Performanceoptimization - Tuning Vagrant and Chef
    • High Performance DevOps with Vagrant and Chef
    • Activate NFS for Vagrant synced folder
    • Use NFS Caching in your Vagrant Box
    • Assign RAM and CPU automatically with Vagrant
    • Use the Vagrant Cachier Plugin
    • Vagrant & Chef Performance with and without Cache