/
common.yaml
415 lines (364 loc) · 10.3 KB
/
common.yaml
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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
---
classes:
- metacpan
# Configure munin master here, but
# load the class on the specific master
# lw-mc-01
munin::server: &munin_master 50.28.18.102
munin::master::collect_nodes: disabled
munin::master::html_strategy: cgi
munin::master::graph_strategy: cgi
munin::master::htmldir: /var/www/munin
munin::master::node_definitions:
'lw-mc-01.metacpan.org':
address: 50.28.18.102
'lw-mc-02.metacpan.org':
address: 50.28.18.103
'lw-mc-03.metacpan.org':
address: 50.28.18.168
'bm-mc-01.metacpan.org':
address: 5.153.225.19
'bm-mc-02.metacpan.org':
address: 5.153.225.20
'bm-mc-03.metacpan.org':
address: 46.43.35.68
# Munin node config
munin::node::allow:
- *munin_master
- 127.0.0.1 # localhost
munin::node::service_ensure: running
munin::node::export_node: disabled
munin::node::host_name: "%{hostname}.metacpan.org"
munin::node::plugins:
'nfs4_client':
ensure: 'absent'
'nfs_client':
ensure: 'absent'
'nfsd4':
ensure: 'absent'
'nfsd':
ensure: 'absent'
'sensors_fan':
target: '/usr/share/munin/plugins/sensors_'
ensure: 'link'
config: ['user metacpan']
'sensors_temp':
target: '/usr/share/munin/plugins/sensors_'
ensure: 'link'
config: ['user metacpan']
'sensors_volt':
target: '/usr/share/munin/plugins/sensors_'
ensure: 'link'
config: ['user metacpan']
# Email config default (overloaded in production)
exim::smarthost: 'localhost'
exim::config_type: 'internet'
# Defaults
perl::version: '5.22.2'
metacpan::user: 'metacpan'
metacpan::group: 'metacpan'
metacpan::users:
metacpan:
expire_password : false
bin_dir: true
# Where we mirror cpan with the rrrclient
# also where cpan.metacpan.org serves from
metacpan::cpan_mirror: '/mnt/lv-cpan'
# linked to var/tmp/metacpan
metacpan::tmp_dir: '/mnt/lv-metacpan--tmp'
# We don't want watcher enabled
metacpan::watcher::enable: false
# We don't want to have CPAN synced
metacpan::rrrclient::enable: false
# Elasticsearch basic options
metacpan::elasticsearch::version: 2.4.3
metacpan::elasticsearch::memory: '40m'
metacpan::elasticsearch::datadir: '/mnt/lv-elasticsearch'
metacpan::elasticsearch::scripts:
status_is_latest:
a_value: 1
score_version_numified:
a_value: 1
prefer_shorter_module_names_400:
a_value: 1
prefer_shorter_module_names_100:
a_value: 1
# Install logstash but don't run by default
metacpan::logstash::status: disabled
metacpan::web::starman:
metacpan-web:
git_source: 'https://github.com/metacpan/metacpan-web.git'
git_revision: 'master'
vhost_ssl_only: true
vhost_bare: true
vhost_aliases:
- 'v1.metacpan.org'
- 'metacpan.org'
- "lo.metacpan.org"
- "%{hostname}.metacpan.org"
starman_port: 5001
starman_workers: 3
vhost_extra_configs:
trailing_slash_rewrite:
template: 'trailing_slash'
metacpan-api:
git_source: 'https://github.com/metacpan/metacpan-api.git'
git_revision: 'master'
vhost_ssl: true
vhost_bare: true
vhost_aliases:
- 'api.metacpan.org'
- "api-v1.metacpan.org"
- "api.lo.metacpan.org"
- "api.%{hostname}.metacpan.org"
- "st.aticpan.org"
starman_port: 5000
starman_workers: 2
vhost_extra_proxies:
proxy_cpan_index:
location: '/v1/cpan'
proxy_v1:
location: '/v1'
vhost_extra_configs:
socket_io:
template: 'socket_io'
github-meets-cpan:
git_source: 'https://github.com/metacpan/github-meets-cpan.git'
git_revision: 'master'
vhost_bare: true
vhost_aliases:
- 'gh.metacpan.org'
- "gh.lo.metacpan.org"
- "gh.%{hostname}.metacpan.org"
starman_port: 5002
starman_workers: 1
api-v0-shim:
git_source: 'https://github.com/metacpan/metacpan-api-v0-shim.git'
git_revision: 'master'
vhost_bare: true
vhost_aliases:
- 'api-v0-shim.metacpan.org'
starman_port: 5003
starman_workers: 1
metacpan::web::static:
metacpan-cpan-static:
vhost_html: "%{hiera('metacpan::cpan_mirror')}"
vhost_ssl: true
vhost_autoindex: true
vhost_aliases:
- 'cpan.metacpan.org'
- "cpan.lo.metacpan.org"
- "cpan.%{hostname}.metacpan.org"
vhost_extra_configs:
fastly_surrogate_headers:
template: 'fastly'
munin:
vhost_html: "/var/www/munin"
vhost_ssl: false
vhost_bare: true
vhost_autoindex: false
vhost_aliases:
- 'munin.metacpan.org'
- "munin.%{hostname}.metacpan.org"
vhost_extra_configs:
munin_cgi:
template: 'munin_cgi'
metacpan-web-redirect:
vhost_aliases:
- 'www.metacpan.org'
- 'www.lo.metacpan.org'
- "www.%{hostname}.metacpan.org"
vhost_bare: true
vhost_ssl: true
vhost_extra_configs:
rewrite_to_https:
template: 'rewrite'
metacpan-vmbox:
vhost_html: /home/%{hiera('metacpan::user')}/metacpan-vmbox
vhost_autoindex: true
vhost_aliases:
- 'vmbox.metacpan.org'
metacpan-explorer:
git_source: 'https://github.com/metacpan/metacpan-explorer.git'
git_revision: 'master'
vhost_html: /home/%{hiera('metacpan::user')}/metacpan-explorer/build
vhost_aliases:
- 'explorer.metacpan.org'
- "explorer.lo.metacpan.org"
- "explorer.%{hostname}.metacpan.org"
metacpan-sco:
vhost_bare: true
vhost_aliases:
- 'search.cpan.org' # not fastly
- "cpansearch.perl.org" # not fastly
- 'sco.metacpan.org'
- "sco.lo.metacpan.org"
- "sco.%{hostname}.metacpan.org"
- ".mcpan.org"
vhost_extra_configs:
rewrite:
template: 'rewrite'
# NOTE: set to `absent` here - turn on in the node
metacpan::crons::general:
import_authors:
cmd : "/home/%{hiera('metacpan::user')}/metacpan-api/bin/cron/author.sh"
minute : 0
user: "%{hiera('metacpan::user')}"
ensure : absent
user_data_index_backups:
cmd : "/home/%{hiera('metacpan::user')}/metacpan-api/bin/cron/backups.sh"
minute : 0
hour: 3
user: 'root'
ensure : absent
run_puppet:
cmd : "/etc/puppet/run.sh >/var/log/puppet/last_run.log 2>&1"
minute : 0
user: 'root'
ensure : absent
backup_api:
cmd : "rsync -a /home/%{hiera('metacpan::user')}/metacpan-api/var/backup /mnt/backup/api >/dev/null 2>&1"
hour : 4
minute : 0
ensure : absent
metacpan_clean_up_source:
cmd : "test -e %{hiera('metacpan::tmp_dir')}/starman/metacpan-api/source/ && find %{hiera('metacpan::tmp_dir')}/starman/metacpan-api/source/ -mindepth 2 -maxdepth 2 -type d -mtime +30 | head -50000 | xargs rm -rf"
hour : 3
minute : 22
ensure : absent
metacpan_sitemaps:
cmd : "/home/%{hiera('metacpan::user')}/bin/metacpan-web-carton-exec bin/generate_sitemap.pl"
hour : 2
minute : 30
ensure : absent
github-meets-cpan:
cmd : "/home/%{hiera('metacpan::user')}/bin/github-meets-cpan-carton-exec cron/update.pl"
minute : 20
hour : 1
ensure : absent
swat_monitoring:
cmd : "/bin/sh /home/%{hiera('metacpan::user')}/metacpan-monitoring/cron.sh"
minute : '0'
ensure : absent
# NOTE: set to `absent` here - turn on in the node
metacpan::crons::api:
# Remvoe author - now in wrapper script in general
author:
cmd : author
minute : 0
ensure : absent
ratings:
cmd : ratings
minute : 20
ensure : absent
mirrors:
cmd : mirrors
minute : 0
ensure : absent
cpantesters:
cmd : cpantesters
hour : '*/6'
minute : 42
ensure : absent
# Force the latest as otherwise doesn't always work correctly
# 21:08 < oalders> the initial problem was that we got tarballs _before_ 02packages was updated
# 21:08 < oalders> so we indexed right away, but we could check perms until much later
# 21:09 < oalders> 02packages gets updated more frequently now, but i'm not sure if
# it's in real time. i thought it was every 5 minutes
latest:
cmd : 'latest >>/var/log/starman/metacpan-api/latest.log 2>&1'
minute : 30
ensure : absent
snapshot_cpan_index:
cmd : snapshot --snap --indices 'cpan' --snap-stub cpan --date-format '\%Y-\%m-\%d'
hour : 2
minute : 30
ensure : absent
snapshot_user_index:
cmd : snapshot --snap --indices 'user' --snap-stub user --date-format '\%Y-\%m-\%d'
hour : 2
minute : 5
ensure : absent
backup_favorite:
cmd : 'backup --index cpan --type favorite'
hour : 2
minute : 22
ensure : absent
backup_author:
cmd : 'backup --index cpan --type author'
hour : 2
minute : 28
ensure : absent
backup_user:
cmd : 'backup --index user'
hour : 2
minute : 25
ensure : absent
backup_purge:
cmd : 'backup --purge'
minute : 25
hour : 1
ensure : absent
session: # clear out old sessions
cmd : session
minute : 30
hour: 3
ensure : absent
release:
cmd : "release --queue --skip --age 48 --detect_backpan --latest /home/%{hiera('metacpan::user')}/CPAN/authors/id/"
hour : 0
minute : 5
ensure : absent
# PAUSE updates these files every 5 minutes. For now we'll refresh it every 10.
packages:
cmd : packages
minute : '*/10'
ensure : absent
permission:
cmd : permission
minute : '*/10'
ensure : absent
tickets:
cmd : tickets
minute : 12
hour : 3
ensure : absent
river:
cmd : 'river'
minute : 30
hour : 1
ensure : absent
metacpan::fw_ports:
http:
order: 210
port: 80
source: '0.0.0.0/0'
https:
order: 210
port: 443
source: '0.0.0.0/0'
munin:
order: 110
port: 4949
source: *munin_master
nginx::allowed:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
- 127.0.0.1/32
# https://api.fastly.com/public-ip-list + 127.0.0.1/32
- 23.235.32.0/20
- 43.249.72.0/22
- 103.244.50.0/24
- 103.245.222.0/23
- 103.245.224.0/24
- 104.156.80.0/20
- 151.101.0.0/16
- 157.52.64.0/18
- 172.111.64.0/18
- 185.31.16.0/22
- 199.27.72.0/21
- 199.232.0.0/16
- 202.21.128.0/24
- 203.57.145.0/24
- 82.217.152.79/32