diff options
Diffstat (limited to 'modules/mirror_cleaner')
-rw-r--r-- | modules/mirror_cleaner/manifests/base.pp | 6 | ||||
-rw-r--r-- | modules/mirror_cleaner/manifests/init.pp | 32 | ||||
-rw-r--r-- | modules/mirror_cleaner/manifests/orphans.pp | 22 |
3 files changed, 29 insertions, 31 deletions
diff --git a/modules/mirror_cleaner/manifests/base.pp b/modules/mirror_cleaner/manifests/base.pp new file mode 100644 index 00000000..8ef82856 --- /dev/null +++ b/modules/mirror_cleaner/manifests/base.pp @@ -0,0 +1,6 @@ +class mirror_cleaner::base { + file { '/usr/local/bin/orphans_cleaner.pl': + mode => '0755', + source => 'puppet:///modules/mirror_cleaner/orphans_cleaner.pl', + } +} diff --git a/modules/mirror_cleaner/manifests/init.pp b/modules/mirror_cleaner/manifests/init.pp index 7602c08f..615b4ffe 100644 --- a/modules/mirror_cleaner/manifests/init.pp +++ b/modules/mirror_cleaner/manifests/init.pp @@ -1,31 +1 @@ -class mirror_cleaner { - class base { - file { "/usr/local/bin/orphans_cleaner.pl": - mode => 755, - source => 'puppet:///modules/mirror_cleaner/orphans_cleaner.pl', - } - } - - define orphans($base) { - include mirror_cleaner::base - - $orphan_dir = "/distrib/archive/orphans" - - file { $orphan_dir: - ensure => directory - } - - cron { "clean orphans $name": - command => "/usr/local/bin/orphans_cleaner.pl $base/$name $orphan_dir", - hour => 5, - minute => 30, - user => root, - } - - tidy { $orphan_dir: - age => "4w", - recurse => true, - matches => ["*.rpm"], - } - } -} +class mirror_cleaner { } diff --git a/modules/mirror_cleaner/manifests/orphans.pp b/modules/mirror_cleaner/manifests/orphans.pp new file mode 100644 index 00000000..c04192f6 --- /dev/null +++ b/modules/mirror_cleaner/manifests/orphans.pp @@ -0,0 +1,22 @@ +define mirror_cleaner::orphans($base) { + include mirror_cleaner::base + + $orphan_dir = '/distrib/archive/orphans' + + file { $orphan_dir: + ensure => directory + } + + cron { "clean orphans $name": + command => "/usr/local/bin/orphans_cleaner.pl $base/$name $orphan_dir", + hour => 5, + minute => 30, + user => root, + } + + tidy { $orphan_dir: + age => '4w', + recurse => true, + matches => ['*.rpm'], + } +} |