aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/manifests/youri_submit.pp
blob: 73a269881bc3ba48ed0c8d62c9bf798f4937c656 (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
class buildsystem::youri_submit {
    include sudo
    include buildsystem::rpmlint
    include buildsystem::repository
    include buildsystem::scheduler::var

    $repository_root = $buildsystem::repository::dir
    $sched_home_dir = $buildsystem::scheduler::var::homedir
    $sched_login = $buildsystem::scheduler::var::login
    $packages_archivedir = "$sched_home_dir/old"

    local_script {
        'mga-youri-submit':
            content => template('buildsystem/mga-youri-submit');
        'mga-youri-submit.wrapper':
            content => template('buildsystem/mga-youri-submit.wrapper');
        'submit_package':
            content => template('buildsystem/submit_package.pl');
    }

    sudo::sudoers_config { 'mga-youri-submit':
        content => template('buildsystem/sudoers.youri')
    }
    # ordering is automatic :
    # http://docs.puppetlabs.com/learning/ordering.html#autorequire
    file {
        '/etc/youri/':
            ensure => 'directory';
        '/etc/youri/submit-todo.conf':
            content => template('buildsystem/youri/submit-todo.conf');
        '/etc/youri/submit-upload.conf':
            content => template('buildsystem/youri/submit-upload.conf');
        '/etc/youri/acl.conf':
            content => template('buildsystem/youri/acl.conf');
    }

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

    tidy { $packages_archivedir:
        type    => 'ctime',
        recurse => true,
        age     => '1w',
        matches => '*.rpm',
    }

    # FIXME use /usr/local/ once it will be in @INC
    file { '/usr/lib/perl5/vendor_perl/5.12.3/Youri/Repository/Mageia.pm':
        source => 'puppet:///modules/buildsystem/Mageia.pm',
    }

    $package_list= ['perl-SVN',
                    'mdv-distrib-tools',
                    'perl-Youri-Media',
                    'perl-Youri-Package',
                    'perl-Youri-Repository',
                    'perl-Youri-Utils',
                    'perl-Youri-Config',
                    'mga-youri-submit']

    package { $package_list: }
}