Improved the documentation of known_hosts

The documentation for the key parameter was lacking in specificity and
also lacking in testing. These parts are both remedied herein.

Fixes #43157
This commit is contained in:
Gregory Hellings 2018-07-23 22:45:48 -05:00 committed by Brian Coca
commit 6f007c35c1
2 changed files with 17 additions and 2 deletions

View file

@ -31,7 +31,11 @@ options:
key:
description:
- The SSH public host key, as a string (required if state=present, optional when state=absent, in which case all keys for the host are removed).
The key must be in the right format for ssh (see sshd(8), section "SSH_KNOWN_HOSTS FILE FORMAT")
The key must be in the right format for ssh (see sshd(8), section "SSH_KNOWN_HOSTS FILE FORMAT").
Specifically, the key should not match the format that is found in an SSH pubkey file, but should rather have the hostname prepended to a
line that includes the pubkey, the same way that it would appear in the known_hosts file. The value prepended to the line must also match
the value of the name parameter.
path:
description:
- The known_hosts file to edit