aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2012-03-16 22:46:47 +0000
committerMichael Scherer <misc@mageia.org>2012-03-16 22:46:47 +0000
commit53a0d6357d0abfa86080fbc842608f0eaa205e60 (patch)
tree7531bbccf4fbcdf86ee92814eddae3982c8c1355 /modules
parent7a1d24e0af4fe9ac03637163cbad4c3f527d47ef (diff)
downloadpuppet-53a0d6357d0abfa86080fbc842608f0eaa205e60.tar
puppet-53a0d6357d0abfa86080fbc842608f0eaa205e60.tar.gz
puppet-53a0d6357d0abfa86080fbc842608f0eaa205e60.tar.bz2
puppet-53a0d6357d0abfa86080fbc842608f0eaa205e60.tar.xz
puppet-53a0d6357d0abfa86080fbc842608f0eaa205e60.zip
split sshuser in a separate file. Clean various puppetlint
warning and errors, and use $name instead of $title for consistency with the rest of the manifests ( but $title was perfectly correct too )
Diffstat (limited to 'modules')
-rw-r--r--modules/buildsystem/manifests/init.pp40
-rw-r--r--modules/buildsystem/manifests/sshuser.pp36
2 files changed, 36 insertions, 40 deletions
diff --git a/modules/buildsystem/manifests/init.pp b/modules/buildsystem/manifests/init.pp
index b70fab7a..af88d4ef 100644
--- a/modules/buildsystem/manifests/init.pp
+++ b/modules/buildsystem/manifests/init.pp
@@ -1,44 +1,4 @@
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
diff --git a/modules/buildsystem/manifests/sshuser.pp b/modules/buildsystem/manifests/sshuser.pp
new file mode 100644
index 00000000..0a1cd176
--- /dev/null
+++ b/modules/buildsystem/manifests/sshuser.pp
@@ -0,0 +1,36 @@
+# $groups: array of secondary groups (only local groups, no ldap)
+define buildsystem::sshuser($homedir, $comment, $groups = []) {
+ group { $name: }
+
+ user { $name:
+ comment => $comment,
+ managehome => true,
+ home => $homedir,
+ gid => $name,
+ groups => $groups,
+ shell => '/bin/bash',
+ notify => Exec["unlock $name"],
+ require => Group[$title],
+ }
+
+ # set password to * to unlock the account but forbid login through login
+ exec { "unlock $name":
+ command => "usermod -p '*' $name",
+ refreshonly => true,
+ }
+
+ file { $homedir:
+ ensure => directory,
+ owner => $name,
+ group => $name,
+ require => User[$name],
+ }
+
+ file { "$homedir/.ssh":
+ ensure => directory,
+ mode => '0600',
+ owner => $name,
+ group => $name,
+ require => File[$homedir],
+ }
+}