Merge pull request #13883 from shaba/devel

Add support ssh configs from /etc/openssh.
pull/14381/head
Brian Coca 9 years ago
commit 46ce9a0016

@ -536,6 +536,8 @@ class Facts(object):
keydir = '/etc/ssh'
else:
keydir = '/etc'
if self.facts['distribution'] == 'Altlinux':
keydir = '/etc/openssh'
else:
keydir = '/etc/ssh'

@ -119,6 +119,7 @@ def not_in_host_file(self, host):
host_file_list.append(user_host_file)
host_file_list.append("/etc/ssh/ssh_known_hosts")
host_file_list.append("/etc/ssh/ssh_known_hosts2")
host_file_list.append("/etc/openssh/ssh_known_hosts")
hfiles_not_found = 0
for hf in host_file_list:

@ -151,9 +151,11 @@ class Connection(ConnectionBase):
self.keyfile = os.path.expanduser("~/.ssh/known_hosts")
if C.HOST_KEY_CHECKING:
for ssh_known_hosts in ("/etc/ssh/ssh_known_hosts", "/etc/openssh/ssh_known_hosts"):
try:
#TODO: check if we need to look at several possible locations, possible for loop
ssh.load_system_host_keys("/etc/ssh/ssh_known_hosts")
ssh.load_system_host_keys(ssh_known_hosts)
break
except IOError:
pass # file was not found, but not required to function
ssh.load_system_host_keys()

Loading…
Cancel
Save