Puppet Class: iegreview

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

Overview

Class: iegreview

This class provisions the IEG grant review application.

Parameters:

hostname

Hostname for apache vhost. Default iegreview.wikimedia.org.

deploy_dir

Directory application is deployed to. Default /srv/deployment/iegreview/iegreview.

cache_dir

Directory for caching twig templates. Default /var/cache/iegreview.

log_dest

Log destination. Default udp://udplog:8420/iegreview

serveradmin

Administrative contact email address. Default noc@wikimedia.org.

mysql_host

MySQL database server. Default localhost.

mysql_db

MySQL database. Default iegreview.

smtp_host

Outgoing email relay. Default localhost.

restbase_url

RESTBase API url for wikitext to html conversion. Default en.wikipedia.org/api/rest_v1/transform/wikitext/to/html

Sample usage:

class { 'iegreview': }

Parameters:

  • hostname (Any) (defaults to: 'iegreview.wikimedia.org')
  • deploy_dir (Any) (defaults to: '/srv/deployment/iegreview/iegreview')
  • cache_dir (Any) (defaults to: '/var/cache/iegreview')
  • log_dest (Any) (defaults to: 'udp://udplog:8420/iegreview')
  • mysql_host (Any) (defaults to: 'localhost')
  • mysql_db (Any) (defaults to: 'iegreview')
  • smtp_host (Any) (defaults to: 'localhost')
  • restbase_url (Any) (defaults to: 'https://en.wikipedia.org/api/rest_v1/transform/wikitext/to/html')


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
# File 'modules/iegreview/manifests/init.pp', line 39

class iegreview(
    $hostname             = 'iegreview.wikimedia.org',
    $deploy_dir           = '/srv/deployment/iegreview/iegreview',
    $cache_dir            = '/var/cache/iegreview',
    $log_dest             = 'udp://udplog:8420/iegreview',
    $mysql_host           = 'localhost',
    $mysql_db             = 'iegreview',
    $smtp_host            = 'localhost',
    $restbase_url         = 'https://en.wikipedia.org/api/rest_v1/transform/wikitext/to/html',
) {

    include passwords::mysql::iegreview

    system::role { 'iegreview':
        description => 'Grants review application server - iegreview.wikimedia.org',
    }

    scap::target { 'iegreview/iegreview':
        service_name => 'iegreview',
        deploy_user  => 'deploy-service',
    }

    if os_version('debian == jessie') {
        require_package('php5-mysql')
        require_package('php5-curl')
    } else {
        require_package('php-mysql')
        require_package('php-curl')
    }

    httpd::site { $hostname:
        content => template('iegreview/apache.conf.erb'),
    }

    ensure_resource('file', '/srv/deployment', {'ensure' => 'directory' })

    file { '/etc/iegreview.ini':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('iegreview/env.erb'),
        notify  => Service['apache2'],
    }

    file { $cache_dir:
        ensure => directory,
        owner  => 'www-data',
        group  => 'root',
        mode   => '0755',
    }
}