mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 06:56:00 -03:30
AC-932 Support accept_hostkey option to git module when using ansible >= 1.5.
This commit is contained in:
@@ -629,6 +629,17 @@ class RunProjectUpdate(BaseTask):
|
||||
scm_password = False
|
||||
scm_url = update_scm_url(scm_type, scm_url, scm_username,
|
||||
scm_password)
|
||||
|
||||
# When using Ansible >= 1.5, pass the extra accept_hostkey parameter to
|
||||
# the git module.
|
||||
if scm_type == 'git' and scm_url_parts.scheme == 'ssh':
|
||||
try:
|
||||
Version = distutils.version.StrictVersion
|
||||
if Version(get_ansible_version()) >= Version('1.5'):
|
||||
extra_vars['scm_accept_hostkey'] = 'true'
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
return scm_url, extra_vars
|
||||
|
||||
def build_args(self, project_update, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user