Setting up puppet board with Apache

PuppetDB appears to be the way of the future. By leveraging PuppetDB, some enterprising individuals have written a web interface that knocks the socks off of the regular puppet dashboard. It is called puppetboard

Clean and elegant – puppetboard

View of a node

Puppetboard with Apache

Normally puppet board requires Passenger. Here is how to configure puppet board to work with Apache instead.

You can install puppet board on cent with apache using the mod_wsgi plugin

Clone & install  puppetboard

git clone /var/www/puppetboard
sudo yum install python-pip
Install mod_wsgi yum install mod_wsgi.x86_64

(You can see what was installed with the following)
rpm –query –list mod_wsgi.x86_64

Verify that /etc/httpd/confi.d/wdgi.conf exists and has the following content

LoadModule wsgi_module modules/

Add a vhost to /etc/httpd/

$sudo vim /etc/httpd/conf/httpd.conf
<VirtualHost *>
WSGIDaemonProcess puppetboard user=apache group=apache threads=5
 WSGIScriptAlias / /var/www/puppetboard/
<Directory /var/www/puppetboard>
 WSGIProcessGroup puppetboard
 WSGIApplicationGroup %{GLOBAL}
 Order deny,allow
 Allow from all

 Restart Apache
 sudo apachectl -k stop
 sudo /etc/init.d/httpd start

If you are running CentOS/RHEL You get the following errors, it is because the WSGI root path is incorrect.

[Fri Jan 03 16:53:13 2014] [error] [client] (13)Permission denied: mod_wsgi (pid=2029): Unable to connect to WSGI daemon process 'puppetboard' on '/etc/httpd/logs/wsgi.2024.0.1.sock' after multiple attempts.

Add this to /etc/httpd/conf/httpd.conf *before* the vhost

WSGISocketPrefix ../../var/run/wsgi

Restart Apache and puppet board should be installed

Additional Resources!topic/modwsgi/UmNPV-2nQMM

Simplifying git workflows with hub

There is a fantastic application called ‘hub’ which can save a ton of time off of your git workflow.

Normally to clone a git repo, you would enter the following

cd /tmp

git clone -b 4.2-dev

With hub the same command could be executed with the following

cd /tmp

hub clone adaptivecomputing/torque -b 4.2-dev

Since most of the available options for hub match the commands for git, you could even create an alias from hub to replace git.

Just one tip to make your git workflow simpler

Install Gitlab with puppet

Once you have used a professional git hosting service like github, you’ll never be satisfied going back to a plane jane git server like git-web.

git-web is just so darn ugly!


A necessity arose at my company for a way to create pull requests on our main software, so I started investigating how we could migrate our codebase to github.

Unfortunately, github enterprise is $5,000 per 20 users per year. If you have 100 users, thats $25,000 per year!

There are other projects such as gitorious, however their pricing is close to github’s.

Introduce gitlab. Gitlab is an enterprise level git server comparable to gitorious and github enterprise, however costs 1/10th what the competitors charge. They also have a community edition. The only limitations in the community edition being; LDAP group synchronization, and project group invites. Both things a smaller company can live without. See the full feature list here.

Gitlab is light-years ahead of git-web


Installing Gitlab with Puppet

The biggest obstacle to adopting a server like gitlab, is the heavy install. The average time for me to install the community edition of gitlab was 6 hours. So I leveraged puppet to install gitlab automatically.

Using my puppet module, it is now possible to install gitlab in about 15 minutes.

Step by step video tutorial is located below.

Note: You may see the following errors when installing gitlab inside vagrant. This is because dependencies are not resolved when installing a module locally (opposed to from the puppet forge).

vagrant@gitlab:/vagrant$ puppet apply /vagrant/tests/init.pp --debug Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class mysql::server at /vagrant/tests/init.pp:12 on node gitlab.localdomain Wrapped exception: Could not find declared class mysql::server Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class mysql::server at /vagrant/tests/init.pp:12 on node gitlab.localdomain

Solution: Manually install dependencies

puppet module install puppetlabs-mysql

puppet module install puppetlabs-apt

puppet module install example42-postfix

puppet module install puppetlabs-ruby

The spuder-gitlab module can be found on the puppet forge

And the module’s source is on github

Uninstalling Puppet from Mac Os X

Recent on the StackExchange site Super User, the following question came up which seemed pretty straight forward.

How to uninstall puppet on Mac OS X ?

I naturally assumed that puppet labs would include an uninstaller with the .dmg package. It turns out, that is not the case. You must uninstall puppet manually.


I first identified where puppet was installed.

 which puppet 


I assumed that there was also a puppet binary in the /usr/sbin directory which turned out to be correct

ls /usr/bin|grep puppet


Removing the puppet user was not as easy. I assumed it would be in /etc/shadow, however Mac does not use the shadow file. Nor does Mac have the userdel command.


I discovered the following blog post which elaborates on the dscl command.

You will need to reboot the machine for the puppet user to be deleted.

To be thorough, I ran the following command to look for any additional puppet files

 sudo find / -iname 'puppet' -type d 

Sure enough, there are two other folders to delete


To uninstall puppet, delete the following files


Remove the following directories

To get rid of the puppet user that appears on the login screen
sudo dscl . delete /Users/puppet

Reboot the machine and puppet will be uninstalled.

Note that facter will still be present. Uninstalling facter is not in the scope of this post.

Macjournal, using code blocks 

Mac journal can be setup to create code blocks that look like this:

some code here

To enable this feature, you must turn off escaping of < characters.



Remove the check box from “Escape ‘’


The next time you push a blog entry to your blog, you should see the pretty pre formatted text box.

(Tested on WordPress)

Linux Swap Files

While setting up an Oracle database to troubleshoot an ODBC connector for work, I ran into a strange error:

rpm -i oracle-xe-11.2.0-1.0.x86_64.rpm

 This system does not meet the minimum requirements for swap space.  Based on
the amount of physical memory available on the system, Oracle Database 11g
Express Edition requires 2048 MB of swap space. 

Sector Size on Virtual Machine


I noticed that on my virtual machines, the number of heads / cylinders on the disk are far larger than would technically be possible

A normal hard drive has 2 heads per platter, and up to 5 platters for a total of 10 heads.

This vm has 255!

root@ubuntu:~# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0002a643

Device Boot Start End Blocks Id System

/dev/sda1 * 2048 40105983 20051968 83 Linux

/dev/sda2 40108030 41940991 916481 5 Extended

/dev/sda5 40108032 41940991 916480 82 Linux swap / Solaris


41943040 sectors * 512 byte sectors = 21474836480 bytes (21GB)

41943040 sectors / 2610 cylinders = 16,070.130268199 sectors per cylinder (Strange that isn’t divisible evenly)

Apparently further research is needed.

  1. Why do virtual machines have 255 heads?
  2. Why do the number of sectors per cylinder no divide evenly?

If you have any ideas, leave them in the comments.