mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
When not finding a host in ~/.ssh/known_hosts, the return value is 0 if the host just is not found. We then never check the system host file in /etc. This fixes the code to check /etc on any failure, not just a bad return code.
This commit is contained in:
parent
24f11168d9
commit
953dc6b345
1 changed files with 1 additions and 2 deletions
|
@ -40,8 +40,7 @@ def check_hostkey(module, fqdn):
|
|||
this_cmd = keygen_cmd + " -H -F " + fqdn
|
||||
rc, out, err = module.run_command(this_cmd)
|
||||
|
||||
if rc == 0:
|
||||
if out != "":
|
||||
if rc == 0 and out != "":
|
||||
result = True
|
||||
else:
|
||||
# Check the main system location
|
||||
|
|
Loading…
Reference in a new issue