Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
16df2726
Commit
16df2726
authored
May 18, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11018 from tyll/ed25519
facts: Add ed25519 ssh pubkey
parents
8f71e47a
02d78459
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
20 deletions
+10
-20
lib/ansible/module_utils/facts.py
+10
-20
No files found.
lib/ansible/module_utils/facts.py
View file @
16df2726
...
@@ -471,29 +471,19 @@ class Facts(object):
...
@@ -471,29 +471,19 @@ class Facts(object):
pass
pass
def
get_public_ssh_host_keys
(
self
):
def
get_public_ssh_host_keys
(
self
):
dsa_filename
=
'/etc/ssh/ssh_host_dsa_key.pub'
keytypes
=
(
'dsa'
,
'rsa'
,
'ecdsa'
,
'ed25519'
)
rsa_filename
=
'/etc/ssh/ssh_host_rsa_key.pub'
ecdsa_filename
=
'/etc/ssh/ssh_host_ecdsa_key.pub'
if
self
.
facts
[
'system'
]
==
'Darwin'
:
if
self
.
facts
[
'system'
]
==
'Darwin'
:
dsa_filename
=
'/etc/ssh_host_dsa_key.pub'
keydir
=
'/etc'
rsa_filename
=
'/etc/ssh_host_rsa_key.pub'
ecdsa_filename
=
'/etc/ssh_host_ecdsa_key.pub'
dsa
=
get_file_content
(
dsa_filename
)
rsa
=
get_file_content
(
rsa_filename
)
ecdsa
=
get_file_content
(
ecdsa_filename
)
if
dsa
is
None
:
dsa
=
'NA'
else
:
else
:
self
.
facts
[
'ssh_host_key_dsa_public'
]
=
dsa
.
split
()[
1
]
keydir
=
'/etc/ssh'
if
rsa
is
None
:
rsa
=
'NA'
for
type_
in
keytypes
:
else
:
key_filename
=
'
%
s/ssh_host_
%
s_key.pub'
%
(
keydir
,
type_
)
self
.
facts
[
'ssh_host_key_rsa_public'
]
=
rsa
.
split
()[
1
]
keydata
=
get_file_content
(
key_filename
)
if
ecdsa
is
None
:
if
keydata
is
not
None
:
ecdsa
=
'NA'
factname
=
'ssh_host_key_
%
s_public'
%
type_
else
:
self
.
facts
[
factname
]
=
keydata
.
split
()[
1
]
self
.
facts
[
'ssh_host_key_ecdsa_public'
]
=
ecdsa
.
split
()[
1
]
def
get_pkg_mgr_facts
(
self
):
def
get_pkg_mgr_facts
(
self
):
self
.
facts
[
'pkg_mgr'
]
=
'unknown'
self
.
facts
[
'pkg_mgr'
]
=
'unknown'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment