aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/manifests/mgarepo.pp
blob: 29be033ce50d17704e31590ed74a3294bf6bab51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class buildsystem { 
    class mgarepo {
        package { ['mgarepo','rpm-build']: }

        file {
            "/etc/mgarepo.conf": content => template("buildsystem/mgarepo.conf");
            "/etc/repsys.conf": content => template("buildsystem/mgarepo.conf");
        }

        file { "$packages_archivedir":
            ensure => "directory",
            owner  => $sched_login,
            require => File[$sched_home_dir],
        }

        file { "$sched_home_dir/repsys":
            ensure => "directory",
            owner  => $sched_login,
            require => File[$sched_home_dir],
        }

        file { ["$sched_home_dir/repsys/tmp", "$sched_home_dir/repsys/srpms"]:
            ensure => "directory",
            owner  => $sched_login,
            group => "mga-packagers",
            mode => 1775,
            require => File["$sched_home_dir/repsys"],
        }

        # FIXME: disabled temporarly as upload dir is a symlink to /var/lib/repsys/uploads
        #file { "$sched_home_dir/uploads":
        #    ensure => "directory",
        #    owner  => $sched_login,
        #    require => File[$sched_home_dir],
        #}

	#FIXME This config information should be moved out of this class
        $releases = {
            'cauldron' => { 
                'core' => ['release','updates_testing','backports_testing','backports','updates'],
                'nonfree' => ['release','updates_testing','backports_testing','backports','updates'],
                'tainted' => ['release','updates_testing','backports_testing','backports','updates'],
            },
            '1' => { 
                'core' => ['release','updates_testing','backports_testing','backports','updates'],
                'nonfree' => ['release','updates_testing','backports_testing','backports','updates'],
                'tainted' => ['release','updates_testing','backports_testing','backports','updates'],
            },
            'infra_1' => { 
                'infra' => ['release']
            },
        }         

        import "create_upload_dir.rb"
        create_upload_dir { "$sched_home_dir/uploads":
            owner => $sched_login, 
            group => $sched_login,
            releases => $releases,
        } 

        Tidy {
            recurse => true,
            type    => "ctime",
        }

        tidy { "$sched_home_dir/uploads":
            age     => "2w",
        }

        tidy { "$packages_archivedir":
            age     => "1w",
            matches => "*.rpm",
        }
    }
}