Hi all,
I use the below playbook to add known hosts:
Hi all,
I use the below playbook to add known hosts:
The format of the key has to be in the form that it appears in a known_hosts file. So ssh to the target system, verify and accept the key, then take the line added to your local known_hosts file and add that.
Hi,
The known_hosts module expects a complete “known_hosts - line” as key value. The public key from /etc/ssh lists no hostname. So in your example the correct behaviour can be achieved by preceding the hostname:
Example:
…
key=“sun1-db-1 {{ lookup(‘file’, ‘/tmp/keys/10.223.0.51/etc/ssh/ssh_host_rsa_key.pub’) }}”
…
Cheers
Ulli