|
|
@ -26,6 +26,8 @@ import os
|
|
|
|
import hashlib
|
|
|
|
import hashlib
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import posixpath
|
|
|
|
import posixpath
|
|
|
|
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
|
|
|
|
from ansible.module_utils.urls import *
|
|
|
|
|
|
|
|
|
|
|
|
DOCUMENTATION = '''
|
|
|
|
DOCUMENTATION = '''
|
|
|
|
---
|
|
|
|
---
|
|
|
@ -330,7 +332,7 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
artifact = Artifact(group_id, artifact_id, version, classifier, extension)
|
|
|
|
artifact = Artifact(group_id, artifact_id, version, classifier, extension)
|
|
|
|
except ValueError, e:
|
|
|
|
except ValueError as e:
|
|
|
|
module.fail_json(msg=e.args[0])
|
|
|
|
module.fail_json(msg=e.args[0])
|
|
|
|
|
|
|
|
|
|
|
|
prev_state = "absent"
|
|
|
|
prev_state = "absent"
|
|
|
@ -351,12 +353,10 @@ def main():
|
|
|
|
module.exit_json(state=state, dest=dest, group_id=group_id, artifact_id=artifact_id, version=version, classifier=classifier, extension=extension, repository_url=repository_url, changed=True)
|
|
|
|
module.exit_json(state=state, dest=dest, group_id=group_id, artifact_id=artifact_id, version=version, classifier=classifier, extension=extension, repository_url=repository_url, changed=True)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
module.fail_json(msg="Unable to download the artifact")
|
|
|
|
module.fail_json(msg="Unable to download the artifact")
|
|
|
|
except ValueError, e:
|
|
|
|
except ValueError as e:
|
|
|
|
module.fail_json(msg=e.args[0])
|
|
|
|
module.fail_json(msg=e.args[0])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# import module snippets
|
|
|
|
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
|
|
|
|
from ansible.module_utils.urls import *
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|