[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [augeas-devel] Path and increasing identifiers



On Wed, Dec 16, 2009 at 3:28 PM, Tim Stoop <tim stoop gmail com> wrote:
> Hi all,
>
> I'm trying to knit some of our puppet recipes together with Augeas,
> because I think the Augeas way of working is much nicer than sourcing
> files. However, I'm running into one thing I can't seem to solve: Take
> the /etc/hosts file, every entry has a unique identifier (like
> /files/etc/hosts/1/), how do I determine which one is the highest, so
> I can automatically do something like last()+1 for a new IP address?
>

last()+1 is exactly it :-)
e.g. augtool print '/files/etc/hosts/*[last()]'


And your can use last()+1 in your insert command.


Raphaël



> --
> Gegroet,
> Tim
>
> _______________________________________________
> augeas-devel mailing list
> augeas-devel redhat com
> https://www.redhat.com/mailman/listinfo/augeas-devel
>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]