aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/manifests/init.pp
blob: b70fab7a23e3739ee9275b1d82ad1c33818ec36c (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
class buildsystem {
   # $groups: array of secondary groups (only local groups, no ldap)
    define sshuser($homedir, $comment, $groups = []) {
        group {"$title": 
            ensure => present,
        }

        user {"$title":
            ensure => present,
            comment => $comment,
            managehome => true,
	    home => $homedir,
            gid => $title,
	    groups => $groups,
            shell => "/bin/bash",
            notify => Exec["unlock$title"],
            require => Group[$title],
        }

        # set password to * to unlock the account but forbid login through login
        exec { "unlock$title":
            command => "usermod -p '*' $title",
            refreshonly => true,
        }

        file { $homedir:
            ensure => "directory",
            owner  => $title,
            group  => $title,
            require => User[$title],
        }

        file { "$homedir/.ssh":
            ensure => "directory",
            mode   => 600,
            owner  => $title,
            group  => $title,
            require => File[$homedir],
        }
    }

    # A script to copy on valstar the 2010.1 rpms built on jonund
    class sync20101 inherits base {
        $build_login = $buildsystem::iurt::user::login
        # TODO user iurt::user::homedir too
        local_script { "sync2010.1":
	        content => template("buildsystem/sync2010.1"),
        }
    }

    # a script to build 2010.1 packages. used on jonund
    class iurt20101 inherits base {
        $build_login = $buildsystem::iurt::user::login
        local_script { "iurt2010.1":
	        content => template("buildsystem/iurt2010.1"),
        }
    }
}