On May 24, 2011, at 7:58 PM, treydock wrote:

> I have a similar problem I can't seem to solve...here's what I'm
> trying to do.
> 
> I have two modules, backuppc_client and sudo.  Right now I have a node
> variable that I assign to each node that is used in the sudo module's
> template to add the necessary entry.  For example....
> 
> ---manifests/node.pp
> node 'client1' {
>        $backuppc_sudocmd = "backupuser ALL=NOPASSWD: /usr/bin/rsync"
> 
>        include baseclass
>        include backuppc_client::base
> }
> 
> ---modules/sudo/templates/sudoers.erb has...
> 
> <% if has_variable?("backuppc_sudocmd") then %>
> <%= backuppc_sudocmd %>
> <% end %>
> 
> 
> Is there a way for the sudo module to find out or be aware if a client
> has the "include backuppc_client" in their definition?  Basically I'd
> like the backuppc_client module's to alter the contents of sudoers
> file which I can't imagine how to do as sudoers is defined by the sudo
> module which is part of baseclass and applied to all systems.

First, do you have a "/etc/sudoers.d/" directory?  That would make things much 
easier.  

If not, you might want to look into "puppet_concat" which allows you to build 
"fragments" that can be templated to build your file.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@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