Hi,

try this instead:

On 02/16/2011 11:19 AM, Jan wrote:
> Hi *,
> 
> I would like to create a pool of ssh pubkeys. The major goal is to be
> able to assign a single key to multiple users on a given node/system.
> 
> Okay, lets say we have the users: foo and bar. In my manifest I've
> created the following test definition for resource "jim":
> 
> ---------------------------------------------------------------------
> define sshpubkey::test($user) {
> 
>
    ssh_authorized_key { "$name-for-$user":
>         ensure => present,
>         user => "$user",
>         name => "jim@unique.email",
>         type  => ssh-rsa,
>         key => "[...KEY...]"
>       }
> ---------------------------------------------------------------------

In either case, you cannot name both your sshpubkey::test resources
"jim". Never ever. They must have unique names.

The whole apprach isn't especially sound. Is your "user pool" realized
using virtual resources?

You should have a define as follows:

define pooled_user($realname="anonymous") {
  user { "$name": description => $realname, ... }
  # insert code here to make sure ~/.ssh/ exists etc.
  ssh_authorized_key { "jim@uniqe.email_for_$name":
    key => YOUR_KEY_HERE,
    ...
  }
}

So you can have your user pool consist of virtual "pooled_user"
resources and realize at will.

HTH,
Felix

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

Reply via email to