Puppet Class: profile::wmcs::services::postgres::osm_primary

Defined in:
modules/profile/manifests/wmcs/services/postgres/osm_primary.pp

Overview

Parameters:

  • osm_password (Any) (defaults to: hiera('profile::wmcs::services::postgres::osm_password'))
  • kolossos_password (Any) (defaults to: hiera('profile::wmcs::services::postgres::kolossos_password'))
  • aude_password (Any) (defaults to: hiera('profile::wmcs::services::postgres::aude_password'))
  • planemad_password (Any) (defaults to: hiera('profile::wmcs::services::postgres::planemad_password'))


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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'modules/profile/manifests/wmcs/services/postgres/osm_primary.pp', line 2

class profile::wmcs::services::postgres::osm_primary (
    $osm_password = hiera('profile::wmcs::services::postgres::osm_password'),
    $kolossos_password = hiera('profile::wmcs::services::postgres::kolossos_password'),
    $aude_password = hiera('profile::wmcs::services::postgres::aude_password'),
    $planemad_password = hiera('profile::wmcs::services::postgres::planemad_password'),
){
    include profile::wmcs::services::postgres::primary
    class {'osm': }

    postgresql::user { 'prometheus@localhost':
        user     => 'prometheus',
        database => 'postgres',
        type     => 'local',
        method   => 'peer',
    }

    postgresql::user { 'osmupdater':
        user     => 'osmupdater',
        database => 'gis',
        type     => 'local',
        method   => 'peer',
    }

    class { 'osm::prometheus':
        state_path      => '/srv/osmosis/state.txt',
        prometheus_path => '/var/lib/prometheus/node.d/osm_sync_lag.prom',
    }

    # Create the spatialdb
    postgresql::spatialdb { 'gis': }
    osm::planet_sync { 'gis':
        use_proxy  => true,
        proxy_host => "webproxy.${::site}.wmnet",
        proxy_port => 8080,
        period     => 'day',
        hours      => [1],
        minute     => '17',
    }
    # Add coastlines
    osm::shapefile_import { 'gis-coastlines':
        database         => 'gis',
        input_shape_file => '/srv/labsdb/coastlines-split-4326/lines',
        shape_table      => 'coastlines',
        require          => Postgresql::Spatialdb['gis']
    }
    # Add split land polygons
    osm::shapefile_import { 'gis-land_polygons':
        database         => 'gis',
        input_shape_file => '/srv/labsdb/land-polygons-split-4326/land_polygons',
        shape_table      => 'land_polygons',
        require          => Postgresql::Spatialdb['gis']
    }

    # OSM user
    postgresql::user { 'osm@labs':
            ensure   => 'present',
            user     => 'osm',
            password => $osm_password,
            cidr     => '10.68.16.0/21',
            type     => 'host',
            method   => 'trust',
            database => 'gis',
    }
    postgresql::user { 'osm@eqiad1r':
            ensure   => 'present',
            user     => 'osm',
            password => $osm_password,
            cidr     => '172.16.0.0/21',
            type     => 'host',
            method   => 'trust',
            database => 'gis',
    }

    # Specific users and databases
    postgresql::spatialdb { 'u_kolossos': }
    postgresql::user { 'kolossos@labs':
            ensure   => 'present',
            user     => 'kolossos',
            password => $kolossos_password,
            cidr     => '10.68.16.0/21',
            type     => 'host',
            method   => 'md5',
            database => 'u_kolossos',
    }
    postgresql::user { 'kolossos@eqiad1r':
            ensure   => 'present',
            user     => 'kolossos',
            password => $kolossos_password,
            cidr     => '172.16.0.0/21',
            type     => 'host',
            method   => 'md5',
            database => 'u_kolossos',
    }

    postgresql::spatialdb { 'u_aude': }
    postgresql::user { 'aude@labs':
            ensure   => 'present',
            user     => 'aude',
            password => $aude_password,
            cidr     => '10.68.16.0/21',
            type     => 'host',
            method   => 'md5',
            database => 'u_aude',
    }
    postgresql::user { 'aude@eqiad1r':
            ensure   => 'present',
            user     => 'aude',
            password => $aude_password,
            cidr     => '172.16.0.0/21',
            type     => 'host',
            method   => 'md5',
            database => 'u_aude',
    }

    postgresql::spatialdb { 'wikimaps_atlas': }
    postgresql::user { 'planemad@labs':
            ensure   => 'present',
            user     => 'planemad',
            password => $planemad_password,
            cidr     => '10.68.16.0/21',
            type     => 'host',
            method   => 'md5',
            database => 'wikimaps_atlas',
    }
    postgresql::user { 'planemad@eqiad1r':
            ensure   => 'present',
            user     => 'planemad',
            password => $planemad_password,
            cidr     => '172.16.0.0/21',
            type     => 'host',
            method   => 'md5',
            database => 'wikimaps_atlas',
    }

    class {'rsync::server': }
    rsync::server::module { 'osm_expired_tiles':
        path    => '/srv/osm_expire',
        comment => 'OpenStreetMap expired tile list',
        uid     => 'postgres',
        gid     => 'postgres',
    }

    nrpe::monitor_service { 'rsync_server_running':
        description  => 'Check if rsync server is running',
        nrpe_command => "/usr/lib/nagios/plugins/check_procs \
                         -w 1:1 -c 1:1 -C rsync --ereg-argument-array \
                         '/usr/bin/rsync --daemon --no-detach'",
        notes_url    => 'https://wikitech.wikimedia.org/wiki/OSM_Tileserver',
    }
}