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
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
define sudoentry ($user, $host = "ALL", $command = "ALL", $tag
= "NOPASSWD", $runas = "ALL") {
$sudo_changes = $tag ? {
false => [
"set spec[user = '$user']/user $user",
"set spec[user =
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