Dear all
I am looking for a solution for a module to define alle possible user and
then install the one or more user from that module if needed on a server,
but not all of them.
My idea is something like this. Can I define a user in the nodes.pp at a
special Server to install that user?
init.pp
class admin_user::group {
group { "group1":
gid => "888",
ensure => present,
}
}
class admin_user {
include admin_user::group, admin_user::list
}
list.pp with many user like this
class admin_user::list {
admin_user::useradd { "test1":
comment => "test1",
uid => "1032",
gid => "888",
shell => "/bin/bash",
password => '$6$QMhC7iyQ$CeUQnyZRaqzUp1/jkH61SaE7gz/',
sshkeytype => "rsa",
sshkey =>
"AAAAB3NzaC1yc2EAAAABIwAAA4gZcD7cxU7Yu2Gs4iL5bycu1nSb0/U4rGLe5OipRtqkwkfk93KX/i6N8=",
}
admin_user::useradd { "test2":
comment => "test2",
uid => "2012",
gid => "888",
shell => "/bin/bash",
password => '$6$0vY.Ob.b$uF0JMxjptxEq9gj72KrU7CqB7ez0gCt6fAB1',
sshkeytype => "rsa",
sshkey =>
"AAAAB3NzaC1yc2EAA/QtjZcPsaAhdZMsNU9xJ0Hb1VX3+vaAX1pA4F1Lq87ZBrZxrTS2F0G7hHJDffhqwlYoWfl1755hWeNeNZWQBcF"
}
}
and useradd.pp
define admin_user::useradd ( $comment, $uid, $group, $gid, $password,
$shell, $sshkeytype, $sshkey) {
include admin_user::group
$username = $title
user { $username:
ensure => present,
comment => "$comment",
uid => "$uid",
gid => "$gid",
shell => "$shell",
home => "/home/$username",
managehome => true,
forcelocal => true,
password => "$password",
require => Group["baaderadm"],
}
ssh_authorized_key { $username:
user => "$username",
type => "$sshkeytype",
key => "$sshkey",
require => User["$username"],
}
}
nodes.pp
node 'vm6742.muc.baag' inherits base {
$user = "test1"
include jre17_32bit
}
Maybe I need to split the list.pp in separate files for every user, but I
do not know how to request a specific user.
Maybe something like that: include addmin_user::test1
I could create a modul for every user and add it to a server, but I think
that is not a good solution.
Best regards
Andreas
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.