FAQ
Hello,
I am trying to establish an Puppet infrastructure starting with user and
group management.
For that reason, i created 2 modules: userloader and group.
Userloader contains a 'function' as template to add users, the module group
all groups to add.

If the groups are on every system, adding my people within the site.pp
works well. But I don't want to have every group on every system, they
should be created dynamically.

So i tried to add an user with the group "fubar". It failed, because
"fubar" is not a group on the system. my group module does contain "fubar",
just without "ensure => present". My config setup:


Thats my "userloader" (often described as user_add):

define userloader ($uid, $gid, $groups, $comment, $password, $sshkeytype,
$sshkey) {
$user_home = $operatingsystem ? {
Solaris => '/export/home',
SLES => '/home',
}
$sshkeytypeChecked = $sshkeytype ? {
'' => 'ssh-rsa',
default => $sshkeytype,
}
$sshkeyChecked = $sshkey ? {
'' => 'notDefined',
default => $sshkey,
}
user { $title:
uid => $uid,
gid => $gid,
groups => $groups,
comment => $comment,
password => $password,
home => "${user_home}/${title}",
managehome => true,
shell => '/bin/bash',
ensure => present,
}
ssh_authorized_key { $title:
user => $title,
type => $sshkeytypeChecked,
key => $sshkeyChecked,
name => $comment,
ensure => present,
}
}



Thats my group module with all groups:

class group {
### primary groups
group { groupA:
gid => 1000,
ensure => present,
}
### secondary groups
group { secgroupX:
gid => 1200,
ensure => present,
}
group { secgroupY:
gid => 1205,
}
}



And finally my testuser:

userloader { 'testuser':
uid => 1234,
gid => 1000,
groups => [secgroupX,secgroupY],
comment => 'any name',
password => 'XXXXX',
sshkeytype => 'xxx',
sshkey => 'xxx',
}


Could anybody tell me how to add the secgroupY dynamically? (only if it's
needed)


Thank you,
Alex

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedFeb 19, '13 at 2:38p
activeFeb 20, '13 at 12:06p
posts2
users2
websitepuppetlabs.com

2 users in discussion

Alexander Winkler: 1 post Felix Frank: 1 post

People

Translate

site design / logo © 2022 Grokbase