/[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 2148 - (show annotations) (download)
Sun Jan 8 01:17:55 2012 UTC (12 years, 2 months ago) by misc
File size: 1900 byte(s)
remove values already set by default
1 class mirror {
2 class base {
3 $bindir = '/usr/local/bin'
4 $locksdir = '/home/mirror/locks'
5 file { "$locksdir":
6 ensure => directory,
7 owner => mirror,
8 group => mirror,
9 mode => 755
10 }
11
12 group {"mirror":
13 ensure => present,
14 }
15
16 user {"mirror":
17 ensure => present,
18 comment => "System user use to run mirror scripts",
19 managehome => true,
20 gid => mirror,
21 shell => "/bin/bash",
22 }
23 }
24
25 define mirrordir ($remoteurl, $localdir, $rsync_options="-avH --delete") {
26 include base
27 $lockfile = "$locksdir/$name"
28 file { "$localdir":
29 ensure => directory,
30 owner => mirror,
31 group => mirror,
32 mode => 755,
33 }
34 file { "mirror_$name":
35 path => "$bindir/mirror_$name",
36 mode => 755,
37 content => template("mirror/mirrordir"),
38 }
39
40 cron { "mirror_$name":
41 user => mirror,
42 minute => '*/10',
43 command => "$bindir/mirror_$name",
44 require => File["mirror_$name"],
45 }
46 }
47
48 # For main Mageia mirror
49 class main inherits base {
50 file { "update_timestamp":
51 path => "$bindir/update_timestamp",
52 mode => 755,
53 content => template("mirror/update_timestamp")
54 }
55
56 cron { mirror:
57 user => mirror,
58 minute => '*/10',
59 command => "$bindir/update_timestamp",
60 require => [File["update_timestamp"], User['mirror']],
61 }
62 }
63
64 class mageia inherits base {
65 mirrordir { "mageia":
66 remoteurl => "rsync://rsync.$domain/mageia",
67 localdir => '/distrib/mageia',
68 }
69 }
70
71 class newrelease inherits base {
72 mirrordir { "newrelease":
73 remoteurl => "rsync://rsync.$domain/newrelease",
74 localdir => '/distrib/newrelease',
75 }
76 }
77
78 class mdv2010spring inherits base {
79 mirrordir { "mdv2010.1":
80 remoteurl => "rsync://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/2010.1",
81 localdir => '/distrib/mandriva/',
82 }
83 }
84 }

  ViewVC Help
Powered by ViewVC 1.1.30