/[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 393 - (show annotations) (download)
Mon Nov 22 13:21:17 2010 UTC (13 years, 5 months ago) by blino
File size: 2560 byte(s)
extract a 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($user, $homedir, $comment) {
43 group {"$user":
44 ensure => present,
45 }
46
47 user {"$user":
48 ensure => present,
49 comment => $comment,
50 managehome => true,
51 gid => $user,
52 shell => "/bin/bash",
53 notify => Exec["unlock$user"],
54 }
55
56 # set password to * to unlock the account but forbid login through login
57 exec { "unlock$user":
58 command => "usermod -p '*' $user",
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 => $user,
70 group => $user,
71 }
72 }
73
74 class iurtuser {
75 sshuser($build_login, $build_home_dir, "System user used to run build bots")
76 }
77
78 class iurt {
79 include sudo
80 include iurtuser
81 ssh::auth::client { $build_login: }
82
83 # build node common settings
84 # we could have the following skip list to use less space:
85 # '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/'
86 $package_list = ['task-bs-cluster-chroot', 'iurt']
87 package { $package_list:
88 ensure => installed;
89 }
90
91 file { "$build_home_dir/.iurt.cauldron.conf":
92 ensure => present,
93 owner => $build_login,
94 group => $build_login,
95 mode => 644,
96 content => template("buildsystem/iurt.cauldron.conf")
97 }
98
99 file { "/etc/sudoers.d/iurt":
100 ensure => present,
101 owner => root,
102 group => root,
103 mode => 440,
104 content => template("buildsystem/sudoers.iurt")
105 }
106 }
107 }

  ViewVC Help
Powered by ViewVC 1.1.30