1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #1012 from jpmens/sshhostkeysosx

Add support for RSA/DSA SSH host key detection in setup module for OS/X
This commit is contained in:
Michael DeHaan 2012-09-06 17:50:32 -07:00
commit fa71237f8a

View file

@ -104,8 +104,14 @@ class Facts(object):
self.facts['distribution'] = name self.facts['distribution'] = name
def get_public_ssh_host_keys(self): def get_public_ssh_host_keys(self):
dsa = get_file_content('/etc/ssh/ssh_host_dsa_key.pub') dsa_filename = '/etc/ssh/ssh_host_dsa_key.pub'
rsa = get_file_content('/etc/ssh/ssh_host_rsa_key.pub') rsa_filename = '/etc/ssh/ssh_host_rsa_key.pub'
if self.facts['system'] == 'Darwin':
dsa_filename = '/etc/ssh_host_dsa_key.pub'
rsa_filename = '/etc/ssh_host_rsa_key.pub'
dsa = get_file_content(dsa_filename)
rsa = get_file_content(rsa_filename)
if dsa is None: if dsa is None:
dsa = 'NA' dsa = 'NA'
else: else: