On Jun 16, 2010, at 3:02 PM, Sukh Khehra wrote:

> Yes, I read that thread and thought I was ensuring path uniqueness by
> inserting the string "01" in there but its not working for me. I
> examined the tree using augtool and as expected did not see a subtree
> numbered at "01" so thought I should be be able to do this. Any other
> suggestions?

If that’s the thread I’m thinking of, I was pretty heavily involved and I think 
you may have missed the point.

You want a unique path that identifies the entry you’re trying to manipulate.

  * It needs to be unique so it won’t clobber an existing entry.
  * It needs to identify the target entry so Puppet will see that it exists on 
all but the initial run.

By using 01 in the path somewhere, you’re only doing the first part, but since 
the 01 entry will never show up when Puppet looks at the file, it will assume 
it needs to add the entry (again and again). A unique path that identifies an 
entry in `/etc/aliases` would look something like this:

    /files/etc/aliases/*[name = 'ftp’]

So with that, you can do things like:

    set /files/etc/aliases/*[name = ‘ftp’]/name ftp

I’ve said before that Puppet encourages us to design things so they won’t hurt 
anything when run over and over, but the Augeas type seems to behave the 
opposite way by default in these “numbered item” contexts. Having said that, 
things have really improved with updates to both Augeas and Puppet and I think 
it’s an extremely valuable combo. It just takes some time to get comfortable 
with how it works.

-- 
Rob McBroom
<http://www.skurfer.com/>

It's not that I think guns, drugs, prostitution, swimming, eating and reading 
should be legal. It's just that no one on Earth has the authority to make them 
illegal.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to