Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
FACT 3.6.9, FACT 3.10.0
-
None
-
None
-
Night's Watch
-
2
-
NW - 2020-03-04
-
Needs Assessment
-
35920
-
1
-
Bug Fix
-
correctly displays ssh host key fact in the case the host key file does no contain a comment
-
Needs Assessment
Description
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.