Puppet Class: tendril

Defined in:
modules/tendril/manifests/init.pp

Overview

Parameters:

  • site_name (Any)
  • docroot (Any)
  • ldap_binddn (Any)
  • ldap_authurl (Any)
  • ldap_groups (Any)
  • auth_name (Any)
  • cas_enable (Any) (defaults to: false)


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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'modules/tendril/manifests/init.pp', line 4

class tendril (
    $site_name,
    $docroot,
    $ldap_binddn,
    $ldap_authurl,
    $ldap_groups,
    $auth_name,
    $cas_enable=false,
) {

    include passwords::ldap::production
    include passwords::tendril
    $proxypass = $passwords::ldap::production::proxypass
    $tendril_user_web = $passwords::tendril::db_user_web
    $tendril_pass_web = $passwords::tendril::db_pass_web

    $ssl_settings = ssl_ciphersuite('apache', 'strong', true)

    if $cas_enable {
        include profile::idp::client::httpd # lint:ignore:wmf_styleguide
    } else {
        httpd::site { $site_name:
          content => template("tendril/apache/${site_name}.erb");
      }
    }

    acme_chief::cert { 'tendril':
        puppet_svc => 'apache2',
    }

    # Temporary hack while jessie is supported
    if os_version('debian <= jessie') {
        $php_mysql_pkg = 'php5-mysql'
        $php_memcache_pkg = 'php5-memcache'
    } else {
        $php_mysql_pkg = 'php-mysql'
        $php_memcache_pkg = 'php-memcache'
    }
    require_package(
        $php_mysql_pkg,
        $php_memcache_pkg, # do not install -memcached, it won't work
        'memcached', # memcached expected by default on localhost
    )

    group { 'mwdeploy':
        ensure => present,
        system => true,
    }

    user { 'mwdeploy':
        ensure     => present,
        shell      => '/bin/bash',
        home       => '/var/lib/mwdeploy',
        system     => true,
        managehome => true,
    }

    file { '/srv/tendril':
        ensure  => 'directory',
        owner   => 'mwdeploy',
        group   => 'www-data',
        mode    => '0755',
        require => User['mwdeploy'],
    }
    file { '/srv/tendril/web/robots.txt':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        source  => 'puppet:///modules/tendril/robots.txt',
        require => Git::Clone['operations/software/tendril'],
    }

    git::clone { 'operations/software/tendril':
    # we do not update (pull) automatically the repo
    # not adding ensure => 'latest' is on purpose
        directory => '/srv/tendril',
        branch    => 'master',
        owner     => 'mwdeploy',
        group     => 'www-data',
        require   => File['/srv/tendril'],
    }

    file { '/srv/tendril/lib/config.php':
        ensure  => 'present',
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('tendril/config.php.erb'),
        require => Git::Clone['operations/software/tendril'],
    }
}