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…)

Switch to our mobile site