AC-932 Support accept_hostkey option to git module when using ansible >= 1.5.

This commit is contained in:
Chris Church
2014-01-23 04:28:11 -05:00
parent dbd0f46435
commit 8aa9fe9d7e
2 changed files with 17 additions and 1 deletions

View File

@@ -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):