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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 394 - (show annotations) (download)
Mon Nov 22 13:22:43 2010 UTC (13 years, 5 months ago) by blino
File size: 2615 byte(s)
fix sshuser definition

1 class buildsystem {
2
3 class base {
4 $build_login = "iurt"
5 $build_home_dir = "/home/$build_login"
6 $sched_login = "schedbot"
7 $sched_home_dir = "/home/$sched_login"
8
9 include ssh::auth
10 ssh::auth::key { $build_login: } # declare a key for build bot: RSA, 2048 bits
11 }
12
13 class mainnode inherits base {
14 include iurtuser
15 ssh::auth::server { $build_login: }
16
17 package { "task-bs-cluster-main":
18 ensure => "installed"
19 }
20 }
21
22 class buildnode inherits base {
23 include iurt
24 }
25
26 class scheduler {
27 # ulri
28 }
29
30 class dispatcher {
31 # emi
32 }
33
34 class repsys {
35 package { 'repsys':
36
37 }
38
39
40 }
41
42 define sshuser($homedir, $comment) {
43 group {"$title":
44 ensure => present,
45 }
46
47 user {"$title":
48 ensure => present,
49 comment => $comment,
50 managehome => true,
51 gid => $title,
52 shell => "/bin/bash",
53 notify => Exec["unlock$title"],
54 }
55
56 # set password to * to unlock the account but forbid login through login
57 exec { "unlock$title":
58 command => "usermod -p '*' $title",
59 refreshonly => true,
60 }
61
62 file { $homedir:
63 ensure => "directory",
64 }
65
66 file { "$homedir/.ssh":
67 ensure => "directory",
68 mode => 600,
69 owner => $title,
70 group => $title,
71 }
72 }
73
74 class iurtuser {
75 sshuser { $build_login:
76 homedir => $build_home_dir,
77 comment => "System user used to run build bots",
78 }
79 }
80
81 class iurt {
82 include sudo
83 include iurtuser
84 ssh::auth::client { $build_login: }
85
86 # build node common settings
87 # we could have the following skip list to use less space:
88 # '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/'
89 $package_list = ['task-bs-cluster-chroot', 'iurt']
90 package { $package_list:
91 ensure => installed;
92 }
93
94 file { "$build_home_dir/.iurt.cauldron.conf":
95 ensure => present,
96 owner => $build_login,
97 group => $build_login,
98 mode => 644,
99 content => template("buildsystem/iurt.cauldron.conf")
100 }
101
102 file { "/etc/sudoers.d/iurt":
103 ensure => present,
104 owner => root,
105 group => root,
106 mode => 440,
107 content => template("buildsystem/sudoers.iurt")
108 }
109 }
110 }

  ViewVC Help
Powered by ViewVC 1.1.30