On Wed, 2010-10-13 at 09:46 +0100, Luke Bigum wrote:
> augtool> set /files/etc/hosts/*/ipaddr[.='10.44.220.23'] 10.44.220.23
> Failed
> augtool> set /files/etc/hosts/*[ipaddr='10.44.220.23']/ipaddr
> 10.44.220.23
> Failed

The issue is that for the case where there is no node
matching /files/etc/hosts/*/ipaddr[.='10.44.220.23'], Augeas tries to
create one, but it doesn't know what to use for '*'.

> I'm using Augeas 0.7.3 on CentOS 5.5 and as you would have guessed,
> through Puppet. I suppose I can always do an 'rm <line>' then 'ins
> <new>' and use Puppet's onlyif clause to limit when the augeas
> statements will be run, but it would be nice if it was possible to do
> it with 'set' commands.

Yes, currently 'onlyif' is the only way to do this with Puppet. What
makes this a little ugly is that it might force you to split your
resource into two - one that only runs when the node you're looking for
doesn't exist, and creates it, and one that does all the rest.

A long time ago, I filed a bug to add a 'if' to the minilanguage that
the augeas type in puppet supports[1], but haven't gotten around to
actually fixing it.

David

[1] http://projects.puppetlabs.com/issues/2696

_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to