|
|
@ -22,9 +22,7 @@ description:
|
|
|
|
author: "Nick Harring (@NickatEpic)"
|
|
|
|
author: "Nick Harring (@NickatEpic)"
|
|
|
|
version_added: 2.0
|
|
|
|
version_added: 2.0
|
|
|
|
requirements:
|
|
|
|
requirements:
|
|
|
|
- urllib3
|
|
|
|
- requests (either >= 2.0.0 for Python 3, or >= 1.0.0 for Python 2)
|
|
|
|
- requests
|
|
|
|
|
|
|
|
- time
|
|
|
|
|
|
|
|
notes:
|
|
|
|
notes:
|
|
|
|
- Check mode isn’t supported.
|
|
|
|
- Check mode isn’t supported.
|
|
|
|
options:
|
|
|
|
options:
|
|
|
@ -143,7 +141,11 @@ import json
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
import traceback
|
|
|
|
import traceback
|
|
|
|
|
|
|
|
|
|
|
|
import requests
|
|
|
|
try:
|
|
|
|
|
|
|
|
import requests
|
|
|
|
|
|
|
|
HAS_REQUESTS = True
|
|
|
|
|
|
|
|
except ImportError:
|
|
|
|
|
|
|
|
HAS_REQUESTS = False
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
|
|
from ansible.module_utils._text import to_native
|
|
|
|
from ansible.module_utils._text import to_native
|
|
|
@ -201,6 +203,9 @@ def main():
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not HAS_REQUESTS:
|
|
|
|
|
|
|
|
module.fail_json(msg='requests is required for this module')
|
|
|
|
|
|
|
|
|
|
|
|
annotation = create_annotation(module)
|
|
|
|
annotation = create_annotation(module)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
resp = post_annotation(annotation, module.params['api_key'])
|
|
|
|
resp = post_annotation(annotation, module.params['api_key'])
|
|
|
|