On Fri, 2010-04-30 at 12:10 +0200, Peter Meier wrote:
> > but I'm not too sure how to set the value of $CLASSNAME.
> 
> we do something similar:
> 
> file{'/etc/exim/exim.conf':
>    source => [ "puppet://$server/modules/site-exim/${fqdn}/exim.conf",
>                "puppet://$server/modules/site-exim/${exim_type}/exim.conf",
>                "puppet://$server/modules/site-exim/exim.conf",
>                "puppet://$server/modules/exim/exim.conf" ],
>    require => Package['exim'],
>    notify => Service['exim'],
>    owner => root, group => mail, mode => 0640;
> }
> 
> http://git.puppet.immerda.ch/?p=module-exim.git;a=blob;f=manifests/base.pp;h=a0b2d02ca3e1a95b0ddc0b48fa54efb5d2981774;hb=76f594abd5dabffe86bdaeecb99b15bda4b968fc#l13
> 
> what we do then is to set per node the variable (or in an external  
> node tool called parameter) $exim_type to set it to something like  
> 'antivirus', 'webhosting' or whatever. and then have in  
> site-exim/files/antivirus/ the appropriate config file.
> 
> btw: we nearly got rid off that, as we started to split the exim  
> configuration into different subfiles and including them. We then  
> deploy only these include files based on exim_type. This has the  
> advantage, that we have only one identical main-exim config and do all  
> the tweaks in little files we just include.
> 
> cheers pete
> 

Hi Pete,

I've decided to go with the following in the end:

===================================
# define the config file to use
        if(tagged("webserver")) {
                $filename = "webserver"
        }
        else
        {
                $filename = "smtpserver"
        }


        file { "/etc/exim/exim.conf":
                path => "/etc/exim/exim.conf",
                ensure => present,
                source => "puppet:///modules/exim/exim-$filename.conf",
                owner => "exim",
                group => "exim",
                mode => 644,
                require => Package["exim"],
        }
=======================

Does anyone know how to achieve the above in a "prettier" fashion?

M.

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