Am 31.12.2015 um 23:46 schrieb Dr. Natas:

> I been trying to figure how to manage public ssh keys with the
> following code. For some reason I'm unable to add public ssh-keys to
> known_hosts.

You don't add public keys to known_hosts. Host keys are added there (the
keys of hosts the user logs in from).

> When I run this code from a node it doesn't trow any errors and runs
> without a problem but I think I'm missing something here that I don't see.

I don't see anything in this class that would change known_hosts.
ssh_authorized_keys manages a user's authorized_keys file only, that is:
Public keys which are allowed to log in _as that user_.

However, you might want to try this one to manage the _systems_ global
known_hosts file (see here
<https://docs.puppetlabs.com/references/latest/type.html#sshkey>):

# Collect SSH keys from all Unix hosts and store them in ssh_known_hosts
# so that all managed hosts will automatically know each other.

class sshkeys {
  # Declare the exported resource
  @@sshkey { $::fqdn:
    type => rsa,
    key  => $sshrsakey
  }

  # Collect all keys:
  Sshkey <<| |>>
}

HTH...

    Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 1596666 (Ansage) 1149
*Email*: [email protected] <mailto:[email protected]>
*Skype*: dirk.heinrichs.recommind
www.recommind.com <http://www.recommind.com>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/568A175B.6030306%40recommind.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to