Mark Ruys
2013-Aug-03 14:12 UTC
[Puppet Users] Add a public ssh key form node A to authorized keys on node B
With the risc I ask a queston answered a hunderd times before (which I couldn''t find)... On node A I want to create a ssh key. For this I exec a ssh-keygen. Now I want the generated public key added to the authorized key file of node B. Probably I need the ssh_authorized_key resource for this. But then I need the public key of node A as a string in node B. I can''t see how to achieve this with exported resources. So my guess is that I need to write a custom fact to read ~/.ssh/id_rsa.pub on node A in order to collect it on node B. Is this the way I should go? Or is there a better approach? Thanks, Mark -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Virender Khatri
2013-Aug-06 05:01 UTC
Re: [Puppet Users] Add a public ssh key form node A to authorized keys on node B
Well, actually it is straight forward. Just create a ssh_authorized_keys resource for an user for both nodes and store the private key in .ssh/id_rsa or define Identity key file in .ssh/config. On Sat, Aug 3, 2013 at 7:12 AM, Mark Ruys <mark.ruys@gmail.com> wrote:> With the risc I ask a queston answered a hunderd times before (which I > couldn''t find)... > > On node A I want to create a ssh key. For this I exec a ssh-keygen. Now I > want the generated public key added to the authorized key file of node B. > Probably I need the ssh_authorized_key resource for this. But then I need > the public key of node A as a string in node B. I can''t see how to achieve > this with exported resources. So my guess is that I need to write a custom > fact to read ~/.ssh/id_rsa.pub on node A in order to collect it on node B. > > Is this the way I should go? Or is there a better approach? > > Thanks, Mark > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Klavs Klavsen
2013-Aug-06 14:37 UTC
[Puppet Users] Re: Add a public ssh key form node A to authorized keys on node B
What I did, was to simply write my own fact, that reads the "id_rsa.pub" file - and then in the manifest, I simply check if that fact is != "" - and if so - do @@ssh_authorized_key.. with the public key - and collect that where I want it. I have several webservers - which all need to have a key (I simply do an exec, with creates defined - so it''s only run if it''s not already been done) and then have the public part on one central server. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.