mocker.org

stuck between web 2.0 and plain text

Puppet Regular Expression Trouble

I fought an issue recently with puppet regular expressions that I thought I would share. To understand what I was doing, consider this example fact on a server managed by puppet.

 mylist => foo:bar:baz

My module needed to query the server and determine if the list of things in that fact matched its list from hiera.

1
2
3
4
5
my_list:
      - 'foo'
      - 'bar'
      - 'baz'
      - 'qux'

Puppet would see qux as missing run the steps necessary to add it to the server. On the next run, the fact contains qux so no more work is needed.

Subversion With Crowd Authentication Recap

In my last post I wrote about creating a simple subversion module. The intention was to walk through the process I went through from start to finish for a new module.

That is not going to happen. Sorry. There are already resources out there to teach puppet, and they are excellent. A module I write in a day shouldn’t take weeks to write about. At my current pace that is what is going to happen. Instead, I’ll just describe what the module does and post the code.

Puppetizing Crowd Authentication Into Subversion

In my previous post I wrote about using pulp to host an RPM for a new puppet module. Now I need to write that module. First, a basic understanding of what I’m trying to accomplish. On my target server I want to use crowd to authenticate to a subversion repository. To accomplish this I need to do the following:

  • Install subversion
  • Install apache
  • Install Atlassian crowd apache connector (mod_authnz_crowd)

The first module will be straight forward, install a package for subversion. It will get more difficult after that because I plan on using the puppetlabs/apache module. I will either need to expand their module for mod_authnz_crowd support, or write around the httpd configuration files it manages.

Pulp First Impressions

Prelude

Today I had a task to get crowd integrated with Subversion for authentication and authorization. This was not a huge hurdle, Atlassian provides an RPM for their crowd apache connector and the setup was straight-forward. They do not at this time provide an RPM repository (or my half hearted search didn’t turn up anything).

Desktop Theme

Stayed up late last night and customized the look of my terminal. Took longer than I wanted, but I like the results.  Went with solarized-dark for everything, with manual tweaking to get the colors how I want them.

How to Setup a Test Environment on Mac OS X in VirtualBox

An ideal test environment is unique to the person who uses it, and what they need. My default option of VMWare Fusion started hampering what I wanted to accomplish due to it’s lack of any advanced networking features. Here is how I configured VirtualBox on Mac OS X to have multiple private networks using “Host-only Adapters” that are still able to communicate with the outside world. I’ve done this mainly for my puppet development because it’s nice to have completely separate networks where I control everything.

Skeleton Configuration for Managing Multiple Sites in Puppet

I created a skeleton configuration for managing multiple locations in puppet and pushed it to github. You can find the repository here.

Two sites are defined, Earth and Mars. Parameters for each site are defined in site/manifests/earth/params.pp and site/manifests/mars/params.pp. Included are two modules ntp and user to demonstrate configuring modules across sites.

I also sent a message to puppet-users to get feedback on the methods I used. If I hear improved ways to do this type of setup I’ll update the repository.

Install Updated Git Version on RHEL6

Github doesn’t support the version of git that comes with RHEL6. Here are the commands I used to get a supported version installed:

$ sudo rhn-channel --add --channel=rhel-x86_64-server-optional-6
$ sudo yum install http://pkgs.repoforge.org/git/git-1.7.11.1-1.el6.rfx.x86_64.rpm http://pkgs.repoforge.org/git/perl-Git-1.7.11.1-1.el6.rfx.x86_64.rpm

The annoying part to this was finding the rhn-channel command to enable the optional repo. Most places I looked online wanted me to do this

yum --enablerepo=rhel-6-server-optional-rpms

but my RHEL server wasn’t subscribed to that channel for it to be enabled.

Project Concept: Achievements

I get project ideas all the time, this one came at 2:33am according to the task in OmniFocus. It’s beyond my coding ability, but I think it’s a decent idea.

If you think so too, let me know and we’ll code some stuff up! Or, if this already exists and I haven’t heard of the site let me know.

Begin Elevator Pitch (in car salesman like voice):

Achievements, the “gamification” of the web, are poised to become the next big thing. Microsoft even recently added earning achievements to the next release of Visual Studio.

I propose a centralized place, much like gravatar, that would allow developers to easily add achievements to their site. Users benefit because they have one place to keep track of all their “badges” and unlockable content.

(all of these based on user and site preference)

  • Site can administrators easily add and track new achievements by using API or portal
  • User achievements/badges could be shared among sites
  • Posting of newly earned badges across all sites to twitter/facebook/etc..
  • Linked to email address, no real “authentication” needed
  • Increase site visibility because badges for your site would show up on other site user profiles
  • Increase user interactions as they compete for badges

Sending Files Using DNS

Today I pushed an app I’ve been working on to a public git repo here. The project allows people to share files using DNS. A file is pushed to an authoritative name server and can be pulled back down with a file key. If it’s pulled back down from someone’s normal name servers, it will (depending on DNS server settings) be cached on that name server. Subsequent pulls from that name server won’t need to hit the authoritative name server for records as long as it’s cached (usually TTL, sometimes not).

I think the idea is fun, and I’ve been able to pull down an Ubuntu ISO using only DNS as my source. I did a call for help on reddit for people to give suggestions on cleaning up my code and already have four pull requests. Still have quite a few things I’d like to add, at the top of my list is a rails app that would allow a user to upload a file and have it pushed to DNS records.

Check it out, make fun of my code, and tell anyone you think might be interested.