I currently have something set up for users like this:
virt_users.pp
class virt_my_users {
@user { "user1":
ensure => "present",
uid => "1001",
gid => "users",
comment => "user1",
home => "/home/user1",
shell => "/bin/bash"
}
@user { "user2":
ensure => "present",
uid => "1002",
gid => "users",
comment => "user2",
home => "/home/user2",
shell => "/bin/bash"
}
}
users.pp
class prod_users {
include virt_my_users
realize(
Group["users"],
User["user1"],
User["user2"],
)
}
site.pp
node host1 inherits default {
include prod_users
}
And I wanted to do something similar with the keys, defining the keys
for everyone in one place and then using it for several users on
multiple nodes. For instance the postgres user on some nodes might
have keys from developers and dba's but only a limited number of
people in the production environment.
All this is currently managed with some sh/awk scripts. We basically
have a file with a key. These keyfiles are grouped up into something
legible such as 'sysadmins' or 'dbas'. Then we have a node definition
containing the users on that node and the groups of keys to be
deployed to the users.
Ideally I would like something where I could have
node host1 inherits default {
include prod_users
}
class prod_users {
realize User['user1']
realize Sshkeys['user1'] # this bit would expand the groups of
keys and deploy them to user1
}
Hope that makes some sense to people :) I always have the option of
leaving the sh/awk solution as is so it's not top on my list but it
would be nice to manage everything from one place.