1. How to Configure Knife and Test Kitchen to use OpenStack

    Originally published on arnesund.com

    When developing Chef cookbooks, Knife and Test Kitchen (hereafter just "Kitchen") are essential tools in the workflow. Both tools can be set up to use OpenStack to make it easy to create VMs for testing regardless of the capabilities of the workstation used. It's great for testing some new recipe in a cookbook or making sure changes do not break existing cookbook functionality. This post will go through the configuration of both tools to ensure they use OpenStack instead of the default Vagrant drivers.

    Install software and dependencies

    First, it is necessary to install the software, plugins and dependencies. Let's start with some basic packages:

    sudo apt-get install ruby1.9 git
    sudo apt-get install make autoconf gcc g++ zlib1g-dev bundler

    Chef Development Kit

    The Chef Development Kit is a collection of very useful tools for any cookbook developer. It includes tools like Knife ...


  2. How to Use Cloud-init to Customize New OpenStack VMs

    Originally published on arnesund.com

    When creating a new instance (VM) on OpenStack with one of the standard Ubuntu Cloud images, the next step is typically to install packages and configure applications. Instead of doing that manually every time, OpenStack enables automatic setup of new instances using Cloud-init. Cloud-init runs on first boot of every new instance and initializes it according to a provided script or config file. The functionality is part of the Ubuntu image and works the same way regardless of the cloud provider used (Amazon, RackSpace, private OpenStack cloud). Cloud-init is also available for other distributions as well.

    Creating a customization script

    Standard Bash script

    Perhaps the easiest way to get started is to create a standard Bash script that Cloud-init runs on first boot. Here is a simple example to get Apache2 up and running:

    cat > cloudinit.sh <<EOF
    > #!/bin/bash
    > apt-get update
    > apt-get -y install ...


Page 1 / 1