I have liked this solution.. I was using an erb template to manage
the /etc/sudoers file.
Using augeas seems to be much better. However, I have one question,
that is due to my lack of experience with augeas. If the command has
multiple values, each one separated with a comma, how would I pass
this to augeas? I have tried to do something like this:
sudoer { "sudoer_test":
name => "test",
command => ["/etc/init.d/abc-ctl", "/etc/init.d/def-ctl"],
}
define sudoer($command) {
augeas { "sudo${name}":
context => "/files/etc/sudoers",
changes => [
"set spec[last() + 1]/user ${name}",
"set spec[last()]/host_group/host ALL",
"set spec[last()]/host_group/command $
{command}",
"set spec[last()]/host_group/command/
runas_user ALL",
"set spec[last()]/host_group/command/tag
NOPASSWD",
],
onlyif => "match *[user = '${name}'] size == 0",
}
}
but it doesn't work...
Any ideas?
Cheers,
Gus
On Jun 30, 3:40 pm, Rob McBroom <[email protected]> wrote:
> On Jun 30, 2010, at 1:52 PM, Jeff wrote:
>
> > When I removed that line, I got a new entry each time puppet ran...
>
> I know. I wasn’t referring to the “onlyif” line alone, but the whole thing.
>
> See my original post, starting where I said “Also note that your example as
> written will add this entry to the file on every single Puppet run. You could
> add an ‘onlyif’, but by using `last() + 1` and ‘onlyif’ you can only add
> entries.” for a solution.
>
> --
> Rob McBroom
> <http://www.skurfer.com/>
>
> Don't try to tell me something is important to you if the whole of your
> “support” entails getting Congress to force *others* to spend time and money
> on it.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.