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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1854 - (show annotations) (download)
Tue Jul 19 01:14:54 2011 UTC (12 years, 9 months ago) by misc
File size: 817 byte(s)
add a module to clean orphan, as discussed on the ml :
- move rpm without a corresponding src.rpm to a directory after 2 weeks
- remove files after 1 month

1 class mirror_cleaner {
2 class base {
3 file { "/usr/local/bin/orphans_cleaner.pl":
4 ensure => present,
5 owner => root,
6 group => root,
7 mode => 755,
8 source => 'puppet:///modules/mirror_cleaner/orphans_cleaner.pl',
9 }
10 }
11
12 define orphans($base) {
13 include mirror_cleaner::base
14
15 $orphan_dir = "$base/$name"
16
17 file { $orphan_dir:
18 ensure => directory
19 }
20
21 cron { "clean orphans $name":
22 command => "/usr/local/bin/orphans_cleaner.pl $base/$name $orphan_dir",
23 hour => 5,
24 minute => 30,
25 user => root,
26 }
27
28 tidy { $orphan_dir:
29 age => "4w",
30 recurse => true,
31 matches => ["*.rpm"],
32 }
33 }
34 }

  ViewVC Help
Powered by ViewVC 1.1.30