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
95
96
97
98
99
100
101
102
103
104
# 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',
    }

    $php56_packages = [
        'libapache2-mod-php5.6',
        'php5.6-cli',
        'php5.6-common',
        'php5.6-curl',
        'php5.6-dev',
        'php5.6-gd',
        'php5.6-gmp',
        'php5.6-intl',
        'php5.6-ldap',
        'php5.6-mcrypt',
        'php5.6-mysql',
        'php5.6-pgsql',
        'php5.6-readline',
        'php5.6-sqlite3',
        'php5.6-tidy',
        'php5.6-xsl',
    ]

    apt::package_from_component { 'tendril_php56':
        component => 'thirdparty/php56',
        packages  => $php56_packages,
    }

    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'],
    }
}