Sorry, Sandra, I started to add a comment at the bottom with usage,
but apparently I never saved it. Although the script can do user keys
as well, this just addresses host keys. I have a cron script that
generates the known hosts file as well:
0,10,20,30,40,50 * * * * /tr01/scripts/
sshkeys.pl --genknownhosts
The script will either retrieve the key if it already exists, or
generate a new one if it doesn't. $ccbp_realname is just the fqdn.
class ssh::server::rh {
$rsahostkey = generate("$pm_scripts/
sshkeys.pl", "--private",
"--rsa", "--host", "$ccbp_realname")
$rsahostkeypub = generate("$pm_scripts/
sshkeys.pl", "--rsa",
"--host", "$ccbp_realname")
$dsahostkey = generate("$pm_scripts/
sshkeys.pl", "--private",
"--dsa", "--host", "$ccbp_realname")
$dsahostkeypub = generate("$pm_scripts/
sshkeys.pl", "--dsa",
"--host", "$ccbp_realname")
file { "/etc/ssh/ssh_host_rsa_key":
content => $rsahostkey,
mode => 0400, owner => root, group => root,
}
file { "/etc/ssh/ssh_host_rsa_key.pub":
content => $rsahostkeypub,
mode => 0444, owner => root, group => root,
}
file { "/etc/ssh/ssh_host_dsa_key":
content => $dsahostkey,
mode => 0400, owner => root, group => root,
}
file { "/etc/ssh/ssh_host_dsa_key.pub":
content => $dsahostkeypub,
mode => 0444, owner => root, group => root,
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/puppet-users/-/vR7zhEKP9FoJ.
--
Chad M. Huneycutt