/[adm]/puppet/modules/mirror/manifests/init.pp
ViewVC logotype

Contents of /puppet/modules/mirror/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2202 - (show annotations) (download)
Sun Jan 8 20:25:04 2012 UTC (12 years, 1 month ago) by misc
File size: 1932 byte(s)
refactor, reindent and cleanup the mirror module
1 class mirror {
2 class base {
3 $locksdir = '/home/mirror/locks'
4
5 file { "$locksdir":
6 ensure => directory,
7 owner => mirror,
8 group => mirror,
9 }
10
11 group {"mirror": }
12
13 user {"mirror":
14 comment => "System user use to run mirror scripts",
15 gid => mirror,
16 }
17 }
18
19 define mirrordir ($remoteurl, $localdir, $rsync_options="-avH --delete") {
20 include base
21 $lockfile = "$locksdir/$name"
22
23 file { "$localdir":
24 ensure => directory,
25 owner => mirror,
26 group => mirror,
27 }
28
29 local_script { "mirror_$name":
30 content => template("mirror/mirrordir"),
31 }
32
33 cron { "mirror_$name":
34 user => mirror,
35 minute => '*/10',
36 command => "$bindir/mirror_$name",
37 require => File["mirror_$name"],
38 }
39 }
40
41 # For main Mageia mirror
42 class main inherits base {
43 local_script { "update_timestamp":
44 content => template("mirror/update_timestamp")
45 }
46
47 cron { mirror:
48 user => mirror,
49 minute => '*/10',
50 command => "/usr/local/bin/update_timestamp",
51 require => [File["update_timestamp"], User['mirror']],
52 }
53 }
54
55 class mageia inherits base {
56 mirrordir { "mageia":
57 remoteurl => "rsync://rsync.$domain/mageia",
58 localdir => '/distrib/mageia',
59 }
60 }
61
62 class newrelease inherits base {
63 mirrordir { "newrelease":
64 remoteurl => "rsync://rsync.$domain/newrelease",
65 localdir => '/distrib/newrelease',
66 }
67 }
68
69 class mdv2010spring inherits base {
70 mirrordir { "mdv2010.1":
71 remoteurl => "rsync://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/2010.1",
72 localdir => '/distrib/mandriva/',
73 }
74 }
75 }

  ViewVC Help
Powered by ViewVC 1.1.30