Downloading cookbooks to support DHCP, Razor, and OpenStack

Now that we have installed both Chef Server and its Knife utility, we need to download the Chef cookbooks to support the remainder of our installation.

Getting started

Log into the Chef Server:

vagrant ssh chef

How to achieve it…

On the Chef Server, execute the following commands to download, configure, and install the cookbooks and roles to support the rest of our installation efforts. To perform this, execute the following commands:

# Create chef Repo
sudo apt-get install –y git
sudo git clone git://github.com/opscode/chef-repo.git /root/cookbooks
# Download the DHCP Cookbook
sudo knife cookbook site install dhcp sudo knife data bag create dhcp_networks sudo mkdir -p /root/databags/dhcp_networks
sudo cat > /root/databags/dhcp_networks/razor_dhcp.json <<EOF
"id": "172-16-0-0_24
"routers": [ "" ], "address": "
"netmask": "
"broadcast": "
"range": "
"options": [ "next-Server" ]
sudo knife data bag from file dhcp_networks/root/databags/dhcp_networks/razor_dhcp.json
# Download the PuppetLabs Razor Cookbooks sudo knife cookbook site install razor RAZOR_IP=\"\"
sudo sed -i "s/node\['ipaddress'\]/$RAZOR_IP/g" /root/cookbooks/razor/attributes/default.rb
sudo knife cookbook upload -o /root/cookbooks --all
# Download the Rackspace OpenStack Cookbooks
git clone https://github.com/rcbops/Chef-cookbooks.git cd chef-cookbooks
git checkout v4.0.0 git submodule init git submodule sync git submodule update
sudo knife cookbook upload -a -o cookbooks sudo knife role from file roles/*rb

How it works…

The first thing we need to do, is create a Chef cookbook repo. This provides the git structure that lets the Chef Server version our cookbooks. Next we have to download the DHCP cookbook and create a Chef “Databag”, or set of configuration values, to contain the configuration of our DHCP Scope, such as IP address range and critically, the next server. After that we download both the Razor and OpenStack Cookbooks. Finally, we add the IP address of the Razor Server to its configuration and then upload all of our cookbooks and roles.


0 Responses on Downloading cookbooks to support DHCP, Razor, and OpenStack"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.