2020-05-15 20:07:40 +03:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
2024-11-29 13:48:11 +03:00
|
|
|
DOCUMENTATION = r'''
|
2020-05-15 20:07:40 +03:00
|
|
|
---
|
|
|
|
|
module: decort_jwt
|
|
|
|
|
|
2025-07-21 13:31:14 +03:00
|
|
|
description: See L(Module Documentation,https://repository.basistech.ru/BASIS/decort-ansible/wiki/Home). # noqa: E501
|
2020-05-15 20:07:40 +03:00
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
2024-12-26 12:37:38 +03:00
|
|
|
from ansible.module_utils.decort_utils import DecortController
|
2024-11-29 13:48:11 +03:00
|
|
|
|
2020-05-15 20:07:40 +03:00
|
|
|
|
2024-12-26 12:37:38 +03:00
|
|
|
class DecortJWT(DecortController):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
super().__init__(AnsibleModule(**self.amodule_init_args))
|
2020-05-15 20:07:40 +03:00
|
|
|
|
2024-12-26 12:37:38 +03:00
|
|
|
@property
|
|
|
|
|
def amodule_init_args(self) -> dict:
|
|
|
|
|
amodule_init_args = self.common_amodule_init_args
|
|
|
|
|
amodule_argument_spec = amodule_init_args['argument_spec']
|
|
|
|
|
del amodule_argument_spec['controller_url']
|
|
|
|
|
del amodule_argument_spec['jwt']
|
|
|
|
|
amodule_argument_spec['authenticator']['choices'].remove('jwt')
|
2020-05-15 20:07:40 +03:00
|
|
|
|
2024-12-26 12:37:38 +03:00
|
|
|
return amodule_init_args
|
2020-05-15 20:07:40 +03:00
|
|
|
|
2026-02-11 13:50:28 +03:00
|
|
|
@DecortController.handle_sdk_exceptions
|
2024-12-26 12:37:38 +03:00
|
|
|
def run(self):
|
|
|
|
|
self.result['jwt'] = self.jwt
|
|
|
|
|
self.amodule.exit_json(**self.result)
|
2020-05-15 20:07:40 +03:00
|
|
|
|
|
|
|
|
|
2024-12-26 12:37:38 +03:00
|
|
|
def main():
|
|
|
|
|
DecortJWT().run()
|
2020-05-15 20:07:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
main()
|