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
2f5fe5f7
Commit
2f5fe5f7
authored
Jan 12, 2014
by
jctanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5587 from kormoc/fix_git_check_hostkey_etc
Fixes for git module
parents
3719f3f4
c15cffab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
lib/ansible/module_utils/known_hosts.py
+10
-1
No files found.
lib/ansible/module_utils/known_hosts.py
View file @
2f5fe5f7
...
...
@@ -6,7 +6,8 @@ def add_git_host_key(module, url, accept_hostkey=True):
if
fqdn
:
known_host
=
check_hostkey
(
module
,
fqdn
)
if
not
known_host
and
accept_hostkey
:
if
not
known_host
:
if
accept_hostkey
:
rc
,
out
,
err
=
add_host_key
(
module
,
fqdn
)
if
rc
!=
0
:
module
.
fail_json
(
msg
=
"failed to add
%
s hostkey:
%
s"
%
(
fqdn
,
out
+
err
))
...
...
@@ -42,6 +43,14 @@ def check_hostkey(module, fqdn):
if
rc
==
0
:
if
out
!=
""
:
result
=
True
else
:
# Check the main system location
this_cmd
=
keygen_cmd
+
" -H -f /etc/ssh/ssh_known_hosts -F "
+
fqdn
rc
,
out
,
err
=
module
.
run_command
(
this_cmd
)
if
rc
==
0
:
if
out
!=
""
:
result
=
True
return
result
...
...
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