Puppet Class: profile::wikistats::httpd

Defined in:
modules/profile/manifests/wikistats/httpd.pp

Overview

sets up a webserver for wikistats



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
31
32
# File 'modules/profile/manifests/wikistats/httpd.pp', line 2

class profile::wikistats::httpd {

    # TODO: we have this php version logic in  a lot of places we shold have a phpe fact
    $php_version = debian::codename() ? {
        'buster'   => '7.3',
        'bullseye' => '7.4',
        'bookworm' => '8.2',
        default    => fail("unsupported on ${debian::codename()}"),
    }

    class { 'httpd':
        modules => ["php${php_version}", 'rewrite'],
    }

    ensure_packages([
        "php${php_version}-xml",
        "libapache2-mod-php${php_version}",
    ])

    file { '/var/www/wikistats':
        ensure => directory,
        mode   => '0755',
        owner  => 'wikistatsuser',
        group  => 'www-data',
    }

    httpd::site { 'wikistats-cloud-vps':
        content => template('wikistats/apache/wikistats.erb'),
        require => Package["libapache2-mod-php${php_version}"],
    }
}