Puppet Class: profile::releases::common

Defined in:
modules/profile/manifests/releases/common.pp

Overview

Parameters:

  • sitename (Stdlib::Fqdn) (defaults to: lookup('profile::releases::mediawiki::sitename'))
  • deployment_server (Stdlib::Host) (defaults to: lookup('deployment_server'))
  • active_server (Stdlib::Fqdn) (defaults to: lookup('releases_server'))
  • secondary_servers (Array[Stdlib::Fqdn]) (defaults to: lookup('releases_servers_failover'))
  • server_admin (String) (defaults to: lookup('profile::releases::mediawiki::server_admin'))


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
# File 'modules/profile/manifests/releases/common.pp', line 1

class profile::releases::common(
    Stdlib::Fqdn $sitename = lookup('profile::releases::mediawiki::sitename'),
    Stdlib::Host $deployment_server = lookup('deployment_server'),
    Stdlib::Fqdn $active_server = lookup('releases_server'),
    Array[Stdlib::Fqdn] $secondary_servers = lookup('releases_servers_failover'),
    String $server_admin = lookup('profile::releases::mediawiki::server_admin'),
){

    # T205037
    $motd_ensure = mediawiki::state('primary_dc') ? {
        $::site => 'absent',
        default => 'present',
    }

    motd::script { 'rsync_source_warning':
        ensure   => $motd_ensure,
        priority => 1,
        content  => template('role/releases/rsync_source_warning.motd.erb'),
    }

    base::service_auto_restart { 'rsync': }

    $secondary_servers.each |String $secondary_server| {
        rsync::quickdatacopy { "srv-org-wikimedia-releases-${secondary_server}":
          ensure      => present,
          auto_sync   => true,
          delete      => true,
          source_host => $active_server,
          dest_host   => $secondary_server,
          module_path => '/srv/org/wikimedia/releases',
        }
    }

    class { '::httpd':
        modules => ['rewrite', 'headers', 'proxy', 'proxy_http'],
    }

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

    monitoring::service { 'https_releases':
        description   => "HTTPS ${sitename}",
        check_command => "check_https_url!${sitename}!/",
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Releases.wikimedia.org',
    }

    ferm::service { 'releases_http':
        proto  => 'tcp',
        port   => '80',
        srange => "(${::ipaddress} ${::ipaddress6})",
    }

    ferm::service { 'releases_http_deployment':
        proto  => 'tcp',
        port   => '80',
        srange => "(@resolve((${deployment_server})) @resolve((${deployment_server}), AAAA))"
    }

    backup::set { 'srv-org-wikimedia': }
}