Augeas project streamlines configuration files with API “lenses”

Share:  facebook  twitter  reddit  digg  stumble  

Augeas is a project introduced by Raphaël Pinson designed to simplify configuration options for Linux applications.

Augeas Logo

What Augeas basically is, is a configuration Application Programming Interface that deals with text configuration files. Currently, a user who knows how to edit /etc/sudoers might not know how to manage vsftpd.conf, and by developing an uniform API to all those files Augeas hopes to solve this problem. It does this by using a bidirectional language, and the several files with source code to enable the bidirectional character of this API are called 'lenses'. This was all a bit abstract, but luckily this was explained by Raphaël.

“What we basically want, is map our text-configuration files to a tree which is easy to understand and edit for the end user, and be able to map that tree back to the text configuration files”. All this should be done automatically, and if done correctly the end-user only has to edit the three, without having to worry about the syntax of the configuration-files themselves. Raphaël then went on by making this all more concrete by showing some examples of these lenses, and configuration file-filters which make heavy use of regular expressions. One of the interesting things he also told is there's theoretical work done on lenses which is parallel to the development of Augeas. The theory then might almost immediately be used in Augeas, and examples from Augeas on its turn are used in the theoretical work. Raphaël showed quickly which mathematical properties a lens should have, which seemed like statements taken from order theory or functional programming. Luckily, I was not the only one a bit lost: “It took me about a day to understand these two rules too” Raphaël confessed.

By this time it became clear to me, that one lens is related to one configuration file, let's say vsftpd.conf. What Augeas then does is use that lens to map the configuration file to a tree which can be edited, and use the same lense to map the tree back to the configuration file. This two opposite directions the lense works is what it makes bi-directional. This is what makes writing a lens quite hard. If for example your lens concatenates two strings but it's not sure how these strings should be divided when going the opposite way, your lense cannot be correct. Currently, one of the programs using the Augeas API is Puppet, about which I will talk again later. As a last note, Raphaël suggests people who are interested take the Quick Tour on the website.

Project Goals

  • Manipulate configuration files safely, safer than the ad-hoc techniques generally used with grep, sed, awk and similar mechanisms in scripting languages
  • Provide a local configuration API for Linux
  • Make it easy to integrate new config files into the Augeas tree
DateJuly 18, 2009