Hi, i have written a class called ssh to manage authorized_keys. First i define my authorized_keys in this array: $authorized_key = { tim_at_caesium => ".............",} Then i have a define: define authorized_keys($ensure="present", $username) { ssh_authorized_key { $name: ensure => $ensure, type => "ssh-rsa", key => $authorized_key[$name], user => $username, } } And last but not least this case syntax to include my authorized_keys: case $hostname{ my_hostname: { authorized_keys { "testuser_at_machine1": username=> [ "testuser01","testuser02" ] } } } When i run puppet on the machine "my_hostname", puppet should installs the authorized_key "testuser_at_machine1" at user "testuser01" and "testuser02", but only the first user (testuser01) becomes the key. Can anyone help me, where is my mistake? Greetz Tim -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Use ssh::authorized_key On Aug 19, 2011 8:25 AM, "Tim Schmeling" <spaeter112@googlemail.com> wrote:> Hi, > > i have written a class called ssh to manage authorized_keys. > > First i define my authorized_keys in this array: > $authorized_key = { > tim_at_caesium => ".............",} > > Then i have a define: > define authorized_keys($ensure="present", $username) { > ssh_authorized_key { $name: > ensure => $ensure, > type => "ssh-rsa", > key => $authorized_key[$name], > user => $username, > } > } > > And last but not least this case syntax to include my authorized_keys: > case $hostname{ > my_hostname: { > authorized_keys { "testuser_at_machine1": > username=> [ "testuser01","testuser02" ] } > } > } > > > When i run puppet on the machine "my_hostname", puppet should installs > the authorized_key "testuser_at_machine1" at user "testuser01" and > "testuser02", but only the first user (testuser01) becomes the key. > > Can anyone help me, where is my mistake? > > Greetz > Tim > > -- > 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 topuppet-users+unsubscribe@googlegroups.com.> For more options, visit this group athttp://groups.google.com/group/puppet-users?hl=en.>-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, Aug 19, 2011 at 01:22:46AM -0700, Tim Schmeling wrote:> Hi, > > i have written a class called ssh to manage authorized_keys. > > First i define my authorized_keys in this array: > $authorized_key = { > tim_at_caesium => ".............",} > > Then i have a define: > define authorized_keys($ensure="present", $username) { > ssh_authorized_key { $name: > ensure => $ensure, > type => "ssh-rsa", > key => $authorized_key[$name], > user => $username, > } > } > > And last but not least this case syntax to include my authorized_keys: > case $hostname{ > my_hostname: { > authorized_keys { "testuser_at_machine1": > username=> [ "testuser01","testuser02" ] } > } > } > > > When i run puppet on the machine "my_hostname", puppet should installs > the authorized_key "testuser_at_machine1" at user "testuser01" and > "testuser02", but only the first user (testuser01) becomes the key. > > Can anyone help me, where is my mistake? > > Greetz > Timuser just doesnt take an array. One authorized key resource describes exactly one key in one authorized_key file. -Stefan
Fuuu, responding to Puppet list on my phone is off limits from now on... On Aug 19, 2011 9:43 AM, "Stefan Schulte" <stefan.schulte@taunusstein.net> wrote:> On Fri, Aug 19, 2011 at 01:22:46AM -0700, Tim Schmeling wrote: >> Hi, >> >> i have written a class called ssh to manage authorized_keys. >> >> First i define my authorized_keys in this array: >> $authorized_key = { >> tim_at_caesium => ".............",} >> >> Then i have a define: >> define authorized_keys($ensure="present", $username) { >> ssh_authorized_key { $name: >> ensure => $ensure, >> type => "ssh-rsa", >> key => $authorized_key[$name], >> user => $username, >> } >> } >> >> And last but not least this case syntax to include my authorized_keys: >> case $hostname{ >> my_hostname: { >> authorized_keys { "testuser_at_machine1": >> username=> [ "testuser01","testuser02" ] } >> } >> } >> >> >> When i run puppet on the machine "my_hostname", puppet should installs >> the authorized_key "testuser_at_machine1" at user "testuser01" and >> "testuser02", but only the first user (testuser01) becomes the key. >> >> Can anyone help me, where is my mistake? >> >> Greetz >> Tim > > user just doesnt take an array. One authorized key resource describes > exactly one key in one authorized_key file. > > -Stefan-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi, so i can´t use one public authorized_key in two different users, right? Is there any other option? Greetz Tim On 19 Aug., 18:45, Stefan Schulte <stefan.schu...@taunusstein.net> wrote:> On Fri, Aug 19, 2011 at 01:22:46AM -0700, Tim Schmeling wrote: > > Hi, > > > i have written a class called ssh to manage authorized_keys. > > > First i define my authorized_keys in this array: > > $authorized_key = { > > tim_at_caesium => ".............",} > > > Then i have a define: > > define authorized_keys($ensure="present", $username) { > > ssh_authorized_key { $name: > > ensure => $ensure, > > type => "ssh-rsa", > > key => $authorized_key[$name], > > user => $username, > > } > > } > > > And last but not least this case syntax to include my authorized_keys: > > case $hostname{ > > my_hostname: { > > authorized_keys { "testuser_at_machine1": > > username=> [ "testuser01","testuser02" ] } > > } > > } > > > When i run puppet on the machine "my_hostname", puppet should installs > > the authorized_key "testuser_at_machine1" at user "testuser01" and > > "testuser02", but only the first user (testuser01) becomes the key. > > > Can anyone help me, where is my mistake? > > > Greetz > > Tim > > user just doesnt take an array. One authorized key resource describes > exactly one key in one authorized_key file. > > -Stefan > > application_pgp-signature_part > < 1 KBAnzeigenHerunterladen-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.