diff options
Diffstat (limited to 'lib/ansible/modules/network/f5/bigip_profile_http2.py')
-rw-r--r-- | lib/ansible/modules/network/f5/bigip_profile_http2.py | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/ansible/modules/network/f5/bigip_profile_http2.py b/lib/ansible/modules/network/f5/bigip_profile_http2.py index 9b2067a039..32c1566f85 100644 --- a/lib/ansible/modules/network/f5/bigip_profile_http2.py +++ b/lib/ansible/modules/network/f5/bigip_profile_http2.py @@ -23,16 +23,19 @@ options: name: description: - Specifies the name of the profile. + type: str required: True parent: description: - Specifies the profile from which this profile inherits settings. - When creating a new profile, if this parameter is not specified, the default is the system-supplied C(http2) profile. + type: str default: /Common/http2 description: description: - Description of the profile. + type: str streams: description: - Specifies the number of outstanding concurrent requests that are allowed on a single HTTP/2 connection. @@ -54,6 +57,7 @@ options: description: - Specifies the name of the HTTP header controlled by C(insert_header) parameter. - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile. + type: str enforce_tls_requirements: description: - Specifies whether the system requires TLS for communications between specified senders and recipients. @@ -64,10 +68,10 @@ options: - Specifies what will cause an incoming connection to be handled as a HTTP/2 connection. - The C(alpn) and C(always) are mutually exclusive. - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile. + type: list choices: - alpn - always - type: list frame_size: description: - Specifies the size of data frames, in bytes, that HTTP/2 sends to the client. @@ -95,15 +99,17 @@ options: partition: description: - Device partition to manage resources on. + type: str default: Common state: description: - When C(present), ensures that the profile exists. - When C(absent), ensures the profile is removed. - default: present + type: str choices: - present - absent + default: present extends_documentation_fragment: f5 author: - Wojciech Wypior (@wojtek0806) @@ -184,26 +190,20 @@ try: from library.module_utils.network.f5.bigip import F5RestClient from library.module_utils.network.f5.common import F5ModuleError from library.module_utils.network.f5.common import AnsibleF5Parameters - from library.module_utils.network.f5.common import cleanup_tokens from library.module_utils.network.f5.common import fq_name from library.module_utils.network.f5.common import transform_name from library.module_utils.network.f5.common import flatten_boolean from library.module_utils.network.f5.common import is_empty_list from library.module_utils.network.f5.common import f5_argument_spec - from library.module_utils.network.f5.common import exit_json - from library.module_utils.network.f5.common import fail_json except ImportError: from ansible.module_utils.network.f5.bigip import F5RestClient from ansible.module_utils.network.f5.common import F5ModuleError from ansible.module_utils.network.f5.common import AnsibleF5Parameters - from ansible.module_utils.network.f5.common import cleanup_tokens from ansible.module_utils.network.f5.common import fq_name from ansible.module_utils.network.f5.common import transform_name from ansible.module_utils.network.f5.common import flatten_boolean from ansible.module_utils.network.f5.common import is_empty_list from ansible.module_utils.network.f5.common import f5_argument_spec - from ansible.module_utils.network.f5.common import exit_json - from ansible.module_utils.network.f5.common import fail_json class Parameters(AnsibleF5Parameters): @@ -440,7 +440,7 @@ class Difference(object): class ModuleManager(object): def __init__(self, *args, **kwargs): self.module = kwargs.get('module', None) - self.client = kwargs.get('client', None) + self.client = F5RestClient(**self.module.params) self.want = ModuleParameters(params=self.module.params) self.have = ApiParameters() self.changes = UsableChanges() @@ -667,16 +667,12 @@ def main(): supports_check_mode=spec.supports_check_mode, ) - client = F5RestClient(**module.params) - try: - mm = ModuleManager(module=module, client=client) + mm = ModuleManager(module=module) results = mm.exec_module() - cleanup_tokens(client) - exit_json(module, results, client) + module.exit_json(**results) except F5ModuleError as ex: - cleanup_tokens(client) - fail_json(module, ex, client) + module.fail_json(msg=str(ex)) if __name__ == '__main__': |