Puppet Class: profile::community_civicrm::httpd

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

Overview

Parameters:

  • site_name (Stdlib::Fqdn) (defaults to: lookup('profile::community_civicrm::httpd::site_name', {'default_value' => 'community-crm.wikimedia.org'}))
  • web_root (Stdlib::Unixpath) (defaults to: lookup('profile::community_civicrm::httpd::web_root', {'default_value' => '/var/www/community_civicrm/web'}))


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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'modules/profile/manifests/community_civicrm/httpd.pp', line 7

class profile::community_civicrm::httpd (
    Stdlib::Fqdn $site_name = lookup('profile::community_civicrm::httpd::site_name', {'default_value' => 'community-crm.wikimedia.org'}),
    Stdlib::Unixpath $web_root = lookup('profile::community_civicrm::httpd::web_root', {'default_value' => '/var/www/community_civicrm/web'}),
) {

    $php_version = wmflib::debian_php_version()

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

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

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

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

    httpd::site { 'community-crm':
        content => template('profile/community_civicrm/community-civi.apache.erb'),
        require => Package["libapache2-mod-php${php_version}"],
    }

    firewall::service { 'civicrm_http':
        proto => 'tcp',
        port  => [80],
    }

}