Puppet Class: profile::zuul::server

Defined in:
modules/profile/manifests/zuul/server.pp

Overview

Parameters:

  • conf_common (Any) (defaults to: lookup('zuul::common'))
  • conf_server (Any) (defaults to: lookup('profile::zuul::server::conf'))
  • service_enable (Any) (defaults to: lookup('profile::zuul::server::service_enable', {default_value => true}))
  • service_ensure (Any) (defaults to: lookup('profile::zuul::server::service_ensure', {default_value => 'running'}))
  • email_server (Any) (defaults to: lookup('profile::zuul::server::email_server'))
  • prometheus_nodes (Any) (defaults to: lookup('prometheus_nodes'))


1
2
3
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
# File 'modules/profile/manifests/zuul/server.pp', line 1

class profile::zuul::server(
    $conf_common = lookup('zuul::common'),
    $conf_server = lookup('profile::zuul::server::conf'),
    $service_enable = lookup('profile::zuul::server::service_enable', {default_value => true}),
    $service_ensure = lookup('profile::zuul::server::service_ensure', {default_value => 'running'}),
    $email_server = lookup('profile::zuul::server::email_server'),
    $prometheus_nodes = lookup('prometheus_nodes'),
) {
    system::role { 'zuul::server': description => 'Zuul server (scheduler)' }

    $monitoring_active = $service_enable ? {
        false   => 'absent',
        default => 'present',
    }
    class { '::zuul::monitoring::server':
        ensure           => $monitoring_active,
        prometheus_nodes => $prometheus_nodes,
    }
    # This ensures that the mtail package is installed,
    # /etc/default/mtail exists, and systemd service is prepped.
    class { '::mtail':
      logs => ['/var/log/zuul/error.log'],
    }

    $service_enable_real = $service_enable ? {
        false   => 'mask',
        default => true,
    }
    class { '::zuul::server':
        # Shared settings
        gerrit_server        => $conf_common['gerrit_server'],
        gerrit_user          => $conf_common['gerrit_user'],

        # Server settings
        gearman_server       => $conf_server['gearman_server'],
        gearman_server_start => $conf_server['gearman_server_start'],
        url_pattern          => $conf_server['url_pattern'],
        status_url           => $conf_server['status_url'],
        statsd_host          => $conf_server['statsd_host'],
        service_enable       => $service_enable_real,
        service_ensure       => $service_ensure,

        # Enable email configuration
        email_server         => $email_server,
    }

    if os_version('debian jessie') {
      $ic_clone_require = [Package['zuul']]
    } else {
      file { '/etc/zuul':
        ensure  => 'directory',
        owner   => 'zuul',
        group   => 'zuul',
        require => User['zuul'],
      }
      $ic_clone_require = [File['/etc/zuul']]
    }

    # Deploy Wikimedia Zuul configuration files.
    #
    # Describe the behaviors and jobs
    # Conf file is hosted in integration/config git repo
    git::clone { 'integration/config':
        directory => '/etc/zuul/wikimedia',
        owner     => 'zuul',
        group     => 'zuul',
        mode      => '0775',
        umask     => '002',
        origin    => 'https://gerrit.wikimedia.org/r/integration/config.git',
        branch    => $conf_server['config_git_branch'],
        require   => $ic_clone_require,
    }

}