If the SSH host public key file does not contain a comment, the public key will contain a trailing newline. For example:
$ echo 'ssh-rsa public-key' >/etc/ssh/ssh_host_rsa_key.pub |
$ facter ssh |
{ |
rsa => { |
key => "public-key |
" |
} |
} |
{{}} If the key contains a comment, we do not get the trailing newline:
$ echo 'ssh-rsa public-key comment' >/etc/ssh/ssh_host_rsa_key.pub $ facter ssh {{{}} rsa => { key => "public-key" {{ }}} } The trailing newline causes issues when using the resulting fact directly in a sshkey resource, where the trailing newline makes Puppet think the resource is changed on every run. |