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
|
# File 'modules/profile/manifests/mirrors/debian.pp', line 16
class profile::mirrors::debian {
require profile::mirrors
include passwords::mirrors
file { '/srv/mirrors/debian':
ensure => directory,
owner => 'mirror',
group => 'mirror',
mode => '0755',
}
package { 'ftpsync':
ensure => present,
}
# package doesn't ship that directory yet
file { '/etc/ftpsync':
ensure => directory,
owner => 'mirror',
group => 'mirror',
mode => '0555',
}
# this is our configuration for archvsync
file { '/etc/ftpsync/ftpsync.conf':
ensure => present,
owner => 'mirror',
group => 'mirror',
mode => '0444',
content => template('profile/mirrors/ftpsync.conf.erb'),
}
file { '/var/log/ftpsync':
ensure => directory,
owner => 'mirror',
group => 'mirror',
mode => '0755',
}
# allow the Debian syncproxy to trigger ftpsync runs over ssh
ssh::userkey { 'mirror':
source => 'puppet:///modules/profile/mirrors/ssh-debian-archvsync.pub',
}
firewall::service { 'mirrors_ssh':
proto => 'tcp',
port => 22,
srange => ['syncproxy2.wna.debian.org'],
}
# serve via rsync
rsync::server::module { 'debian':
path => '/srv/mirrors/debian/',
read_only => 'yes',
uid => 'nobody',
gid => 'nogroup',
}
nrpe::monitor_service {'check_debian_mirror':
description => 'Debian mirror in sync with upstream',
nrpe_command => '/usr/local/lib/nagios/plugins/check_apt_mirror /srv/mirrors/debian',
notes_url => 'https://wikitech.wikimedia.org/wiki/Mirrors',
}
}
|