One of the many things that makes Linux configuration management the minefield we all love is the lack of a local configuration API. The main culprit for this situation--that configuration data is generally stored in text files in a wide variety of formats--is both an important part of the Linux culture and valuable when humans need to make configuration changes manually. Augeas provides a local configuration API that adapts to this reality. It presents configuration data as a tree that is backed by the various config files as they exist today; modifications to the tree correspond directly to changes in the underlying files. Augeas takes great care to preserve comments and other formatting detail across editing operations.
The transformation from configuration files into the tree and from the modified tree back to an updated file is controlled by a description of each config file's format. The file format is specified through regular expressions and instructions on how matches are to be mapped into the tree. The specification is bidirectional, so that the mapping from file to tree automatically implies the reverse, mapping from the tree back to the file.
This talk explains how Augeas can be used to edit configuration files programmatically, what file descriptions come with Augeas and how to use them, and how to write your own file descriptions.