[augeas-devel] How to use the generic IniFile module?

Dominic Cleal dcleal at redhat.com
Mon Mar 5 15:15:55 UTC 2012


On 05/03/12 15:07, Biltong wrote:
> On Mon, Mar 5, 2012, at 10:29 AM, Dominic Cleal wrote:
>> a) The IniFile module is a set of building blocks and doesn't contain a
>> lens that will let you parse a whole file.  The reason for this is .ini
>> files actually vary somewhat in design, so there's no single generic
>> lens it provides.
>>
>> You'd be better off specifying one of the derived lenses, such as:
>>
>> Puppet.lns - simple .ini file
>> PHP.lns - allows settings outside of sections (under ".anon")
>> MySQL.lns - allows slashes in section names, supports !include etc
>> Dput.lns - allows only certain setting names, allows slashes
>>
>> For a many cases, Puppet.lns is probably suitable.
> 
> Okay. And what's the best way of distributing lenses, if I create new
> ones? Putting them somewhere not in /dist sounds sensible, is that
> right?

Yep, the /dist directory is used by the package.

The /usr/share/augeas/lenses directory will be searched by Augeas first
so add your lenses here, or use the -I argument to augtool to search
another path.

-- 
Dominic Cleal
Red Hat Consulting
m: +44 (0)7817 878113




More information about the augeas-devel mailing list