39 |
|
|
40 |
} |
} |
41 |
|
|
42 |
define sshuser($user, $homedir, $comment) { |
define sshuser($homedir, $comment) { |
43 |
group {"$user": |
group {"$title": |
44 |
ensure => present, |
ensure => present, |
45 |
} |
} |
46 |
|
|
47 |
user {"$user": |
user {"$title": |
48 |
ensure => present, |
ensure => present, |
49 |
comment => $comment, |
comment => $comment, |
50 |
managehome => true, |
managehome => true, |
51 |
gid => $user, |
gid => $title, |
52 |
shell => "/bin/bash", |
shell => "/bin/bash", |
53 |
notify => Exec["unlock$user"], |
notify => Exec["unlock$title"], |
54 |
} |
} |
55 |
|
|
56 |
# set password to * to unlock the account but forbid login through login |
# set password to * to unlock the account but forbid login through login |
57 |
exec { "unlock$user": |
exec { "unlock$title": |
58 |
command => "usermod -p '*' $user", |
command => "usermod -p '*' $title", |
59 |
refreshonly => true, |
refreshonly => true, |
60 |
} |
} |
61 |
|
|
66 |
file { "$homedir/.ssh": |
file { "$homedir/.ssh": |
67 |
ensure => "directory", |
ensure => "directory", |
68 |
mode => 600, |
mode => 600, |
69 |
owner => $user, |
owner => $title, |
70 |
group => $user, |
group => $title, |
71 |
} |
} |
72 |
} |
} |
73 |
|
|
74 |
class iurtuser { |
class iurtuser { |
75 |
sshuser($build_login, $build_home_dir, "System user used to run build bots") |
sshuser { $build_login: |
76 |
|
homedir => $build_home_dir, |
77 |
|
comment => "System user used to run build bots", |
78 |
|
} |
79 |
} |
} |
80 |
|
|
81 |
class iurt { |
class iurt { |