I'm not quite sure, but maybe exported resources could help. Some introductions 
are found here:

* http://docs.puppetlabs.com/guides/exported_resources.html
* 
http://blog.gurski.org/index.php/2010/01/28/automatic-monitoring-with-puppet-and-nagios/

They also cover the Nagios issue.

Cheers Bernd 

> -----Ursprüngliche Nachricht-----
> Von: puppet-users@googlegroups.com [mailto:puppet-
> us...@googlegroups.com] Im Auftrag von Chris
> Gesendet: Donnerstag, 22. September 2011 15:06
> An: Puppet Users
> Betreff: [Puppet Users] Export variables into other classes
> 
> Hi all
> 
> I have been pondering this for a while, but not yet seen a clean way
> to do it
> 
> I have a few puppet classes (apache/ntp/mysql/bacula/nagios/etc)
> 
> I would like to generate part of my bacula and nagios configs for each
> host based on which other classes that host belongs to (or to put it
> another way, I would like to export variables from classes which would
> be used by my bacula and nagios classes).
> 
> As an example, my bacula template for a client currently has:
> 
> FileSet {
>    Name = "FileSet-<%= hostname %>"
>    Include {
>     Options {
>       signature = MD5
>       compression = GZIP
>     }
> <% backup_include.split(/, */).each do |file| -%>    File = <%= file
> %>
> <% end -%>
> # INC = <%= backup_include  %>
>    }
>    Exclude {
>       File = /sys
>       File = /proc
>       File = /var/tmp
> <% backup_exclude.split(/, */).each do |file| -%>       File = <%=
> file %>
> <% end -%>
>    }
> }
> 
> 
> I would like the backup_include to automatically include /var/www if
> the host is an apache server (for example), and I would like those
> directories to be defined in the apache class (not the bacula class)
> 
> Any clever ways of achieving this?
> 
> --
> 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.

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