[Puppet Users] Re: augeas / sudoers

2010-11-19 Thread luke.bigum
The sudoers tree is pretty complex, you've got four possible 'key nodes' of information to match on: user, host, command and tag. This is an augeas match line for all four key nodes (command changed to something without asterisks for readability): match /files/etc/sudoers/spec[user="CENTREON"]/hos

Re: [Puppet Users] Re: augeas / sudoers

2010-11-19 Thread Rob McBroom
That looks like the define I wrote. Whenever/wherever I posted it, I probably also mentioned that it isn't complete because it only identifies entries by user, when in practice, there can be multiple entries with the same user (as you've seen). The problem with incorporating other attributes to

[Puppet Users] Re: augeas / sudoers

2010-11-19 Thread walexey
define sudoentry ($user, $host = "ALL", $command = "ALL", $tag = "NOPASSWD", $runas = "ALL") { $sudo_changes = $tag ? { false => [ "set spec[user = '$user']/user $user", "set spec[user =

[Puppet Users] Re: augeas / sudoers

2010-11-19 Thread luke.bigum
Hi Walexey, Can you post the augeas resource that you've got so far? On Nov 19, 12:50 pm, walexey wrote: > Hello everybody! > How can i create with puppet following sudoers file: > > User_Alias      CENTREON=apache,nagios > CENTREON   ALL = NOPASSWD: /etc/init.d/nagios* restart > CENTREON   ALL