Chef cookbook to prepare a server for running Drupal
Shell Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
data_bags/users
nodes
roles
site-cookbooks
.gitignore
Berksfile
Berksfile.lock
Gemfile
Gemfile.lock
LICENSE
README.md
Vagrantfile

README.md

drupal-cookbook

This is a Drupal chef cookbook designed to work with Druploy

There are a number of Drupal cookbooks already available, but they tend not to work very well with standard Drupal agency workflow.

This Drupal Chef Cookbook doesn't do anything with regards to installing Drupal (as it assumes a normal agency workflow of everything coming out of custom git repos)

All it does is configure a LAMP server with optimal settings for Drupal

Requirements

  1. An Ubuntu 13.04 image. Does not work on 13.10 because of apache 2.4

Installation

Vagrant

A Vagrantfile is provided to help with getting started with this cookbook and help test different nodes run_lists. It's configured with berkshelf in mind and require some vagrant plugins to work.

  1. vagrant-berkshelf: To be able to use berkshelf with vagrant.
vagrant plugin install vagrant-berkshelf
  1. vagrant-omnibus: Some cookbooks that drupal-cookbook depends on require the latest version of the chef-client in the vagrant vm.
vagrant plugin install vagrant-omnibus

Chef

  1. We provide a Gemfile with the dependency needed for running chef and chef solo.
bundle install

Usage

Vagrant

The Vagrantfile containt the chef configuration needed to run the cookbook on the virtual machine.

vagrant up

The chef client is configured to output the debug level log.

To inspect the resulting configuration you can login via ssh:

vagrant ssh

Tweaking the vagrant node is done by editing the chef configuration in the Vagrantfile:

config.vm.provision :chef_solo do |chef|
# Chef configuration
end

Chef

To use this cookbook with real nodes, you can use the example configuration files provided:

  1. Copy and edit the example user in the data_bag/users folder. It's higly recommanded to add your public ssh key to the user configurations for passwordless ssh logins.

    cp data_bags/users/example.json data_bags/users/admin.json
{
    ...
    /* Add your public keys */
    "ssh_keys"  : [""]
}
  1. A node with the cookbook setup is also available, copy it with the targeted domaine.
cp nodes/example.json nodes/yourserver.com
  1. Prepare the node for chef.
knife solo prepare root@yourserver.com
  1. Now you can run the cookbook on the node.
knife solo cook root@yourserver.com