|
|
|
|
@ -30,6 +30,7 @@ options:
|
|
|
|
|
name:
|
|
|
|
|
description:
|
|
|
|
|
- The ASM policy to manage or create.
|
|
|
|
|
type: str
|
|
|
|
|
required: True
|
|
|
|
|
state:
|
|
|
|
|
description:
|
|
|
|
|
@ -39,6 +40,7 @@ options:
|
|
|
|
|
new blank ASM policy is created with the given policy C(name).
|
|
|
|
|
- When C(state) is C(absent), ensures that the policy is removed, even if it is
|
|
|
|
|
currently active.
|
|
|
|
|
type: str
|
|
|
|
|
choices:
|
|
|
|
|
- present
|
|
|
|
|
- absent
|
|
|
|
|
@ -50,6 +52,7 @@ options:
|
|
|
|
|
- The C(Comprehensive), C(Drupal), C(Fundamental), C(Joomla),
|
|
|
|
|
C(Vulnerability Assessment Baseline), and C(Wordpress) templates are only available
|
|
|
|
|
on BIG-IP versions >= 13.
|
|
|
|
|
type: str
|
|
|
|
|
choices:
|
|
|
|
|
- ActiveSync v1.0 v2.0 (http)
|
|
|
|
|
- ActiveSync v1.0 v2.0 (https)
|
|
|
|
|
@ -89,6 +92,7 @@ options:
|
|
|
|
|
partition:
|
|
|
|
|
description:
|
|
|
|
|
- Device partition to manage resources on.
|
|
|
|
|
type: str
|
|
|
|
|
default: Common
|
|
|
|
|
extends_documentation_fragment: f5
|
|
|
|
|
author:
|
|
|
|
|
@ -182,24 +186,18 @@ 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 f5_argument_spec
|
|
|
|
|
from library.module_utils.network.f5.common import exit_json
|
|
|
|
|
from library.module_utils.network.f5.common import fail_json
|
|
|
|
|
from library.module_utils.network.f5.icontrol import tmos_version
|
|
|
|
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
|
|
|
|
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 f5_argument_spec
|
|
|
|
|
from ansible.module_utils.network.f5.common import exit_json
|
|
|
|
|
from ansible.module_utils.network.f5.common import fail_json
|
|
|
|
|
from ansible.module_utils.network.f5.icontrol import tmos_version
|
|
|
|
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
|
|
|
|
|
|
|
|
|
@ -755,7 +753,8 @@ class BaseManager(object):
|
|
|
|
|
|
|
|
|
|
class ModuleManager(object):
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
|
self.client = kwargs.get('client', None)
|
|
|
|
|
self.module = kwargs.get('module', None)
|
|
|
|
|
self.client = F5RestClient(**self.module.params)
|
|
|
|
|
self.kwargs = kwargs
|
|
|
|
|
|
|
|
|
|
def exec_module(self):
|
|
|
|
|
@ -785,8 +784,8 @@ class ModuleManager(object):
|
|
|
|
|
|
|
|
|
|
class V1Manager(BaseManager):
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
|
client = kwargs.get('client', None)
|
|
|
|
|
module = kwargs.get('module', None)
|
|
|
|
|
client = F5RestClient(**module.params)
|
|
|
|
|
super(V1Manager, self).__init__(client=client, module=module)
|
|
|
|
|
self.want = V1Parameters(params=module.params, client=client)
|
|
|
|
|
|
|
|
|
|
@ -796,8 +795,8 @@ class V1Manager(BaseManager):
|
|
|
|
|
|
|
|
|
|
class V2Manager(BaseManager):
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
|
client = kwargs.get('client', None)
|
|
|
|
|
module = kwargs.get('module', None)
|
|
|
|
|
client = F5RestClient(**module.params)
|
|
|
|
|
super(V2Manager, self).__init__(client=client, module=module)
|
|
|
|
|
self.want = V2Parameters(params=module.params, client=client)
|
|
|
|
|
|
|
|
|
|
@ -881,16 +880,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__':
|
|
|
|
|
|