OK, so a few people heard that I was playing with RabbitMQ and MCollective and hinted (less than subtly I might add!) that a blog post might be in order, so here it is.  If you want someone to blame, look no further than @patrickdebois and @garethr :)

The original issue was as follows:

  1. I already use MCollective with ActiveMQ over STOMP, but the XML config format is a nightmare.
  2. I want to use LogStash but that uses AMQP and ActiveMQ doesn’t support that.
  3. I don’t want to have to run two message queuing servers on my network.

@ripienaar mentioned that he’d managed to get MCollective working with RabbitMQ’s new stomp plugin, and RabbitMQ is the AMQP server suggested by the logstash site.  This looked promising – could I really kill two birds with one stone?

The answer – I’m pleased to announce – is yes, I was able to kill two birds with one stone, and this is how I did it…

(more…)

Package Auditing with Edison

November 27th, 2010 | Posted by ProfFalken in DevOps - (1 Comments)

I’ve just committed a new API URL to Edison which enables the storage of Package Name, Version and Repository linked against the ConfigurationItem FQDN.

This enables you to create a plugin for your package manager that posts to a URL and inserts into a database the packages it has just installed/updated.

As an example, the package manager would need to execute a POST request to http://edison_server/api/auditorium/packages/ with the following data:

  • AffectedItem: FQDN of host the packages are being installed/updated on
  • Name: The name of the package being updated/installed
  • Version: The version of the package which is being updated/installed
  • Repository: The repository from which the package has been sourced

This would then create a Package item in the database linked to the Configuration Item letting you search for all packages which have recently been installed on a system.

It works with CURL without issue, I’m hoping to write a YUM plugin (and eventually an apt-plugin as well) to automate this process in the next couple of days.

There are a few things that I think need adding to the model such as the date/time the INSERT was made, however its one step closer to a fully-automated search for changes in system state!

The Hamster is growing…

Edison now has basic support for templating in kickstart/FAI files:

Using the templates

  • http://edison/api/kickstart/ – returns the value from the AutoInstallFile field on the Configuration Item Profile when sent the X-RHN-Provisioning-Mac-0 header

The kickstart output is based upon the value in the ConfigurationItemProfile.AutoInstallFile field. There is now support for rudimentary templating:

<<hostname>> is replaced by the value of ConfigurationItem.Hostname for the MacAddress sent
<<tree>> is replaced by http://<EDISON_SERVER>/cmdb/installtree/<ConfigurationItem.Hostname>/ - this will enable you to configure an install tree based upon the host or profile
<<rootpw>> is replaced by the value of rootpwhash as set on the configuration item
<<bootdev>> is replaced by the macaddress used to request the kickstart

As an example, if you were to put a line in the AutoInstallFile field as follows:

# Network information
hostname = <<hostname>>

then with a host called laptop.local.domain, you would get the following in your kickstart file:

hostname = laptop.local.domain

Next step – making the install tree work correctly!

We’re nearly there… :)

*** UPDATE ***

Yesterday’s code didn’t work properly – The latest commit now has this working!

*** END UPDATE ***

OK, so we still don’t have a decent GUI yet (we’re working on it, honest!) but we do now have support for Kickstart/FAI/Unattend files to be delivered over HTTP via the API on Edison.

“How do I use it?!” I hear you ask… well, it’s pretty simple really and it will be even faster once we write the GUI.

Here’s how to get your Hamster kicking your systems into life…

(more…)

I’ve just pushed a load of code to Github for a project I’ve been working on in my spare time.

The project is named after one of the developer’s ex-hamster (it had to go back to the shop for being too violent, but we’d named the project by then!) and is designed to combine Change Management, Configuration Management, Auditing and integration with tools like Puppet through a DJango-based website and API.

(more…)

I recently ran into a problem with NSS-MySQL – or rather I ran into a number of problems with NSS-MySQL.

  • The first was that there are two libraries with almost identical names (libnss-mysql and nss-mysql) hosted in two different locations (sourceforge.net and savannah.gnu.org respectively) which do exactly the same thing (lookup users from a MySQL database).
  • The second was that all our legacy servers that use this method of authentication had been installed from source, however the key text that told me which version to use (sourceforge or gnu) had been removed from the build documents so I didn’t know which one I was meant to be installing.
  • The third issue (and this isn’t the final issue unfortunately) was that when I realised that the version we were using was the gnu.org one, I also discovered that the only one for which maintained packages were available was the sourceforce.net version.
  • The fourth (and last for the time being) was that the configuration file formats were completely different

At this point, it wasn’t looking too good…

Working closely with a Colleague, we also identified that although the users in the MySQL database were completely different to those found in /etc/passwd, many of the uids and gids matched entries in both.  This was because although all the account names for users start at 2001 as far as the system is concerned, the database userId field starts at 1.  I love legacy systems…

After three days trying to solve this, we were starting to wonder if it would be any quicker to redesign the database and just reassign the permissions across the 25TB of data that we hold for various accounts, then, we hit the solution.

libnss-mysql (the package available from EPEL and the version that is hosted on SourceForge) has to be the version of choice going forwards as we must be able to deploy this server without any human intervention in order for the build systems based upon cucumber-vhosts/hudson that I’ve discussed elsewhere on this blog to work correctly.  This is how we fixed the queries…

(more…)

I’ve started to make some changes to the Cobbler tree to enable it to run on other linux distros than the RedHat family.

First up, Ubuntu Lucid!

Install the required packages:

aptitude install python-yaml python-cheetah python-netaddr python-urlgrabber

Get the source code from my git tree:

git clone git://github.com/proffalken/cobbler.git

change to the new directory and run the setup as root:

cd cobbler
python setup.py install

and there we are, Cobbler should now be running on your server!

There are some discrepancies and it’s not working 100% yet but it will install and run.

I’ll post some more information on getting the web interface up and running in the coming hours/days/weeks as I find the time! :)

Table of contents for Cucumber Vhost

  1. Announcing “Cucumber-VHost” – Cucumber, Cobbler and Virtual Hosting all in one package
  2. cucumber-vhost goes for release 0.1!

I’ve noticed that some people have shown an interest in my cucumber-vhost project.

I’ve just made a few commits that now mean you have steps to tear down virtual servers as well as create them and, as a result, I’m calling this version 0.1 and releasing it for general usage.

There are still a few caveats – I’ve not tested it with any backend systems for libvirt other than kvm/qemu and I’ve not written the steps to confirm a server is up/responding to a give port – but it works and I have it successfully building and destroying VMs under Hudson using the rake plugin.

Please file all bugs on the github bug tracker so I can try and fix them.

(Special thanks go to clalance in #virt on irc.oftc.net for help with sorting out the storage stuff!)

Having received 500 emails from various alerting systems overnight for the n’th day (where ‘n’ is any value that is larger than 400) in a row, I’ve decided to take a stand against so-called “monitoring systems” that just pump SPAM into my inbox each morning that is dismissed with a simple “right-click -> Mark all as read”.
(more…)

Table of contents for Cucumber Vhost

  1. Announcing “Cucumber-VHost” – Cucumber, Cobbler and Virtual Hosting all in one package
  2. cucumber-vhost goes for release 0.1!

I’ve been spending some time writing step files for cucumber that will interact with libvirt and cobbler.

This enables you to include steps such as the following in your scenarios:

(more…)

Switch to our mobile site