mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07: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
|
this_cmd = keygen_cmd + " -H -F " + fqdn
|
||||||
rc, out, err = module.run_command(this_cmd)
|
rc, out, err = module.run_command(this_cmd)
|
||||||
|
|
||||||
if rc == 0:
|
if rc == 0 and out != "":
|
||||||
if out != "":
|
|
||||||
result = True
|
result = True
|
||||||
else:
|
else:
|
||||||
# Check the main system location
|
# Check the main system location
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue