summaryrefslogtreecommitdiff
path: root/manifests/gentoo/module.pp
blob: 7764c6f77a17c835ce2200c9a9ec8635ba611b61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
define apache::gentoo::module(
    $ensure = present,
    $source = '',
    $destination = ''
){
    $modules_dir = "$apache::gentoo::config_dir/modules.d"
    $real_destination = $destination ? {
        '' => "${modules_dir}/${name}.conf",
        default => $destination,
    }
    $real_source = $source ? {
        ''  => [
            "puppet://$server/modules/site-apache/modules.d/${fqdn}/${name}.conf",
            "puppet://$server/modules/site-apache/modules.d/${apache_cluster_node}/${name}.conf",
            "puppet://$server/modules/site-apache/modules.d/${name}.conf",
            "puppet://$server/modules/apache/modules.d/${operatingsystem}/${name}.conf",
            "puppet://$server/modules/apache/modules.d/${name}.conf"
        ],
        default => "puppet://$server/$source",
    }
    file{"modules_${name}.conf":
        ensure => $ensure,
        path => $real_destination,
        source => $real_source,
        require => [ File[modules_dir], Package[apache] ],
        notify => Service[apache],
        owner => root, group => 0, mode => 0644;
    }
}