On 02/21/2011 12:21 AM, Jan Dennis Bungart wrote:
> $keys = {
> "[email protected]" => "igbsiabsago...",
> "[email protected]" => "ragpiuebsjndv...",
> ...
> }
>
> define keygroup($users) {
> $my_users = regsubst($users, "\$", "-key-$name")
> ssh_authorized_key {
> $my_users:
> key => $keys[$name],
> name => $name,
> }
> }
>
> Solving the first problem made another one came up so now I'm searching a
> way to declare the key-type in addition to the key. That's because not all
> users might be using keys of type RSA only. Maybe somebody has another idea
> on how to extend the above mentioned approach? :)
The most simple thing would be to add a second hash:
$keytype = {
"[email protected]" => "rsa",
"[email protected]" => "ssh-dsa",
...
}
and then add "type => $keytype[$name]" to the ssh_authorized key.
Nested hashes would be more "proper" but apparently they are not without
issues (see other threads).
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.