[Puppet-dev] Re: [augeas-devel] Re: Augeas and Puppet

Raphaël Pinson raphink at gmail.com
Fri Aug 1 17:41:07 UTC 2008


On Fri, Aug 1, 2008 at 4:00 PM, David Schmitt <david at schmitt.edv-bus.at>wrote:

>
> Lacking a real use case I'd rather omit that "mv" completely.
>

I already mentionned commenting/uncommenting, but as you said puppet could
provide a higher level API for that. So here is another example, using
bb-hosts, which you might or might not be familiar with.

bb-hosts is the configuration file for the bb4 web interface. It lists
pages, groups and hosts to include in monitoring system. There are two kinds
of groups that can be defined (or rather: I know two kinds of groups):
group-compress and group-only. Both can contain hosts, but they don't behave
the same way when bb4 parses them. Now if I want to turn a group-compress
into a  group-only (without losing the hosts in it, which are subnodes), I
would have to do something like this:

# insert a group-only node to host the move (otherwise it would end up in
the end of the file)
aug.insert("/files/etc/bb-hosts/page[4]/group-compress[3]", "group-only",
"after")
# get the path to the newly created node (not implemented yet in augeas)
newpath = aug.get("/augeas/last_modified_node")
# move the group
aug.mv("/files/etc/bb-hosts/page[4]/group-compress[3]", newpath)


Raphael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080801/57b144fb/attachment.htm>


More information about the augeas-devel mailing list