On Sep 22, 2011, at 6:05 AM, Chris wrote:
> 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?
----
I do use in one of my manifests...
if (tagged("ldap::server_install")) {
$ldap_servers = "ldapi:/// ldap://ldap.domain"
} else {
...
}
so I would think that you could have something like ", '/var/www'" if
(tagged("apache::server")) in your 'backup_include' string.
Craig
--
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.