Using Augeas to automatically edit config files

Of course, the great thing about standards is that there are so many of them. Sometimes it seems like every application config file format is slightly different, and writing regular expressions to parse and modify all of them can be a tiresome business.

Thankfully, Augeas is here to help. Augeas is a tool which aims to simplify working with different config file formats, by presenting them all as a simple tree of values. Puppet's Augeas support allows you to create augeas resources which can make the required config changes intelligently and automatically.

Getting ready…

Before we can use Augeas, we need to install it. The following Puppet code will add Augeas to your setup.

  1. Create the file /etc/puppet/modules/admin/manifests/augeas.pp ...

Get Puppet 2.7 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.