I understood why that solution isn't working. Not sure if I could put together a similar solution.

The onlyif would probably look like
match /files/etc/aliases/*[name='mycron' and count(value) = 2]/name size == 1
or
match /files/etc/aliases/*[name='mycron']/value == [list of e-mail address]

But Pienaar is right you should use the mailalias type if you can.


Silviu



On 16.06.2010 22:02, 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?

-----Original Message-----
From: Silviu Paragina [mailto:sil...@paragina.ro]
Sent: Wednesday, June 16, 2010 11:31 AM
To: puppet-users@googlegroups.com
Cc: Sukh Khehra
Subject: Re: [Puppet Users] augeas and sendmail aliases

Search in the list history for a thread named "augeas type and
/etc/services"


Silviu

On 16.06.2010 20:38, Sukh Khehra wrote:
I am trying to add an entry to /etc/aliases using this but am unable
to
keep the entry from being added on every puppet run. I couldn't figure
out the proper "onlyif" attribute to use to add it only once.

     augeas{ "add sendmail alias" :
         context =>   "/files/etc/aliases",
         changes =>   [
             "set /files/etc/aliases/01/name mycron",
             "set /files/etc/aliases/01/value[1] us...@mydomain.com",
             "set /files/etc/aliases/01/value[2] us...@pmydomain.com",
         ],
     }
     exec { "/usr/bin/newaliases": subscribe =>   Augeas["add sendmail
alias"], refreshonly =>   true }


Thanks for the help.

Regards,
Sukh



--
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