A Django site.
July 19, 2008

Nicolás Varcarcel
nxvl
Nikolas Valcarcel
» Augeas

I’ve been writing a lot about Augeas and all the process i go through to get it included in debian/ubuntu. It seems that a lot of people was following it, but some of them don’t actually understand the whole picture and what is augeas for, so i’ve been asked to write a post explaining what it is, so here we go:

From the upstream homepage:

Augeas is a configuration editing tool. It parses configuration files in their native formats and transforms them into a tree. Configuration changes are made by manipulating this tree and saving it back into native config files.

Actually, it is a library which does all that stuff and can be manipulated using its public API. But what does this actually means? I will explain it using augtool and /etc/hosts as an example. As you might know it has the information of the host names and their IP addresses, so let’s take this hosts as an example:

127.0.0.1 localhost localhost.localdomain host.domain

After parsing it on augeas we will end with:

/files/etc/hosts/
- - - - - - - - - - - 1/
- - - - - - - - - - - - ipaddr = 127.0.0.1
- - - - - - - - - - - - canonical = localhost
- - - - - - - - - - - - alias = localhost.localdomain
- - - - - - - - - - - - alias = host.domain

So, then we might want to change some values:

augtool> set /files/etc/hosts/1/alias[2] myhost.domain

Ending with:

/files/etc/hosts/
- - - - - - - - - - - 1/
- - - - - - - - - - - - ipaddr = 127.0.0.1
- - - - - - - - - - - - canonical = localhost
- - - - - - - - - - - - alias = localhost.localdomain
- - - - - - - - - - - - alias = myhost.domain

or add new values:

augtool> ins alias after /files/etc/hosts/1/alias[1]

what will turn into:

/files/etc/hosts/
- - - - - - - - - - - 1/
- - - - - - - - - - - - ipaddr = 127.0.0.1
- - - - - - - - - - - - canonical = localhost
- - - - - - - - - - - - alias = localhost.localdomain
- - - - - - - - - - - - alias
- - - - - - - - - - - - alias = myhost.domain

then we need to set a value since now it’s NULL:

augtool> set /files/etc/hosts/1/alias[2] myhost

ending like:

/files/etc/hosts/
- - - - - - - - - - - 1/
- - - - - - - - - - - - ipaddr = 127.0.0.1
- - - - - - - - - - - - canonical = localhost
- - - - - - - - - - - - alias = localhost.localdomain
- - - - - - - - - - - - alias = myhost
- - - - - - - - - - - - alias = myhost.domain

Then you can save it using:

augtool> save

Also you can add a new host, or whatever you want, just need to play with the tree.

Ok, but how this Black Magic work and how can i expand it to read new configuration files? Augeas uses lenses which are a Meta Data type using regular expressions that is being used for parsing, reading and writing configuration files. If you want to play around with lenses you can check this step-by-step tutorial written by Raphael Pinson (Thank you!)

July 6, 2008

Nicolás Varcarcel
nxvl
Nikolas Valcarcel
» Call for lensers

The first step for UCSA is already done! Augeas finally got it’s second ACK! So we just need to wait until the archive admins include it on the archive! I’ve been working on it’s packaging and resolving a really disturbing Bug, but given the help i have received from the really lovely, patient and helpful reviewers it’s already accepted (Thank you all guys! :D).
Now we need to focus on the next step of it, where i will appreciate really much if you want to help on it. It doesn’t need a lot of knowledge, so if you want to get involved on ubuntu and don’t know how, this is your shot!

How you ask? I will answer this question later, first a little description about augeas:
Augeas is a configuration editing tool. It parses configuration files in their native formats and transforms them into a tree. Configuration changes are made by manipulating this tree and saving it back into native config files.

But, how does it recognizes all the native formats of the configuration files? It’s not black magic, well it’s almost black magic, but it need some recipes for it, and those area called lenses.

Great, but, what are those lenses? Lenses are the building blocks of the file < -> tree transformation; they combine parsing a file and building the tree (the get transformation), with turning the tree back into an (updated) file (the put transformation).

Sounds awesome, but also really hard… You know what? It’s not hard, they are just a list of regular expressions and directives in a really easy format, don’t believe me? Give a look at the official documentation on how to write them. It’s not hard, you just need to know (or learn) the syntax of those config files and the POSIX regexp syntax (man re_syntax).

Awesome i want to help! Tell me how!! Ok, i have create a wiki page with the lenses we have now and the ones we want, so you only need to give a look at it and start working on the lense you want after assigning it to yourself. Once you have it, please file a Bug against augeas with the following format:

Summary: Please add lense for $PACKAGE
Description: Augeas doesn’t support $PACKAGE configuration files.
And attach your lense to it.

Also if you feel like you want to, send it to upstream using their list (augeas-devel AT redhat DOT com), or just let me send it.

So, let’s work on this little things to have UCSA as soon as possible and make ubuntu even better!

P.D: If you write a lense also add a comment on it with your name an e-mail to have track of who wrote them like this:
(* Written by Joe Hacker <joe.hacker@isp.net> *)

June 19, 2008

Nicolás Varcarcel
nxvl
Nikolas Valcarcel
» Ubuntu centralized server administrator progress

You may have read already about Ubuntu centralized server administrator since it has been mentioned on the lasts server meetings and as you may have noticed i’m not present on them, so i will start giving the status of the spec from here, but first, as this is the first time i blog about it i will start describing what is ucsa:

On the last UDS i talked to some people about making a tool to control and manage services easily and without pain for new sysadmins. The first thing really painful about service management tools is that you have limited options on it, and if you edit your config file by hand it will simply break the tool, so you can or use the tool or edit config files, not the 2 of them at the same time, so one of the goals was to have some way to edit the config files by hand and not destroy the management tool, but how? You can’t! You must be out of your mind! Well, it might be, but we got some ideas on how to do this:
Ignored zone:
We first talk about making the tool read until some stop point, so the sysadmin can edit after that point without breaking anything because the tool wasn’t going to read it.

Augeas
After UDS someone send some links to the server team list and one of them catch my attention, it was a tool that parses config files and present them as trees so you don’t need to care about the config file itself, just edit the tree and save it, it was the perfect backend for ucsa!

Also, i wanted a tool that doesn’t depend on any service (as a web browser), since i want to care only about the services, so we need a user interface different from CLI, since it’s “hard” from the new linux sysadmins (now i love it, but remember when you start!). Gtk? plz! who wants Xorg on his server, maybe for home servers, but not as initial UI, Curses! That’s perfect! We can use it from command line without needing anything extra! Yay!

So what’s the progress? I’ve already packaged augeas, i’m just waiting for someone to review it and give me feedback or upload it.

Find this a cool idea? Stay tunned, there is more!