diff --git a/lib/ansible/modules/packaging/language/maven_artifact.py b/lib/ansible/modules/packaging/language/maven_artifact.py index 1d8d6f8c07..8782f7d710 100644 --- a/lib/ansible/modules/packaging/language/maven_artifact.py +++ b/lib/ansible/modules/packaging/language/maven_artifact.py @@ -434,6 +434,14 @@ class MavenDownloader: return "Cannot retrieve a valid md5 from %s: %s" % (remote_url, to_native(e)) if(not remote_md5): return "Cannot find md5 from " + remote_url + try: + # Check if remote md5 only contains md5 or md5 + filename + _remote_md5 = remote_md5.split(None)[0] + remote_md5 = _remote_md5 + # remote_md5 is empty so we continue and keep original md5 string + # This should not happen since we check for remote_md5 before + except IndexError as e: + pass if local_md5 == remote_md5: return None else: