Puppet Class: wikimania_scholarships

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

Overview

Class: wikimania_scholarships

This class installs/configures/manages the Wikimania Scholarships application.

Parameters:

  • $hostname: hostname for apache vhost

  • $deploy_dir: directory application is deployed to

  • $cache_dir: directory for caching twig templates

  • $udp2log_dest: log destination

  • $serveradmin: administrative contact email address

  • $mysql_host: mysql database server

  • $mysql_db: mysql database

  • $smtp_host: outgoing email relay

Sample usage:

class { 'wikimania_scholarships':
}

Parameters:

  • hostname (Any) (defaults to: 'scholarships.wikimedia.org')
  • deploy_dir (Any) (defaults to: '/srv/deployment/scholarships/scholarships')
  • cache_dir (Any) (defaults to: '/var/cache/scholarships')
  • udp2log_dest (Any) (defaults to: 'mwlog1001.eqiad.wmnet:8420')
  • serveradmin (Any) (defaults to: 'noc@wikimedia.org')
  • mysql_host (Any) (defaults to: 'localhost')
  • mysql_db (Any) (defaults to: 'scholarships')
  • smtp_host (Any) (defaults to: 'localhost')


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

class wikimania_scholarships(
    $hostname     = 'scholarships.wikimedia.org',
    $deploy_dir   = '/srv/deployment/scholarships/scholarships',
    $cache_dir    = '/var/cache/scholarships',
    $udp2log_dest = 'mwlog1001.eqiad.wmnet:8420',
    $serveradmin  = 'noc@wikimedia.org',
    $mysql_host   = 'localhost',
    $mysql_db     = 'scholarships',
    $smtp_host    = 'localhost'
) {

    include ::passwords::mysql::wikimania_scholarships

    require_package('php-mysql')

    $mysql_user = $passwords::mysql::wikimania_scholarships::app_user
    $mysql_pass = $passwords::mysql::wikimania_scholarships::app_password
    $log_file   = "udp://${udp2log_dest}/scholarships"

    system::role { 'wikimania_scholarships':
        description => 'Wikimania Scholarships server'
    }

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

    httpd::site { 'scholarships.wikimedia.org':
        content => template('wikimania_scholarships/apache.conf.erb'),
    }

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

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