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

  ViewVC Help
Powered by ViewVC 1.1.30