Chef Final Post

Setting up a Chef Server was a very rewarding experience. I think both James and I learned a lot. We both didn’t know how to to setup a Chef server before starting the project, so we can add that to our set of skills.

There were definitely moments that were difficult. Sometimes we got stuck while working on Chef, and we had to Google and troubleshoot until we figured it out. Of course OpenStack wasn’t much of a success so there’s that too.

I wish that we had more time to work on Chef. We had a pretty basic setup that wasn’t very advanced. I would have like to dived deeper into what Chef is capable of and really learn all of the different features it has. I think James would have too. We still learned a lot though, and James told me that he felt like he had learned a ton about Linux and Chef.

Posted in Senior project

Chef Part 5

In the previous couple of posts, I mentioned that we have our two nodes connected. I forgot to mention how you go about connecting a node to the Chef server. It’s pretty simple to do. Just go to your directory on your workstation where your Chef DK is located. From there you will use a knife command to setup the node. Below is an example of the command.

knife bootstrap  --sh-user  --sudo --identity-file ~/.ssh/id_rsa --node-name 

That command will ssh to your node, install chef client, and connect the node to the Chef server. It’s makes connecting to the Chef server really easy.

Posted in Senior project

Chef Part 4

Last post I mentioned that one of our nodes is using a recipe we wrote to install Webmin. We have two nodes running, so we decided to run something different on the second one. We wrote an Apache cookbook to install and configure it. Below is our recipe:

# Cookbook Name:: apache2
# Recipe:: default
apt_update 'Update the apt cache daily' do
frequency 86_400
action :periodic

package 'apache2'

service 'apache2' do
supports :status => true
action [:enable, :start]

file '/var/www/html/index.html' do
content '<html>
<h1>hello world</h1>

It’s pretty simple just like the webmin cookbook. Thankfully I didn’t have to use any bash on this one.

The apt_update package just runs

apt-get update


package’apache2′  is basically the same as running

apt-get install apache2


The service resources simply enables and starts the apache 2 service. The file resource changes the content of index.html to be the html that I posted above.

It’s neat that Chef does all of this stuff automatically. It makes it easy to setup an apache web server really quickly.

Posted in Senior project

Chef Part 3

We got our second node connected to the chef server. We made a cookbook to install Webmin which is a web based interface to do system administration on Linux.

Here is our Webmin recipe:

# Cookbook Name:: webmin
# Recipe:: default
apt_package 'perl'
apt_package 'libnet-ssleay-perl'
apt_package 'openssl'
apt_package 'libauthen-pam-perl'
apt_package 'libpam-runtime'
apt_package 'libio-pty-perl'
apt_package 'apt-show-versions'
apt_package 'python'

bash 'download_webmin' do
user 'root'
cwd '/tmp'
code <<-EOH

bash 'download_webmin' do
user 'root'
cwd '/tmp'
code <<-EOH
dpkg --install webmin_1.820_all.deb

It’s simple but it gets the job done. We tried using the dpkg resource that Chef has, but it didn’t work, so I had to use the bash resource instead. On the next post I’ll talk about our other node and the recipe we wrote for that.

Posted in Senior project

Chef Part 2

James and I have been working more on Chef. We have made a lot of progress since the last post. We’ve been using the Chef tutorials to help us get everything setup. Here is a link the the tutorials: Chef tutorial.

We now have our first node running and connected to the chef server. We have also uploaded our first cookbook to the chef server. We just made a simple recipe that runs apt-get update, installs apache2, and change index.html to say “hello world!”. We kept it simple since it was the first cookbook we made.

Below are pictures of the Chef Manage web GUI, showing that our cookbook is on the server. Also there is a screen-shot of our node connected to the server. We removed the IP addresses and also organization and username from the pictures, for security reasons. That’s why there are white  lines on some parts of the pictures. We plan on getting our second node connected for the next post, and maybe we will dive into Test Kitchen as well.



Shown above: apache2 cookbook uploaded to chef server


Shown above: node connected to chef server

Posted in Senior project

Chef Part 1

If you have been following my OpenStack posts, you will know that I’ve switched to Chef now for my senior seminar project. OpenStack was interesting, and I may work on it again someday, but I’m focusing on Chef now. My project partner, James and I, decided on making our project about Chef, which is a configuration management tool for Linux systems. Chef is open source and it is actively developed by an Chef Software Inc. They do offer paid plans for support and extra features, but the critical components needed to setup a basic Chef infrastructure is free. Here is a link to their website:

Our plan for Chef is to setup a Chef server and have two nodes that will check into the server. All three machines will be running Ubuntu Server 16.04 and they are all virtual machines running on a VMware ESXi host.

To begin setting up Chef, we started with installing the Chef Development Kit (Chef DK). It’s pretty easy to setup. Basically you just install the Ruby programming language and Git on your workstation. Then you download the chef-repo from GitHub and run a few commands. Also, you have to download the starter kit from your Chef server. Here is the doc page we used to install Chef DK: Chef DK docs

Once we got Chef DK installed, we installed the Chef server. We did skip downloading the starter kit, until we got our Chef server running. We decided to go with a standalone installation, which means everything the Chef server needs is installed on a single machine. You can use multiple machines for fail-over and load balancing, but since we won’t have very many nodes, it’s not necessary for us. If we were setting Chef up for an enterprise environment with dozens of nodes, then we would multiple machines.

It’s pretty easy to install the Chef server. You just need to download either an rpm or deb package depending on your Linux distro, and then you unpackage and install it. After that you use a chef command to start up the server, and then you have to run through a couple of chef configuration commands. Here is a link to the doc we followed: Install Chef server

Once we had our Chef server installed, then we went back to the Chef DK docs and downloaded the starter kit for Chef. The starter kit is needed so your workstation has the correct configuration to communicate with your Chef server.

That’s as far as we got for this post. We will dive into setting up nodes and writing cookbooks next time.

Posted in Senior project

OpenStack Part 5

James and I have been working on an easier solution to install OpenStack. The method we were trying just wasn’t working. Specifically we got stuck on creating the domain. We tried using the following command:

openstack project create --domain default \

It didn’t work though, and we couldn’t figure out why. It just kept giving us an error, saying the command isn’t valid. Here is a link to the doc page where we got stuck:Doc page

After that, we tried using Ubuntu’s Autopilot for OpenStack. It’s an installer for OpenStack, specifically designed for Ubuntu. Here is a link to it: Ubuntu Autopilot. Unfortunately Autopilot didn’t work either. I would try to install OpenStack with Autopilot, but it never started installing. I’m guessing there was a bug with somewhere that was causing it to fail.

The last method we tried to install OpenStack with, was devstack. Here is a link to the guide we followed: Devstack. Using devstack was the most successful method. We actually got OpenStack to install and run, but we ran into a major issue. The management webpage failed to load and we got a 500 internal server error every time we tried to load the page. We Googled for hours trying to figure it out, and we even reinstalled Ubuntu server and installed the devstack again. From looking at the log files for devstack, we determined that it was an issue with a configuration file. However, when we tried to edit that config file, it didn’t exist. Devstack isn’t supposed to be a legit OpenStack install, it’s just for testing purposes. I don’t know if the config file failed to get created, or if the developers left it out of devstack. Either way, we can’t fix it without the config file.

So after failing with three different methods to install OpenStack, James and I decided to switch our project. We were frustrated and tired of spinning our wheels. We decided to setup a Chef server with two nodes instead. I’ve had a little experience with creating Chef cookbooks before, but I’ve never setup a Chef server so it will be new to me. My blog will have a new category for Chef. I may come back to this someday as a personal project, but for now I’ll be focusing on Chef instead for my class project.

Posted in Senior project