On 02/21/2011 12:21 AM, Jan Dennis Bungart wrote: > $keys = { > "j...@mail.com" => "igbsiabsago...", > "j...@mail.com" => "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 = { "j...@mail.com" => "rsa", "j...@mail.com" => "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 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.