mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
Refactors main() function and module manager in multiple modules in line with recent changes (#53979)
Adds variable types to docs Refactors unit tests to remove deprecated parameters
This commit is contained in:
parent
4ed3735cda
commit
739df1c348
27 changed files with 447 additions and 326 deletions
|
@ -26,15 +26,19 @@ options:
|
||||||
contact:
|
contact:
|
||||||
description:
|
description:
|
||||||
- The name of the contact for the data center.
|
- The name of the contact for the data center.
|
||||||
|
type: str
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- The description of the data center.
|
- The description of the data center.
|
||||||
|
type: str
|
||||||
location:
|
location:
|
||||||
description:
|
description:
|
||||||
- The location of the data center.
|
- The location of the data center.
|
||||||
|
type: str
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The name of the data center.
|
- The name of the data center.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
|
@ -44,15 +48,17 @@ options:
|
||||||
the virtual address and enables it. If C(enabled), enable the virtual
|
the virtual address and enables it. If C(enabled), enable the virtual
|
||||||
address if it exists. If C(disabled), create the virtual address if
|
address if it exists. If C(disabled), create the virtual address if
|
||||||
needed, and set state to C(disabled).
|
needed, and set state to C(disabled).
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
- enabled
|
- enabled
|
||||||
- disabled
|
- disabled
|
||||||
|
default: present
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
|
@ -113,23 +119,17 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
|
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.pop('module', None)
|
self.module = kwargs.pop('module', None)
|
||||||
self.client = kwargs.pop('client', None)
|
self.client = F5RestClient(**self.module.params)
|
||||||
self.want = ModuleParameters(params=self.module.params)
|
self.want = ModuleParameters(params=self.module.params)
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -478,16 +478,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -33,6 +33,7 @@ options:
|
||||||
synchronization_group_name:
|
synchronization_group_name:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of the synchronization group to which the system belongs.
|
- Specifies the name of the synchronization group to which the system belongs.
|
||||||
|
type: str
|
||||||
synchronize_zone_files:
|
synchronize_zone_files:
|
||||||
description:
|
description:
|
||||||
- Specifies that the system synchronizes Domain Name System (DNS) zone files among the
|
- Specifies that the system synchronizes Domain Name System (DNS) zone files among the
|
||||||
|
@ -82,21 +83,15 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
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 module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
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 module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,7 +214,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
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.want = ModuleParameters(params=self.module.params)
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -342,16 +337,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -24,30 +24,35 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Monitor name.
|
- Monitor name.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
parent:
|
parent:
|
||||||
description:
|
description:
|
||||||
- The parent template of this monitor template. Once this value has
|
- The parent template of this monitor template. Once this value has
|
||||||
been set, it cannot be changed. By default, this value is the C(bigip)
|
been set, it cannot be changed. By default, this value is the C(bigip)
|
||||||
parent on the C(Common) partition.
|
parent on the C(Common) partition.
|
||||||
|
type: str
|
||||||
default: "/Common/bigip"
|
default: "/Common/bigip"
|
||||||
ip:
|
ip:
|
||||||
description:
|
description:
|
||||||
- IP address part of the IP/port definition. If this parameter is not
|
- IP address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'.
|
'*'.
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Port address part of the IP/port definition. If this parameter is not
|
- Port address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
||||||
must be specified
|
must be specified
|
||||||
|
type: str
|
||||||
interval:
|
interval:
|
||||||
description:
|
description:
|
||||||
- Specifies, in seconds, the frequency at which the system issues the monitor
|
- Specifies, in seconds, the frequency at which the system issues the monitor
|
||||||
check when either the resource is down or the status of the resource is unknown.
|
check when either the resource is down or the status of the resource is unknown.
|
||||||
- When creating a new monitor, if this parameter is not provided, then the
|
- When creating a new monitor, if this parameter is not provided, then the
|
||||||
default value will be C(30). This value B(must) be less than the C(timeout) value.
|
default value will be C(30). This value B(must) be less than the C(timeout) value.
|
||||||
|
type: int
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds the target has in which to respond to the
|
- Specifies the number of seconds the target has in which to respond to the
|
||||||
|
@ -57,6 +62,7 @@ options:
|
||||||
- When this value is set to 0 (zero), the system uses the interval from the parent monitor.
|
- When this value is set to 0 (zero), the system uses the interval from the parent monitor.
|
||||||
- When creating a new monitor, if this parameter is not provided, then
|
- When creating a new monitor, if this parameter is not provided, then
|
||||||
the default value will be C(90).
|
the default value will be C(90).
|
||||||
|
type: int
|
||||||
ignore_down_response:
|
ignore_down_response:
|
||||||
description:
|
description:
|
||||||
- Specifies that the monitor allows more than one probe attempt per interval.
|
- Specifies that the monitor allows more than one probe attempt per interval.
|
||||||
|
@ -91,6 +97,7 @@ options:
|
||||||
- When C(sum-members), specifies that the system adds together the scores of the
|
- When C(sum-members), specifies that the system adds together the scores of the
|
||||||
pool members associated with the monitor's target virtual servers and uses
|
pool members associated with the monitor's target virtual servers and uses
|
||||||
that value in the load balancing operation.
|
that value in the load balancing operation.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- none
|
- none
|
||||||
- average-nodes
|
- average-nodes
|
||||||
|
@ -100,15 +107,17 @@ options:
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the monitor exists.
|
- When C(present), ensures that the monitor exists.
|
||||||
- When C(absent), ensures the monitor is removed.
|
- When C(absent), ensures the monitor is removed.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
notes:
|
notes:
|
||||||
- Requires BIG-IP software version >= 12
|
- Requires BIG-IP software version >= 12
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
|
@ -192,24 +201,18 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
|
||||||
|
@ -413,7 +416,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
self.module = kwargs.get('module', None)
|
||||||
self.client = kwargs.get('client', None)
|
self.client = F5RestClient(**self.module.params)
|
||||||
self.have = None
|
self.have = None
|
||||||
self.want = ModuleParameters(params=self.module.params)
|
self.want = ModuleParameters(params=self.module.params)
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -648,16 +651,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -23,12 +23,14 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Monitor name.
|
- Monitor name.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
parent:
|
parent:
|
||||||
description:
|
description:
|
||||||
- The parent template of this monitor template. Once this value has
|
- The parent template of this monitor template. Once this value has
|
||||||
been set, it cannot be changed. By default, this value is the C(tcp)
|
been set, it cannot be changed. By default, this value is the C(tcp)
|
||||||
parent on the C(Common) partition.
|
parent on the C(Common) partition.
|
||||||
|
type: str
|
||||||
default: /Common/firepass_gtm
|
default: /Common/firepass_gtm
|
||||||
ip:
|
ip:
|
||||||
description:
|
description:
|
||||||
|
@ -36,12 +38,14 @@ options:
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'.
|
'*'.
|
||||||
- If this value is an IP address, then a C(port) number must be specified.
|
- If this value is an IP address, then a C(port) number must be specified.
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Port address part of the IP/port definition. If this parameter is not
|
- Port address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
||||||
must be specified.
|
must be specified.
|
||||||
|
type: str
|
||||||
interval:
|
interval:
|
||||||
description:
|
description:
|
||||||
- The interval specifying how frequently the monitor instance of this
|
- The interval specifying how frequently the monitor instance of this
|
||||||
|
@ -49,6 +53,7 @@ options:
|
||||||
- If this parameter is not provided when creating a new monitor, then
|
- If this parameter is not provided when creating a new monitor, then
|
||||||
the default value will be 30.
|
the default value will be 30.
|
||||||
- This value B(must) be less than the C(timeout) value.
|
- This value B(must) be less than the C(timeout) value.
|
||||||
|
type: int
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- The number of seconds in which the node or service must respond to
|
- The number of seconds in which the node or service must respond to
|
||||||
|
@ -59,24 +64,28 @@ options:
|
||||||
interval number of seconds plus 1 second.
|
interval number of seconds plus 1 second.
|
||||||
- If this parameter is not provided when creating a new monitor, then
|
- If this parameter is not provided when creating a new monitor, then
|
||||||
the default value will be 90.
|
the default value will be 90.
|
||||||
|
type: int
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the monitor exists.
|
- When C(present), ensures that the monitor exists.
|
||||||
- When C(absent), ensures the monitor is removed.
|
- When C(absent), ensures the monitor is removed.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
probe_timeout:
|
probe_timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds after which the system times out the probe request
|
- Specifies the number of seconds after which the system times out the probe request
|
||||||
to the system.
|
to the system.
|
||||||
- When creating a new monitor, if this parameter is not provided, then the default
|
- When creating a new monitor, if this parameter is not provided, then the default
|
||||||
value will be C(5).
|
value will be C(5).
|
||||||
|
type: int
|
||||||
ignore_down_response:
|
ignore_down_response:
|
||||||
description:
|
description:
|
||||||
- Specifies that the monitor allows more than one probe attempt per interval.
|
- Specifies that the monitor allows more than one probe attempt per interval.
|
||||||
|
@ -91,23 +100,27 @@ options:
|
||||||
target_username:
|
target_username:
|
||||||
description:
|
description:
|
||||||
- Specifies the user name, if the monitored target requires authentication.
|
- Specifies the user name, if the monitored target requires authentication.
|
||||||
|
type: str
|
||||||
target_password:
|
target_password:
|
||||||
description:
|
description:
|
||||||
- Specifies the password, if the monitored target requires authentication.
|
- Specifies the password, if the monitored target requires authentication.
|
||||||
|
type: str
|
||||||
update_password:
|
update_password:
|
||||||
description:
|
description:
|
||||||
- C(always) will update passwords if the C(target_password) is specified.
|
- C(always) will update passwords if the C(target_password) is specified.
|
||||||
- C(on_create) will only set the password for newly created monitors.
|
- C(on_create) will only set the password for newly created monitors.
|
||||||
default: always
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- always
|
- always
|
||||||
- on_create
|
- on_create
|
||||||
|
default: always
|
||||||
cipher_list:
|
cipher_list:
|
||||||
description:
|
description:
|
||||||
- Specifies the list of ciphers for this monitor.
|
- Specifies the list of ciphers for this monitor.
|
||||||
- The items in the cipher list are separated with the colon C(:) symbol.
|
- The items in the cipher list are separated with the colon C(:) symbol.
|
||||||
- When creating a new monitor, if this parameter is not specified, the default
|
- When creating a new monitor, if this parameter is not specified, the default
|
||||||
list is C(HIGH:!ADH).
|
list is C(HIGH:!ADH).
|
||||||
|
type: str
|
||||||
max_load_average:
|
max_load_average:
|
||||||
description:
|
description:
|
||||||
- Specifies the number that the monitor uses to mark the Secure Access Manager
|
- Specifies the number that the monitor uses to mark the Secure Access Manager
|
||||||
|
@ -119,6 +132,7 @@ options:
|
||||||
- When the average exceeds the setting, the monitor marks the system down.
|
- When the average exceeds the setting, the monitor marks the system down.
|
||||||
- When creating a new monitor, if this parameter is not specified, the default
|
- When creating a new monitor, if this parameter is not specified, the default
|
||||||
is C(12).
|
is C(12).
|
||||||
|
type: int
|
||||||
concurrency_limit:
|
concurrency_limit:
|
||||||
description:
|
description:
|
||||||
- Specifies the maximum percentage of licensed connections currently in use under
|
- Specifies the maximum percentage of licensed connections currently in use under
|
||||||
|
@ -128,6 +142,7 @@ options:
|
||||||
- When the number of in-use licensed connections exceeds 95 percent, the monitor
|
- When the number of in-use licensed connections exceeds 95 percent, the monitor
|
||||||
marks the Secure Access Manager system down.
|
marks the Secure Access Manager system down.
|
||||||
- When creating a new monitor, if this parameter is not specified, the default is C(95).
|
- When creating a new monitor, if this parameter is not specified, the default is C(95).
|
||||||
|
type: int
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -228,24 +243,18 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
|
||||||
|
@ -521,7 +530,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
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.want = ModuleParameters(params=self.module.params)
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -772,16 +781,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -23,33 +23,39 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Monitor name.
|
- Monitor name.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
parent:
|
parent:
|
||||||
description:
|
description:
|
||||||
- The parent template of this monitor template. Once this value has
|
- The parent template of this monitor template. Once this value has
|
||||||
been set, it cannot be changed. By default, this value is the C(tcp)
|
been set, it cannot be changed. By default, this value is the C(tcp)
|
||||||
parent on the C(Common) partition.
|
parent on the C(Common) partition.
|
||||||
|
type: str
|
||||||
default: /Common/http
|
default: /Common/http
|
||||||
send:
|
send:
|
||||||
description:
|
description:
|
||||||
- The send string for the monitor call.
|
- The send string for the monitor call.
|
||||||
- When creating a new monitor, if this parameter is not provided, the
|
- When creating a new monitor, if this parameter is not provided, the
|
||||||
default of C(GET /\r\n) will be used.
|
default of C(GET /\r\n) will be used.
|
||||||
|
type: str
|
||||||
receive:
|
receive:
|
||||||
description:
|
description:
|
||||||
- The receive string for the monitor call.
|
- The receive string for the monitor call.
|
||||||
|
type: str
|
||||||
ip:
|
ip:
|
||||||
description:
|
description:
|
||||||
- IP address part of the IP/port definition. If this parameter is not
|
- IP address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'.
|
'*'.
|
||||||
- If this value is an IP address, then a C(port) number must be specified.
|
- If this value is an IP address, then a C(port) number must be specified.
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Port address part of the IP/port definition. If this parameter is not
|
- Port address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
||||||
must be specified
|
must be specified
|
||||||
|
type: str
|
||||||
interval:
|
interval:
|
||||||
description:
|
description:
|
||||||
- The interval specifying how frequently the monitor instance of this
|
- The interval specifying how frequently the monitor instance of this
|
||||||
|
@ -57,6 +63,7 @@ options:
|
||||||
- If this parameter is not provided when creating a new monitor, then the
|
- If this parameter is not provided when creating a new monitor, then the
|
||||||
default value will be 30.
|
default value will be 30.
|
||||||
- This value B(must) be less than the C(timeout) value.
|
- This value B(must) be less than the C(timeout) value.
|
||||||
|
type: int
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- The number of seconds in which the node or service must respond to
|
- The number of seconds in which the node or service must respond to
|
||||||
|
@ -67,24 +74,28 @@ options:
|
||||||
interval number of seconds plus 1 second.
|
interval number of seconds plus 1 second.
|
||||||
- If this parameter is not provided when creating a new monitor, then the
|
- If this parameter is not provided when creating a new monitor, then the
|
||||||
default value will be 120.
|
default value will be 120.
|
||||||
|
type: int
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the monitor exists.
|
- When C(present), ensures that the monitor exists.
|
||||||
- When C(absent), ensures the monitor is removed.
|
- When C(absent), ensures the monitor is removed.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
probe_timeout:
|
probe_timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds after which the system times out the probe request
|
- Specifies the number of seconds after which the system times out the probe request
|
||||||
to the system.
|
to the system.
|
||||||
- When creating a new monitor, if this parameter is not provided, then the default
|
- When creating a new monitor, if this parameter is not provided, then the default
|
||||||
value will be C(5).
|
value will be C(5).
|
||||||
|
type: int
|
||||||
ignore_down_response:
|
ignore_down_response:
|
||||||
description:
|
description:
|
||||||
- Specifies that the monitor allows more than one probe attempt per interval.
|
- Specifies that the monitor allows more than one probe attempt per interval.
|
||||||
|
@ -119,17 +130,20 @@ options:
|
||||||
target_username:
|
target_username:
|
||||||
description:
|
description:
|
||||||
- Specifies the user name, if the monitored target requires authentication.
|
- Specifies the user name, if the monitored target requires authentication.
|
||||||
|
type: str
|
||||||
target_password:
|
target_password:
|
||||||
description:
|
description:
|
||||||
- Specifies the password, if the monitored target requires authentication.
|
- Specifies the password, if the monitored target requires authentication.
|
||||||
|
type: str
|
||||||
update_password:
|
update_password:
|
||||||
description:
|
description:
|
||||||
- C(always) will update passwords if the C(target_password) is specified.
|
- C(always) will update passwords if the C(target_password) is specified.
|
||||||
- C(on_create) will only set the password for newly created monitors.
|
- C(on_create) will only set the password for newly created monitors.
|
||||||
default: always
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- always
|
- always
|
||||||
- on_create
|
- on_create
|
||||||
|
default: always
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -237,24 +251,18 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
|
||||||
|
@ -567,7 +575,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
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.want = ModuleParameters(params=self.module.params)
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -817,16 +825,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -23,33 +23,39 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Monitor name.
|
- Monitor name.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
parent:
|
parent:
|
||||||
description:
|
description:
|
||||||
- The parent template of this monitor template. Once this value has
|
- The parent template of this monitor template. Once this value has
|
||||||
been set, it cannot be changed. By default, this value is the C(tcp)
|
been set, it cannot be changed. By default, this value is the C(tcp)
|
||||||
parent on the C(Common) partition.
|
parent on the C(Common) partition.
|
||||||
|
type: str
|
||||||
default: /Common/https
|
default: /Common/https
|
||||||
send:
|
send:
|
||||||
description:
|
description:
|
||||||
- The send string for the monitor call.
|
- The send string for the monitor call.
|
||||||
- When creating a new monitor, if this parameter is not provided, the
|
- When creating a new monitor, if this parameter is not provided, the
|
||||||
default of C(GET /\r\n) will be used.
|
default of C(GET /\r\n) will be used.
|
||||||
|
type: str
|
||||||
receive:
|
receive:
|
||||||
description:
|
description:
|
||||||
- The receive string for the monitor call.
|
- The receive string for the monitor call.
|
||||||
|
type: str
|
||||||
ip:
|
ip:
|
||||||
description:
|
description:
|
||||||
- IP address part of the IP/port definition. If this parameter is not
|
- IP address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'.
|
'*'.
|
||||||
- If this value is an IP address, then a C(port) number must be specified.
|
- If this value is an IP address, then a C(port) number must be specified.
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Port address part of the IP/port definition. If this parameter is not
|
- Port address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
||||||
must be specified.
|
must be specified.
|
||||||
|
type: str
|
||||||
interval:
|
interval:
|
||||||
description:
|
description:
|
||||||
- The interval specifying how frequently the monitor instance of this
|
- The interval specifying how frequently the monitor instance of this
|
||||||
|
@ -57,6 +63,7 @@ options:
|
||||||
- If this parameter is not provided when creating a new monitor, then
|
- If this parameter is not provided when creating a new monitor, then
|
||||||
the default value will be 30.
|
the default value will be 30.
|
||||||
- This value B(must) be less than the C(timeout) value.
|
- This value B(must) be less than the C(timeout) value.
|
||||||
|
type: int
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- The number of seconds in which the node or service must respond to
|
- The number of seconds in which the node or service must respond to
|
||||||
|
@ -67,24 +74,28 @@ options:
|
||||||
interval number of seconds plus 1 second.
|
interval number of seconds plus 1 second.
|
||||||
- If this parameter is not provided when creating a new monitor, then the
|
- If this parameter is not provided when creating a new monitor, then the
|
||||||
default value will be 120.
|
default value will be 120.
|
||||||
|
type: int
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the monitor exists.
|
- When C(present), ensures that the monitor exists.
|
||||||
- When C(absent), ensures the monitor is removed.
|
- When C(absent), ensures the monitor is removed.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
probe_timeout:
|
probe_timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds after which the system times out the probe request
|
- Specifies the number of seconds after which the system times out the probe request
|
||||||
to the system.
|
to the system.
|
||||||
- When creating a new monitor, if this parameter is not provided, then the default
|
- When creating a new monitor, if this parameter is not provided, then the default
|
||||||
value will be C(5).
|
value will be C(5).
|
||||||
|
type: int
|
||||||
ignore_down_response:
|
ignore_down_response:
|
||||||
description:
|
description:
|
||||||
- Specifies that the monitor allows more than one probe attempt per interval.
|
- Specifies that the monitor allows more than one probe attempt per interval.
|
||||||
|
@ -119,23 +130,27 @@ options:
|
||||||
target_username:
|
target_username:
|
||||||
description:
|
description:
|
||||||
- Specifies the user name, if the monitored target requires authentication.
|
- Specifies the user name, if the monitored target requires authentication.
|
||||||
|
type: str
|
||||||
target_password:
|
target_password:
|
||||||
description:
|
description:
|
||||||
- Specifies the password, if the monitored target requires authentication.
|
- Specifies the password, if the monitored target requires authentication.
|
||||||
|
type: str
|
||||||
update_password:
|
update_password:
|
||||||
description:
|
description:
|
||||||
- C(always) will update passwords if the C(target_password) is specified.
|
- C(always) will update passwords if the C(target_password) is specified.
|
||||||
- C(on_create) will only set the password for newly created monitors.
|
- C(on_create) will only set the password for newly created monitors.
|
||||||
default: always
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- always
|
- always
|
||||||
- on_create
|
- on_create
|
||||||
|
default: always
|
||||||
cipher_list:
|
cipher_list:
|
||||||
description:
|
description:
|
||||||
- Specifies the list of ciphers for this monitor.
|
- Specifies the list of ciphers for this monitor.
|
||||||
- The items in the cipher list are separated with the colon C(:) symbol.
|
- The items in the cipher list are separated with the colon C(:) symbol.
|
||||||
- When creating a new monitor, if this parameter is not specified, the default
|
- When creating a new monitor, if this parameter is not specified, the default
|
||||||
list is C(DEFAULT:+SHA:+3DES:+kEDH).
|
list is C(DEFAULT:+SHA:+3DES:+kEDH).
|
||||||
|
type: str
|
||||||
compatibility:
|
compatibility:
|
||||||
description:
|
description:
|
||||||
- Specifies, when enabled, that the SSL options setting (in OpenSSL) is set to B(all).
|
- Specifies, when enabled, that the SSL options setting (in OpenSSL) is set to B(all).
|
||||||
|
@ -146,9 +161,11 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies a fully-qualified path for a client certificate that the monitor sends to
|
- Specifies a fully-qualified path for a client certificate that the monitor sends to
|
||||||
the target SSL server.
|
the target SSL server.
|
||||||
|
type: str
|
||||||
client_key:
|
client_key:
|
||||||
description:
|
description:
|
||||||
- Specifies a key for a client certificate that the monitor sends to the target SSL server.
|
- Specifies a key for a client certificate that the monitor sends to the target SSL server.
|
||||||
|
type: str
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -276,24 +293,18 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
|
||||||
|
@ -679,7 +690,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
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.want = ModuleParameters(params=self.module.params)
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -937,16 +948,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -23,31 +23,37 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Monitor name.
|
- Monitor name.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
parent:
|
parent:
|
||||||
description:
|
description:
|
||||||
- The parent template of this monitor template. Once this value has
|
- The parent template of this monitor template. Once this value has
|
||||||
been set, it cannot be changed. By default, this value is the C(tcp)
|
been set, it cannot be changed. By default, this value is the C(tcp)
|
||||||
parent on the C(Common) partition.
|
parent on the C(Common) partition.
|
||||||
|
type: str
|
||||||
default: /Common/tcp
|
default: /Common/tcp
|
||||||
send:
|
send:
|
||||||
description:
|
description:
|
||||||
- The send string for the monitor call.
|
- The send string for the monitor call.
|
||||||
|
type: str
|
||||||
receive:
|
receive:
|
||||||
description:
|
description:
|
||||||
- The receive string for the monitor call.
|
- The receive string for the monitor call.
|
||||||
|
type: str
|
||||||
ip:
|
ip:
|
||||||
description:
|
description:
|
||||||
- IP address part of the IP/port definition. If this parameter is not
|
- IP address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'.
|
'*'.
|
||||||
- If this value is an IP address, then a C(port) number must be specified.
|
- If this value is an IP address, then a C(port) number must be specified.
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Port address part of the IP/port definition. If this parameter is not
|
- Port address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
||||||
must be specified
|
must be specified
|
||||||
|
type: str
|
||||||
interval:
|
interval:
|
||||||
description:
|
description:
|
||||||
- The interval specifying how frequently the monitor instance of this
|
- The interval specifying how frequently the monitor instance of this
|
||||||
|
@ -55,6 +61,7 @@ options:
|
||||||
- If this parameter is not provided when creating a new monitor, then the
|
- If this parameter is not provided when creating a new monitor, then the
|
||||||
default value will be 30.
|
default value will be 30.
|
||||||
- This value B(must) be less than the C(timeout) value.
|
- This value B(must) be less than the C(timeout) value.
|
||||||
|
type: int
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- The number of seconds in which the node or service must respond to
|
- The number of seconds in which the node or service must respond to
|
||||||
|
@ -65,24 +72,28 @@ options:
|
||||||
interval number of seconds plus 1 second.
|
interval number of seconds plus 1 second.
|
||||||
- If this parameter is not provided when creating a new monitor, then the
|
- If this parameter is not provided when creating a new monitor, then the
|
||||||
default value will be 120.
|
default value will be 120.
|
||||||
|
type: int
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the monitor exists.
|
- When C(present), ensures that the monitor exists.
|
||||||
- When C(absent), ensures the monitor is removed.
|
- When C(absent), ensures the monitor is removed.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
probe_timeout:
|
probe_timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds after which the system times out the probe request
|
- Specifies the number of seconds after which the system times out the probe request
|
||||||
to the system.
|
to the system.
|
||||||
- When creating a new monitor, if this parameter is not provided, then the default
|
- When creating a new monitor, if this parameter is not provided, then the default
|
||||||
value will be C(5).
|
value will be C(5).
|
||||||
|
type: int
|
||||||
ignore_down_response:
|
ignore_down_response:
|
||||||
description:
|
description:
|
||||||
- Specifies that the monitor allows more than one probe attempt per interval.
|
- Specifies that the monitor allows more than one probe attempt per interval.
|
||||||
|
@ -221,24 +232,18 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
|
||||||
|
@ -537,7 +542,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
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.want = ModuleParameters(params=self.module.params)
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -779,16 +784,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -23,30 +23,35 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Monitor name.
|
- Monitor name.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
parent:
|
parent:
|
||||||
description:
|
description:
|
||||||
- The parent template of this monitor template. Once this value has
|
- The parent template of this monitor template. Once this value has
|
||||||
been set, it cannot be changed. By default, this value is the C(tcp_half_open)
|
been set, it cannot be changed. By default, this value is the C(tcp_half_open)
|
||||||
parent on the C(Common) partition.
|
parent on the C(Common) partition.
|
||||||
|
type: str
|
||||||
default: "/Common/tcp_half_open"
|
default: "/Common/tcp_half_open"
|
||||||
ip:
|
ip:
|
||||||
description:
|
description:
|
||||||
- IP address part of the IP/port definition. If this parameter is not
|
- IP address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'.
|
'*'.
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Port address part of the IP/port definition. If this parameter is not
|
- Port address part of the IP/port definition. If this parameter is not
|
||||||
provided when creating a new monitor, then the default value will be
|
provided when creating a new monitor, then the default value will be
|
||||||
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
'*'. Note that if specifying an IP address, a value between 1 and 65535
|
||||||
must be specified
|
must be specified
|
||||||
|
type: str
|
||||||
interval:
|
interval:
|
||||||
description:
|
description:
|
||||||
- Specifies, in seconds, the frequency at which the system issues the monitor
|
- Specifies, in seconds, the frequency at which the system issues the monitor
|
||||||
check when either the resource is down or the status of the resource is unknown.
|
check when either the resource is down or the status of the resource is unknown.
|
||||||
- When creating a new monitor, if this parameter is not provided, then the
|
- When creating a new monitor, if this parameter is not provided, then the
|
||||||
default value will be C(30). This value B(must) be less than the C(timeout) value.
|
default value will be C(30). This value B(must) be less than the C(timeout) value.
|
||||||
|
type: int
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds the target has in which to respond to the
|
- Specifies the number of seconds the target has in which to respond to the
|
||||||
|
@ -56,6 +61,7 @@ options:
|
||||||
- When this value is set to 0 (zero), the system uses the interval from the parent monitor.
|
- When this value is set to 0 (zero), the system uses the interval from the parent monitor.
|
||||||
- When creating a new monitor, if this parameter is not provided, then
|
- When creating a new monitor, if this parameter is not provided, then
|
||||||
the default value will be C(120).
|
the default value will be C(120).
|
||||||
|
type: int
|
||||||
probe_interval:
|
probe_interval:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds the big3d process waits before sending out a
|
- Specifies the number of seconds the big3d process waits before sending out a
|
||||||
|
@ -63,18 +69,21 @@ options:
|
||||||
been requested.
|
been requested.
|
||||||
- When creating a new monitor, if this parameter is not provided, then the default
|
- When creating a new monitor, if this parameter is not provided, then the default
|
||||||
value will be C(1).
|
value will be C(1).
|
||||||
|
type: int
|
||||||
probe_timeout:
|
probe_timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds after which the system times out the probe request
|
- Specifies the number of seconds after which the system times out the probe request
|
||||||
to the system.
|
to the system.
|
||||||
- When creating a new monitor, if this parameter is not provided, then the default
|
- When creating a new monitor, if this parameter is not provided, then the default
|
||||||
value will be C(5).
|
value will be C(5).
|
||||||
|
type: int
|
||||||
probe_attempts:
|
probe_attempts:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of times the system attempts to probe the host server, after
|
- Specifies the number of times the system attempts to probe the host server, after
|
||||||
which the system considers the host server down or unavailable.
|
which the system considers the host server down or unavailable.
|
||||||
- When creating a new monitor, if this parameter is not provided, then the default
|
- When creating a new monitor, if this parameter is not provided, then the default
|
||||||
value will be C(3).
|
value will be C(3).
|
||||||
|
type: int
|
||||||
ignore_down_response:
|
ignore_down_response:
|
||||||
description:
|
description:
|
||||||
- Specifies that the monitor allows more than one probe attempt per interval.
|
- Specifies that the monitor allows more than one probe attempt per interval.
|
||||||
|
@ -100,15 +109,17 @@ options:
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the monitor exists.
|
- When C(present), ensures that the monitor exists.
|
||||||
- When C(absent), ensures the monitor is removed.
|
- When C(absent), ensures the monitor is removed.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
notes:
|
notes:
|
||||||
- Requires BIG-IP software version >= 12
|
- Requires BIG-IP software version >= 12
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
|
@ -195,24 +206,18 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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 module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
|
||||||
|
@ -445,7 +450,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
self.module = kwargs.get('module', None)
|
||||||
self.client = kwargs.get('client', None)
|
self.client = F5RestClient(**self.module.params)
|
||||||
self.have = None
|
self.have = None
|
||||||
self.want = ModuleParameters(params=self.module.params)
|
self.want = ModuleParameters(params=self.module.params)
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -687,16 +692,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -26,6 +26,7 @@ options:
|
||||||
When C(absent), ensures that the pool is removed from the system. When
|
When C(absent), ensures that the pool is removed from the system. When
|
||||||
C(enabled) or C(disabled), ensures that the pool is enabled or disabled
|
C(enabled) or C(disabled), ensures that the pool is enabled or disabled
|
||||||
(respectively) on the remote device.
|
(respectively) on the remote device.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
@ -35,6 +36,7 @@ options:
|
||||||
preferred_lb_method:
|
preferred_lb_method:
|
||||||
description:
|
description:
|
||||||
- The load balancing mode that the system tries first.
|
- The load balancing mode that the system tries first.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- round-robin
|
- round-robin
|
||||||
- return-to-dns
|
- return-to-dns
|
||||||
|
@ -58,6 +60,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- The load balancing mode that the system tries if the
|
- The load balancing mode that the system tries if the
|
||||||
C(preferred_lb_method) is unsuccessful in picking a pool.
|
C(preferred_lb_method) is unsuccessful in picking a pool.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- round-robin
|
- round-robin
|
||||||
- return-to-dns
|
- return-to-dns
|
||||||
|
@ -76,6 +79,7 @@ options:
|
||||||
- The load balancing mode that the system tries if both the
|
- The load balancing mode that the system tries if both the
|
||||||
C(preferred_lb_method) and C(alternate_lb_method)s are unsuccessful
|
C(preferred_lb_method) and C(alternate_lb_method)s are unsuccessful
|
||||||
in picking a pool.
|
in picking a pool.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- round-robin
|
- round-robin
|
||||||
- return-to-dns
|
- return-to-dns
|
||||||
|
@ -102,11 +106,13 @@ options:
|
||||||
directs requests when it cannot use one of its pools to do so.
|
directs requests when it cannot use one of its pools to do so.
|
||||||
Note that the system uses the fallback IP only if you select the
|
Note that the system uses the fallback IP only if you select the
|
||||||
C(fallback_ip) load balancing method.
|
C(fallback_ip) load balancing method.
|
||||||
|
type: str
|
||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- The type of GTM pool that you want to create. On BIG-IP releases
|
- The type of GTM pool that you want to create. On BIG-IP releases
|
||||||
prior to version 12, this parameter is not required. On later versions
|
prior to version 12, this parameter is not required. On later versions
|
||||||
of BIG-IP, this is a required parameter.
|
of BIG-IP, this is a required parameter.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- a
|
- a
|
||||||
- aaaa
|
- aaaa
|
||||||
|
@ -117,10 +123,12 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Name of the GTM pool.
|
- Name of the GTM pool.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
members:
|
members:
|
||||||
|
@ -131,17 +139,21 @@ options:
|
||||||
server:
|
server:
|
||||||
description:
|
description:
|
||||||
- Name of the server which the pool member is a part of.
|
- Name of the server which the pool member is a part of.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
virtual_server:
|
virtual_server:
|
||||||
description:
|
description:
|
||||||
- Name of the virtual server, associated with the server, that the pool member is a part of.
|
- Name of the virtual server, associated with the server, that the pool member is a part of.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
|
type: list
|
||||||
version_added: 2.6
|
version_added: 2.6
|
||||||
monitors:
|
monitors:
|
||||||
description:
|
description:
|
||||||
- Specifies the health monitors that the system currently uses to monitor this resource.
|
- Specifies the health monitors that the system currently uses to monitor this resource.
|
||||||
- When C(availability_requirements.type) is C(require), you may only have a single monitor in the
|
- When C(availability_requirements.type) is C(require), you may only have a single monitor in the
|
||||||
C(monitors) list.
|
C(monitors) list.
|
||||||
|
type: list
|
||||||
version_added: 2.6
|
version_added: 2.6
|
||||||
availability_requirements:
|
availability_requirements:
|
||||||
description:
|
description:
|
||||||
|
@ -153,13 +165,18 @@ options:
|
||||||
description:
|
description:
|
||||||
- Monitor rule type when C(monitors) is specified.
|
- Monitor rule type when C(monitors) is specified.
|
||||||
- When creating a new pool, if this value is not specified, the default of 'all' will be used.
|
- When creating a new pool, if this value is not specified, the default of 'all' will be used.
|
||||||
choices: ['all', 'at_least', 'require']
|
type: str
|
||||||
|
choices:
|
||||||
|
- all
|
||||||
|
- at_least
|
||||||
|
- require
|
||||||
at_least:
|
at_least:
|
||||||
description:
|
description:
|
||||||
- Specifies the minimum number of active health monitors that must be successful
|
- Specifies the minimum number of active health monitors that must be successful
|
||||||
before the link is considered up.
|
before the link is considered up.
|
||||||
- This parameter is only relevant when a C(type) of C(at_least) is used.
|
- This parameter is only relevant when a C(type) of C(at_least) is used.
|
||||||
- This parameter will be ignored if a type of either C(all) or C(require) is used.
|
- This parameter will be ignored if a type of either C(all) or C(require) is used.
|
||||||
|
type: int
|
||||||
number_of_probes:
|
number_of_probes:
|
||||||
description:
|
description:
|
||||||
- Specifies the minimum number of probes that must succeed for this server to be declared up.
|
- Specifies the minimum number of probes that must succeed for this server to be declared up.
|
||||||
|
@ -168,6 +185,7 @@ options:
|
||||||
- The value of this parameter should always be B(lower) than, or B(equal to), the value of C(number_of_probers).
|
- The value of this parameter should always be B(lower) than, or B(equal to), the value of C(number_of_probers).
|
||||||
- This parameter is only relevant when a C(type) of C(require) is used.
|
- This parameter is only relevant when a C(type) of C(require) is used.
|
||||||
- This parameter will be ignored if a type of either C(all) or C(at_least) is used.
|
- This parameter will be ignored if a type of either C(all) or C(at_least) is used.
|
||||||
|
type: int
|
||||||
number_of_probers:
|
number_of_probers:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of probers that should be used when running probes.
|
- Specifies the number of probers that should be used when running probes.
|
||||||
|
@ -176,15 +194,19 @@ options:
|
||||||
- The value of this parameter should always be B(higher) than, or B(equal to), the value of C(number_of_probers).
|
- The value of this parameter should always be B(higher) than, or B(equal to), the value of C(number_of_probers).
|
||||||
- This parameter is only relevant when a C(type) of C(require) is used.
|
- This parameter is only relevant when a C(type) of C(require) is used.
|
||||||
- This parameter will be ignored if a type of either C(all) or C(at_least) is used.
|
- This parameter will be ignored if a type of either C(all) or C(at_least) is used.
|
||||||
|
type: int
|
||||||
|
type: dict
|
||||||
version_added: 2.6
|
version_added: 2.6
|
||||||
max_answers_returned:
|
max_answers_returned:
|
||||||
description:
|
description:
|
||||||
- Specifies the maximum number of available virtual servers that the system lists in a response.
|
- Specifies the maximum number of available virtual servers that the system lists in a response.
|
||||||
- The maximum is 500.
|
- The maximum is 500.
|
||||||
|
type: int
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
ttl:
|
ttl:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds that the IP address, once found, is valid.
|
- Specifies the number of seconds that the IP address, once found, is valid.
|
||||||
|
type: int
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
|
@ -270,12 +292,9 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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 tmos_version
|
||||||
from library.module_utils.network.f5.icontrol import module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
@ -283,12 +302,9 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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 tmos_version
|
||||||
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
@ -791,8 +807,9 @@ class Difference(object):
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
self.module = kwargs.get('module', None)
|
||||||
|
self.client = F5RestClient(**self.module.params)
|
||||||
self.kwargs = kwargs
|
self.kwargs = kwargs
|
||||||
self.client = kwargs.get('client', None)
|
|
||||||
|
|
||||||
def exec_module(self):
|
def exec_module(self):
|
||||||
if not module_provisioned(self.client, 'gtm'):
|
if not module_provisioned(self.client, 'gtm'):
|
||||||
|
@ -822,7 +839,7 @@ class ModuleManager(object):
|
||||||
class BaseManager(object):
|
class BaseManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
self.module = kwargs.get('module', None)
|
||||||
self.client = kwargs.get('client', None)
|
self.client = F5RestClient(**self.module.params)
|
||||||
self.have = None
|
self.have = None
|
||||||
self.want = ModuleParameters(params=self.module.params)
|
self.want = ModuleParameters(params=self.module.params)
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -1232,18 +1249,15 @@ def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=spec.argument_spec,
|
argument_spec=spec.argument_spec,
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
|
required_if=spec.required_if
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -29,14 +29,17 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of the GTM virtual server which is assigned to the specified
|
- Specifies the name of the GTM virtual server which is assigned to the specified
|
||||||
C(server).
|
C(server).
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
server_name:
|
server_name:
|
||||||
description:
|
description:
|
||||||
- Specifies the GTM server which contains the C(virtual_server).
|
- Specifies the GTM server which contains the C(virtual_server).
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- The type of GTM pool that the member is in.
|
- The type of GTM pool that the member is in.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- a
|
- a
|
||||||
- aaaa
|
- aaaa
|
||||||
|
@ -50,10 +53,12 @@ options:
|
||||||
- Name of the GTM pool.
|
- Name of the GTM pool.
|
||||||
- For pools created on different partitions, you must specify partition of the pool in the full path format,
|
- For pools created on different partitions, you must specify partition of the pool in the full path format,
|
||||||
for example, C(/FooBar/pool_name).
|
for example, C(/FooBar/pool_name).
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
member_order:
|
member_order:
|
||||||
description:
|
description:
|
||||||
|
@ -62,6 +67,7 @@ options:
|
||||||
pool members, such as the Ratio load balancing method.
|
pool members, such as the Ratio load balancing method.
|
||||||
- When creating a new member using this module, if the C(member_order) parameter
|
- When creating a new member using this module, if the C(member_order) parameter
|
||||||
is not specified, it will default to C(0) (first member in the pool).
|
is not specified, it will default to C(0) (first member in the pool).
|
||||||
|
type: int
|
||||||
monitor:
|
monitor:
|
||||||
description:
|
description:
|
||||||
- Specifies the monitor assigned to this pool member.
|
- Specifies the monitor assigned to this pool member.
|
||||||
|
@ -73,15 +79,19 @@ options:
|
||||||
- To remove the monitor from the pool member, use the value C(none).
|
- To remove the monitor from the pool member, use the value C(none).
|
||||||
- For pool members created on different partitions, you can also specify the full
|
- For pool members created on different partitions, you can also specify the full
|
||||||
path to the Common monitor. For example, C(/Common/tcp).
|
path to the Common monitor. For example, C(/Common/tcp).
|
||||||
|
type: str
|
||||||
ratio:
|
ratio:
|
||||||
description:
|
description:
|
||||||
- Specifies the weight of the pool member for load balancing purposes.
|
- Specifies the weight of the pool member for load balancing purposes.
|
||||||
|
type: int
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- The description of the pool member.
|
- The description of the pool member.
|
||||||
|
type: str
|
||||||
aggregate:
|
aggregate:
|
||||||
description:
|
description:
|
||||||
- List of GTM pool member definitions to be created, modified or removed.
|
- List of GTM pool member definitions to be created, modified or removed.
|
||||||
|
type: list
|
||||||
aliases:
|
aliases:
|
||||||
- members
|
- members
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
|
@ -125,18 +135,22 @@ options:
|
||||||
for the member.
|
for the member.
|
||||||
- If the network traffic volume exceeds this limit, the system marks the
|
- If the network traffic volume exceeds this limit, the system marks the
|
||||||
member as unavailable.
|
member as unavailable.
|
||||||
|
type: int
|
||||||
packets_limit:
|
packets_limit:
|
||||||
description:
|
description:
|
||||||
- Specifies the maximum allowable data transfer rate, in packets per second,
|
- Specifies the maximum allowable data transfer rate, in packets per second,
|
||||||
for the member.
|
for the member.
|
||||||
- If the network traffic volume exceeds this limit, the system marks the
|
- If the network traffic volume exceeds this limit, the system marks the
|
||||||
member as unavailable.
|
member as unavailable.
|
||||||
|
type: int
|
||||||
connections_limit:
|
connections_limit:
|
||||||
description:
|
description:
|
||||||
- Specifies the maximum number of concurrent connections, combined, for all of
|
- Specifies the maximum number of concurrent connections, combined, for all of
|
||||||
the member.
|
the member.
|
||||||
- If the connections exceed this limit, the system marks the server as
|
- If the connections exceed this limit, the system marks the server as
|
||||||
unavailable.
|
unavailable.
|
||||||
|
type: int
|
||||||
|
type: dict
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Pool member state. When C(present), ensures that the pool member is
|
- Pool member state. When C(present), ensures that the pool member is
|
||||||
|
@ -151,12 +165,13 @@ options:
|
||||||
- Remember that the order of the members will be affected if you add or remove them
|
- Remember that the order of the members will be affected if you add or remove them
|
||||||
using this method. To some extent, this can be controlled using the C(member_order)
|
using this method. To some extent, this can be controlled using the C(member_order)
|
||||||
parameter.
|
parameter.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
- enabled
|
- enabled
|
||||||
- disabled
|
- disabled
|
||||||
|
default: present
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -197,19 +212,16 @@ EXAMPLES = r'''
|
||||||
- server_name: server1
|
- server_name: server1
|
||||||
virtual_server: vs1
|
virtual_server: vs1
|
||||||
partition: Common
|
partition: Common
|
||||||
port: 8080
|
|
||||||
description: web server1
|
description: web server1
|
||||||
member_order: 0
|
member_order: 0
|
||||||
- server_name: server2
|
- server_name: server2
|
||||||
virtual_server: vs2
|
virtual_server: vs2
|
||||||
partition: Common
|
partition: Common
|
||||||
port: 8081
|
|
||||||
description: web server2
|
description: web server2
|
||||||
member_order: 1
|
member_order: 1
|
||||||
- server_name: server3
|
- server_name: server3
|
||||||
virtual_server: vs3
|
virtual_server: vs3
|
||||||
partition: Common
|
partition: Common
|
||||||
port: 8082
|
|
||||||
description: web server3
|
description: web server3
|
||||||
member_order: 2
|
member_order: 2
|
||||||
provider:
|
provider:
|
||||||
|
@ -226,19 +238,16 @@ EXAMPLES = r'''
|
||||||
- server_name: server1
|
- server_name: server1
|
||||||
virtual_server: vs1
|
virtual_server: vs1
|
||||||
partition: Common
|
partition: Common
|
||||||
port: 8080
|
|
||||||
description: web server1
|
description: web server1
|
||||||
member_order: 0
|
member_order: 0
|
||||||
- server_name: server2
|
- server_name: server2
|
||||||
virtual_server: vs2
|
virtual_server: vs2
|
||||||
partition: Common
|
partition: Common
|
||||||
port: 8081
|
|
||||||
description: web server2
|
description: web server2
|
||||||
member_order: 1
|
member_order: 1
|
||||||
- server_name: server3
|
- server_name: server3
|
||||||
virtual_server: vs3
|
virtual_server: vs3
|
||||||
partition: Common
|
partition: Common
|
||||||
port: 8082
|
|
||||||
description: web server3
|
description: web server3
|
||||||
member_order: 2
|
member_order: 2
|
||||||
replace_all_with: yes
|
replace_all_with: yes
|
||||||
|
@ -330,12 +339,9 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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.common import flatten_boolean
|
from library.module_utils.network.f5.common import flatten_boolean
|
||||||
from library.module_utils.network.f5.icontrol import module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from library.module_utils.network.f5.icontrol import TransactionContextManager
|
from library.module_utils.network.f5.icontrol import TransactionContextManager
|
||||||
|
@ -344,12 +350,9 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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.common import flatten_boolean
|
from ansible.module_utils.network.f5.common import flatten_boolean
|
||||||
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
from ansible.module_utils.network.f5.icontrol import TransactionContextManager
|
from ansible.module_utils.network.f5.icontrol import TransactionContextManager
|
||||||
|
@ -599,7 +602,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
self.module = kwargs.get('module', None)
|
||||||
self.client = kwargs.get('client', None)
|
self.client = F5RestClient(**self.module.params)
|
||||||
self.want = None
|
self.want = None
|
||||||
self.have = None
|
self.have = None
|
||||||
self.changes = None
|
self.changes = None
|
||||||
|
@ -1070,16 +1073,12 @@ def main():
|
||||||
required_together=spec.required_together,
|
required_together=spec.required_together,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -24,6 +24,7 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The name of the server.
|
- The name of the server.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
|
@ -32,16 +33,18 @@ options:
|
||||||
C(present) creates the server and enables it. If C(enabled), enable the server
|
C(present) creates the server and enables it. If C(enabled), enable the server
|
||||||
if it exists. If C(disabled), create the server if needed, and set state to
|
if it exists. If C(disabled), create the server if needed, and set state to
|
||||||
C(disabled).
|
C(disabled).
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
- enabled
|
- enabled
|
||||||
- disabled
|
- disabled
|
||||||
|
default: present
|
||||||
datacenter:
|
datacenter:
|
||||||
description:
|
description:
|
||||||
- Data center the server belongs to. When creating a new GTM server, this value
|
- Data center the server belongs to. When creating a new GTM server, this value
|
||||||
is required.
|
is required.
|
||||||
|
type: str
|
||||||
devices:
|
devices:
|
||||||
description:
|
description:
|
||||||
- Lists the self IP addresses and translations for each device. When creating a
|
- Lists the self IP addresses and translations for each device. When creating a
|
||||||
|
@ -56,11 +59,13 @@ options:
|
||||||
- Specifying duplicate C(name) fields is a supported means of providing device
|
- Specifying duplicate C(name) fields is a supported means of providing device
|
||||||
addresses. In this scenario, the addresses will be assigned to the C(name)'s list
|
addresses. In this scenario, the addresses will be assigned to the C(name)'s list
|
||||||
of addresses.
|
of addresses.
|
||||||
|
type: list
|
||||||
server_type:
|
server_type:
|
||||||
description:
|
description:
|
||||||
- Specifies the server type. The server type determines the metrics that the
|
- Specifies the server type. The server type determines the metrics that the
|
||||||
system can collect from the server. When creating a new GTM server, the default
|
system can collect from the server. When creating a new GTM server, the default
|
||||||
value C(bigip) is used.
|
value C(bigip) is used.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- alteon-ace-director
|
- alteon-ace-director
|
||||||
- cisco-css
|
- cisco-css
|
||||||
|
@ -88,6 +93,7 @@ options:
|
||||||
- If you set this parameter to C(enabled) or C(enabled-no-delete), you must
|
- If you set this parameter to C(enabled) or C(enabled-no-delete), you must
|
||||||
also ensure that the C(virtual_server_discovery) parameter is also set to
|
also ensure that the C(virtual_server_discovery) parameter is also set to
|
||||||
C(enabled) or C(enabled-no-delete).
|
C(enabled) or C(enabled-no-delete).
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- enabled
|
- enabled
|
||||||
- disabled
|
- disabled
|
||||||
|
@ -97,6 +103,7 @@ options:
|
||||||
- Specifies whether the system auto-discovers the virtual servers for this server.
|
- Specifies whether the system auto-discovers the virtual servers for this server.
|
||||||
When creating a new GTM server, if this parameter is not specified, the default
|
When creating a new GTM server, if this parameter is not specified, the default
|
||||||
value C(disabled) is used.
|
value C(disabled) is used.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- enabled
|
- enabled
|
||||||
- disabled
|
- disabled
|
||||||
|
@ -104,6 +111,7 @@ options:
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
iquery_options:
|
iquery_options:
|
||||||
|
@ -126,12 +134,14 @@ options:
|
||||||
- Specifies that the system checks the performance of a server running an SNMP
|
- Specifies that the system checks the performance of a server running an SNMP
|
||||||
agent.
|
agent.
|
||||||
type: bool
|
type: bool
|
||||||
|
type: dict
|
||||||
version_added: 2.7
|
version_added: 2.7
|
||||||
monitors:
|
monitors:
|
||||||
description:
|
description:
|
||||||
- Specifies the health monitors that the system currently uses to monitor this resource.
|
- Specifies the health monitors that the system currently uses to monitor this resource.
|
||||||
- When C(availability_requirements.type) is C(require), you may only have a single monitor in the
|
- When C(availability_requirements.type) is C(require), you may only have a single monitor in the
|
||||||
C(monitors) list.
|
C(monitors) list.
|
||||||
|
type: list
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
availability_requirements:
|
availability_requirements:
|
||||||
description:
|
description:
|
||||||
|
@ -143,13 +153,18 @@ options:
|
||||||
description:
|
description:
|
||||||
- Monitor rule type when C(monitors) is specified.
|
- Monitor rule type when C(monitors) is specified.
|
||||||
- When creating a new pool, if this value is not specified, the default of 'all' will be used.
|
- When creating a new pool, if this value is not specified, the default of 'all' will be used.
|
||||||
choices: ['all', 'at_least', 'require']
|
type: str
|
||||||
|
choices:
|
||||||
|
- all
|
||||||
|
- at_least
|
||||||
|
- require
|
||||||
at_least:
|
at_least:
|
||||||
description:
|
description:
|
||||||
- Specifies the minimum number of active health monitors that must be successful
|
- Specifies the minimum number of active health monitors that must be successful
|
||||||
before the link is considered up.
|
before the link is considered up.
|
||||||
- This parameter is only relevant when a C(type) of C(at_least) is used.
|
- This parameter is only relevant when a C(type) of C(at_least) is used.
|
||||||
- This parameter will be ignored if a type of either C(all) or C(require) is used.
|
- This parameter will be ignored if a type of either C(all) or C(require) is used.
|
||||||
|
type: int
|
||||||
number_of_probes:
|
number_of_probes:
|
||||||
description:
|
description:
|
||||||
- Specifies the minimum number of probes that must succeed for this server to be declared up.
|
- Specifies the minimum number of probes that must succeed for this server to be declared up.
|
||||||
|
@ -158,6 +173,7 @@ options:
|
||||||
- The value of this parameter should always be B(lower) than, or B(equal to), the value of C(number_of_probers).
|
- The value of this parameter should always be B(lower) than, or B(equal to), the value of C(number_of_probers).
|
||||||
- This parameter is only relevant when a C(type) of C(require) is used.
|
- This parameter is only relevant when a C(type) of C(require) is used.
|
||||||
- This parameter will be ignored if a type of either C(all) or C(at_least) is used.
|
- This parameter will be ignored if a type of either C(all) or C(at_least) is used.
|
||||||
|
type: int
|
||||||
number_of_probers:
|
number_of_probers:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of probers that should be used when running probes.
|
- Specifies the number of probers that should be used when running probes.
|
||||||
|
@ -166,6 +182,8 @@ options:
|
||||||
- The value of this parameter should always be B(higher) than, or B(equal to), the value of C(number_of_probers).
|
- The value of this parameter should always be B(higher) than, or B(equal to), the value of C(number_of_probers).
|
||||||
- This parameter is only relevant when a C(type) of C(require) is used.
|
- This parameter is only relevant when a C(type) of C(require) is used.
|
||||||
- This parameter will be ignored if a type of either C(all) or C(at_least) is used.
|
- This parameter will be ignored if a type of either C(all) or C(at_least) is used.
|
||||||
|
type: int
|
||||||
|
type: dict
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
prober_preference:
|
prober_preference:
|
||||||
description:
|
description:
|
||||||
|
@ -173,6 +191,7 @@ options:
|
||||||
- This option is ignored in C(TMOS) version C(12.x).
|
- This option is ignored in C(TMOS) version C(12.x).
|
||||||
- From C(TMOS) version C(13.x) and up, when prober_preference is set to C(pool)
|
- From C(TMOS) version C(13.x) and up, when prober_preference is set to C(pool)
|
||||||
a C(prober_pool) parameter must be specified.
|
a C(prober_pool) parameter must be specified.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- inside-datacenter
|
- inside-datacenter
|
||||||
- outside-datacenter
|
- outside-datacenter
|
||||||
|
@ -188,6 +207,7 @@ options:
|
||||||
a C(prober_pool) parameter must be specified.
|
a C(prober_pool) parameter must be specified.
|
||||||
- The choices are mutually exclusive with prober_preference parameter,
|
- The choices are mutually exclusive with prober_preference parameter,
|
||||||
with the exception of C(any-available) or C(none) option.
|
with the exception of C(any-available) or C(none) option.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- any
|
- any
|
||||||
- inside-datacenter
|
- inside-datacenter
|
||||||
|
@ -203,6 +223,7 @@ options:
|
||||||
- Format of the name can be either be prepended by partition (C(/Common/foo)), or specified
|
- Format of the name can be either be prepended by partition (C(/Common/foo)), or specified
|
||||||
just as an object name (C(foo)).
|
just as an object name (C(foo)).
|
||||||
- In C(TMOS) version C(12.x) prober_pool can be set to empty string to revert to default setting of inherit.
|
- In C(TMOS) version C(12.x) prober_pool can be set to empty string to revert to default setting of inherit.
|
||||||
|
type: str
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
limits:
|
limits:
|
||||||
description:
|
description:
|
||||||
|
@ -212,7 +233,6 @@ options:
|
||||||
- You can define limits for any or all of the limit settings. However, when a
|
- You can define limits for any or all of the limit settings. However, when a
|
||||||
member does not meet the resource threshold limit requirement, the system marks
|
member does not meet the resource threshold limit requirement, the system marks
|
||||||
the member as unavailable and directs load-balancing traffic to another resource.
|
the member as unavailable and directs load-balancing traffic to another resource.
|
||||||
version_added: 2.8
|
|
||||||
suboptions:
|
suboptions:
|
||||||
bits_enabled:
|
bits_enabled:
|
||||||
description:
|
description:
|
||||||
|
@ -245,26 +265,33 @@ options:
|
||||||
for the member.
|
for the member.
|
||||||
- If the network traffic volume exceeds this limit, the system marks the
|
- If the network traffic volume exceeds this limit, the system marks the
|
||||||
member as unavailable.
|
member as unavailable.
|
||||||
|
type: int
|
||||||
packets_limit:
|
packets_limit:
|
||||||
description:
|
description:
|
||||||
- Specifies the maximum allowable data transfer rate, in packets per second,
|
- Specifies the maximum allowable data transfer rate, in packets per second,
|
||||||
for the member.
|
for the member.
|
||||||
- If the network traffic volume exceeds this limit, the system marks the
|
- If the network traffic volume exceeds this limit, the system marks the
|
||||||
member as unavailable.
|
member as unavailable.
|
||||||
|
type: int
|
||||||
connections_limit:
|
connections_limit:
|
||||||
description:
|
description:
|
||||||
- Specifies the maximum number of concurrent connections, combined, for all of
|
- Specifies the maximum number of concurrent connections, combined, for all of
|
||||||
the member.
|
the member.
|
||||||
- If the connections exceed this limit, the system marks the server as
|
- If the connections exceed this limit, the system marks the server as
|
||||||
unavailable.
|
unavailable.
|
||||||
|
type: int
|
||||||
cpu_limit:
|
cpu_limit:
|
||||||
description:
|
description:
|
||||||
- Specifies the percent of CPU usage.
|
- Specifies the percent of CPU usage.
|
||||||
- If percent of CPU usage goes above the limit, the system marks the server as unavailable.
|
- If percent of CPU usage goes above the limit, the system marks the server as unavailable.
|
||||||
|
type: int
|
||||||
memory_limit:
|
memory_limit:
|
||||||
description:
|
description:
|
||||||
- Specifies the available memory required by the virtual servers on the server.
|
- Specifies the available memory required by the virtual servers on the server.
|
||||||
- If available memory falls below this limit, the system marks the server as unavailable.
|
- If available memory falls below this limit, the system marks the server as unavailable.
|
||||||
|
type: int
|
||||||
|
type: dict
|
||||||
|
version_added: 2.8
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Robert Teller (@r-teller)
|
- Robert Teller (@r-teller)
|
||||||
|
@ -405,12 +432,9 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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.common import is_empty_list
|
from library.module_utils.network.f5.common import is_empty_list
|
||||||
from library.module_utils.network.f5.icontrol import tmos_version
|
from library.module_utils.network.f5.icontrol import tmos_version
|
||||||
from library.module_utils.network.f5.icontrol import module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
|
@ -418,12 +442,9 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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.common import is_empty_list
|
from ansible.module_utils.network.f5.common import is_empty_list
|
||||||
from ansible.module_utils.network.f5.icontrol import tmos_version
|
from ansible.module_utils.network.f5.icontrol import tmos_version
|
||||||
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
|
@ -1327,7 +1348,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
self.module = kwargs.get('module', None)
|
||||||
self.client = kwargs.get('client', None)
|
self.client = F5RestClient(**self.module.params)
|
||||||
self.kwargs = kwargs
|
self.kwargs = kwargs
|
||||||
|
|
||||||
def exec_module(self):
|
def exec_module(self):
|
||||||
|
@ -1358,7 +1379,7 @@ class ModuleManager(object):
|
||||||
class BaseManager(object):
|
class BaseManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
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.want = ModuleParameters(params=self.module.params)
|
||||||
self.want.update(dict(client=self.client))
|
self.want.update(dict(client=self.client))
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
|
@ -1748,16 +1769,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -32,28 +32,34 @@ options:
|
||||||
subnet:
|
subnet:
|
||||||
description:
|
description:
|
||||||
- An IP address and network mask in the CIDR format.
|
- An IP address and network mask in the CIDR format.
|
||||||
|
type: str
|
||||||
region:
|
region:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of region already defined in the configuration.
|
- Specifies the name of region already defined in the configuration.
|
||||||
|
type: str
|
||||||
continent:
|
continent:
|
||||||
description:
|
description:
|
||||||
- Specifies one of the seven continents, along with the C(Unknown) setting.
|
- Specifies one of the seven continents, along with the C(Unknown) setting.
|
||||||
- Specifying C(Unknown) forces the system to use a default resolution
|
- Specifying C(Unknown) forces the system to use a default resolution
|
||||||
if the system cannot determine the location of the local DNS making the request.
|
if the system cannot determine the location of the local DNS making the request.
|
||||||
- Full continent names and their abbreviated versions are supported.
|
- Full continent names and their abbreviated versions are supported.
|
||||||
|
type: str
|
||||||
country:
|
country:
|
||||||
description:
|
description:
|
||||||
- Specifies a country.
|
- Specifies a country.
|
||||||
- In addition to the country full names, you may also specify their abbreviated
|
- In addition to the country full names, you may also specify their abbreviated
|
||||||
form, such as C(US) instead of C(United States).
|
form, such as C(US) instead of C(United States).
|
||||||
- Valid country codes can be found here https://countrycode.org/.
|
- Valid country codes can be found here https://countrycode.org/.
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Specifies a state in a given country.
|
- Specifies a state in a given country.
|
||||||
- This parameter requires country option to be provided.
|
- This parameter requires country option to be provided.
|
||||||
|
type: str
|
||||||
isp:
|
isp:
|
||||||
description:
|
description:
|
||||||
- Specifies an Internet service provider.
|
- Specifies an Internet service provider.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- AOL
|
- AOL
|
||||||
- BeijingCNC
|
- BeijingCNC
|
||||||
|
@ -70,6 +76,8 @@ options:
|
||||||
geo_isp:
|
geo_isp:
|
||||||
description:
|
description:
|
||||||
- Specifies a geolocation ISP
|
- Specifies a geolocation ISP
|
||||||
|
type: str
|
||||||
|
type: dict
|
||||||
required: True
|
required: True
|
||||||
destination:
|
destination:
|
||||||
description:
|
description:
|
||||||
|
@ -83,32 +91,40 @@ options:
|
||||||
subnet:
|
subnet:
|
||||||
description:
|
description:
|
||||||
- An IP address and network mask in the CIDR format.
|
- An IP address and network mask in the CIDR format.
|
||||||
|
type: str
|
||||||
region:
|
region:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of region already defined in the configuration.
|
- Specifies the name of region already defined in the configuration.
|
||||||
|
type: str
|
||||||
continent:
|
continent:
|
||||||
description:
|
description:
|
||||||
- Specifies one of the seven continents, along with the C(Unknown) setting.
|
- Specifies one of the seven continents, along with the C(Unknown) setting.
|
||||||
- Specifying C(Unknown) forces the system to use a default resolution
|
- Specifying C(Unknown) forces the system to use a default resolution
|
||||||
if the system cannot determine the location of the local DNS making the request.
|
if the system cannot determine the location of the local DNS making the request.
|
||||||
- Full continent names and their abbreviated versions are supported.
|
- Full continent names and their abbreviated versions are supported.
|
||||||
|
type: str
|
||||||
country:
|
country:
|
||||||
description:
|
description:
|
||||||
- Specifies a country.
|
- Specifies a country.
|
||||||
- Full continent names and their abbreviated versions are supported.
|
- Full continent names and their abbreviated versions are supported.
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Specifies a state in a given country.
|
- Specifies a state in a given country.
|
||||||
- This parameter requires country option to be provided.
|
- This parameter requires country option to be provided.
|
||||||
|
type: str
|
||||||
pool:
|
pool:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of GTM pool already defined in the configuration.
|
- Specifies the name of GTM pool already defined in the configuration.
|
||||||
|
type: str
|
||||||
datacenter:
|
datacenter:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of GTM data center already defined in the configuration.
|
- Specifies the name of GTM data center already defined in the configuration.
|
||||||
|
type: str
|
||||||
isp:
|
isp:
|
||||||
description:
|
description:
|
||||||
- Specifies an Internet service provider.
|
- Specifies an Internet service provider.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- AOL
|
- AOL
|
||||||
- BeijingCNC
|
- BeijingCNC
|
||||||
|
@ -125,6 +141,8 @@ options:
|
||||||
geo_isp:
|
geo_isp:
|
||||||
description:
|
description:
|
||||||
- Specifies a geolocation ISP
|
- Specifies a geolocation ISP
|
||||||
|
type: str
|
||||||
|
type: dict
|
||||||
required: True
|
required: True
|
||||||
weight:
|
weight:
|
||||||
description:
|
description:
|
||||||
|
@ -142,11 +160,13 @@ options:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
- Partition parameter is taken into account when used in conjunction with C(pool), C(data_center),
|
- Partition parameter is taken into account when used in conjunction with C(pool), C(data_center),
|
||||||
and C(region) parameters, it is ignored otherwise.
|
and C(region) parameters, it is ignored otherwise.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(state) is C(present), ensures that the record exists.
|
- When C(state) is C(present), ensures that the record exists.
|
||||||
- When C(state) is C(absent), ensures that the record is removed.
|
- When C(state) is C(absent), ensures that the record is removed.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
@ -214,11 +234,8 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
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.common import transform_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 flatten_boolean
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip_network
|
from library.module_utils.network.f5.ipaddress import is_valid_ip_network
|
||||||
|
@ -226,11 +243,8 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
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.common import transform_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 flatten_boolean
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip_network
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip_network
|
||||||
|
@ -788,7 +802,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
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.want = ModuleParameters(params=self.module.params)
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -1054,16 +1068,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -31,7 +31,6 @@ options:
|
||||||
you must specify the entire list of members.
|
you must specify the entire list of members.
|
||||||
- The list will override what is on the device if different.
|
- The list will override what is on the device if different.
|
||||||
- If C(none) value is specified the region members list will be removed.
|
- If C(none) value is specified the region members list will be removed.
|
||||||
type: raw
|
|
||||||
suboptions:
|
suboptions:
|
||||||
negate:
|
negate:
|
||||||
description:
|
description:
|
||||||
|
@ -42,30 +41,37 @@ options:
|
||||||
region:
|
region:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of region already defined in the configuration.
|
- Specifies the name of region already defined in the configuration.
|
||||||
|
type: str
|
||||||
continent:
|
continent:
|
||||||
description:
|
description:
|
||||||
- Specifies one of the seven continents, along with the C(Unknown) setting.
|
- Specifies one of the seven continents, along with the C(Unknown) setting.
|
||||||
- Specifying C(Unknown) forces the system to use a default resolution
|
- Specifying C(Unknown) forces the system to use a default resolution
|
||||||
if the system cannot determine the location of the local DNS making the request.
|
if the system cannot determine the location of the local DNS making the request.
|
||||||
- Full continent names and their abbreviated versions are supported.
|
- Full continent names and their abbreviated versions are supported.
|
||||||
|
type: str
|
||||||
country:
|
country:
|
||||||
description:
|
description:
|
||||||
- The country name, or code to use.
|
- The country name, or code to use.
|
||||||
- In addition to the country full names, you may also specify their abbreviated
|
- In addition to the country full names, you may also specify their abbreviated
|
||||||
form, such as C(US) instead of C(United States).
|
form, such as C(US) instead of C(United States).
|
||||||
- Valid country codes can be found here https://countrycode.org/.
|
- Valid country codes can be found here https://countrycode.org/.
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Specifies a state in a given country.
|
- Specifies a state in a given country.
|
||||||
|
type: str
|
||||||
pool:
|
pool:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of GTM pool already defined in the configuration.
|
- Specifies the name of GTM pool already defined in the configuration.
|
||||||
|
type: str
|
||||||
datacenter:
|
datacenter:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of GTM data center already defined in the configuration.
|
- Specifies the name of GTM data center already defined in the configuration.
|
||||||
|
type: str
|
||||||
isp:
|
isp:
|
||||||
description:
|
description:
|
||||||
- Specifies an Internet service provider.
|
- Specifies an Internet service provider.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- AOL
|
- AOL
|
||||||
- BeijingCNC
|
- BeijingCNC
|
||||||
|
@ -82,16 +88,20 @@ options:
|
||||||
geo_isp:
|
geo_isp:
|
||||||
description:
|
description:
|
||||||
- Specifies a geolocation ISP
|
- Specifies a geolocation ISP
|
||||||
|
type: str
|
||||||
|
type: list
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
- Partition parameter is also taken into account when used in conjunction with C(pool), C(data_center),
|
- Partition parameter is also taken into account when used in conjunction with C(pool), C(data_center),
|
||||||
and C(region) parameters.
|
and C(region) parameters.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(state) is C(present), ensures that the region exists.
|
- When C(state) is C(present), ensures that the region exists.
|
||||||
- When C(state) is C(absent), ensures that the region is removed.
|
- When C(state) is C(absent), ensures that the region is removed.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
@ -152,26 +162,18 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import transform_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 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.common import transform_name
|
|
||||||
from library.module_utils.network.f5.common import flatten_boolean
|
from library.module_utils.network.f5.common import flatten_boolean
|
||||||
from library.module_utils.network.f5.compare import cmp_simple_list
|
from library.module_utils.network.f5.compare import cmp_simple_list
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import transform_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 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.common import transform_name
|
|
||||||
from ansible.module_utils.network.f5.common import flatten_boolean
|
from ansible.module_utils.network.f5.common import flatten_boolean
|
||||||
from ansible.module_utils.network.f5.compare import cmp_simple_list
|
from ansible.module_utils.network.f5.compare import cmp_simple_list
|
||||||
|
|
||||||
|
@ -489,12 +491,14 @@ class ModuleParameters(Parameters):
|
||||||
'Region members must be either type of string or list.'
|
'Region members must be either type of string or list.'
|
||||||
)
|
)
|
||||||
members = copy.deepcopy(self._values['region_members'])
|
members = copy.deepcopy(self._values['region_members'])
|
||||||
for member in members:
|
for item in members:
|
||||||
|
member = self._filter_params(item)
|
||||||
if 'negate' in member.keys():
|
if 'negate' in member.keys():
|
||||||
if len(member.keys()) > 2:
|
if len(member.keys()) > 2:
|
||||||
raise F5ModuleError(
|
raise F5ModuleError(
|
||||||
'You cannot specify negate and more than one option together.'
|
'You cannot specify negate and more than one option together.'
|
||||||
)
|
)
|
||||||
|
|
||||||
negate = self._flatten_negate(member)
|
negate = self._flatten_negate(member)
|
||||||
|
|
||||||
for key, value in iteritems(member):
|
for key, value in iteritems(member):
|
||||||
|
@ -586,7 +590,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
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.want = ModuleParameters(params=self.module.params)
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -815,7 +819,8 @@ class ArgumentSpec(object):
|
||||||
required=True
|
required=True
|
||||||
),
|
),
|
||||||
region_members=dict(
|
region_members=dict(
|
||||||
type='raw',
|
type='list',
|
||||||
|
elements='dict',
|
||||||
options=dict(
|
options=dict(
|
||||||
region=dict(),
|
region=dict(),
|
||||||
continent=dict(),
|
continent=dict(),
|
||||||
|
@ -855,16 +860,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -27,6 +27,7 @@ options:
|
||||||
for a wide IP.
|
for a wide IP.
|
||||||
- The C(round_robin) value is deprecated and will be removed in Ansible 2.9.
|
- The C(round_robin) value is deprecated and will be removed in Ansible 2.9.
|
||||||
- The C(global_availability) value is deprecated and will be removed in Ansible 2.9.
|
- The C(global_availability) value is deprecated and will be removed in Ansible 2.9.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
aliases: ['lb_method']
|
aliases: ['lb_method']
|
||||||
choices:
|
choices:
|
||||||
|
@ -42,6 +43,7 @@ options:
|
||||||
- Wide IP name. This name must be formatted as a fully qualified
|
- Wide IP name. This name must be formatted as a fully qualified
|
||||||
domain name (FQDN). You can also use the alias C(wide_ip) but this
|
domain name (FQDN). You can also use the alias C(wide_ip) but this
|
||||||
is deprecated and will be removed in a future Ansible version.
|
is deprecated and will be removed in a future Ansible version.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
aliases:
|
aliases:
|
||||||
- wide_ip
|
- wide_ip
|
||||||
|
@ -51,6 +53,7 @@ options:
|
||||||
type in addition to name, since pool members need different attributes
|
type in addition to name, since pool members need different attributes
|
||||||
depending on the response RDATA they are meant to supply. This value
|
depending on the response RDATA they are meant to supply. This value
|
||||||
is required if you are using BIG-IP versions >= 12.0.0.
|
is required if you are using BIG-IP versions >= 12.0.0.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- a
|
- a
|
||||||
- aaaa
|
- aaaa
|
||||||
|
@ -65,16 +68,18 @@ options:
|
||||||
is enabled.
|
is enabled.
|
||||||
- When C(absent), ensures that the Wide IP has been removed.
|
- When C(absent), ensures that the Wide IP has been removed.
|
||||||
- When C(disabled), ensures that the Wide IP exists and is disabled.
|
- When C(disabled), ensures that the Wide IP exists and is disabled.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
- disabled
|
- disabled
|
||||||
- enabled
|
- enabled
|
||||||
|
default: present
|
||||||
version_added: 2.4
|
version_added: 2.4
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
pools:
|
pools:
|
||||||
|
@ -82,21 +87,25 @@ options:
|
||||||
- The pools that you want associated with the Wide IP.
|
- The pools that you want associated with the Wide IP.
|
||||||
- If C(ratio) is not provided when creating a new Wide IP, it will default
|
- If C(ratio) is not provided when creating a new Wide IP, it will default
|
||||||
to 1.
|
to 1.
|
||||||
|
type: list
|
||||||
suboptions:
|
suboptions:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The name of the pool to include.
|
- The name of the pool to include.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
ratio:
|
ratio:
|
||||||
description:
|
description:
|
||||||
- Ratio for the pool.
|
- Ratio for the pool.
|
||||||
- The system uses this number with the Ratio load balancing method.
|
- The system uses this number with the Ratio load balancing method.
|
||||||
|
type: int
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
irules:
|
irules:
|
||||||
description:
|
description:
|
||||||
- List of rules to be applied.
|
- List of rules to be applied.
|
||||||
- If you want to remove all existing iRules, specify a single empty value; C("").
|
- If you want to remove all existing iRules, specify a single empty value; C("").
|
||||||
See the documentation for an example.
|
See the documentation for an example.
|
||||||
|
type: list
|
||||||
version_added: 2.6
|
version_added: 2.6
|
||||||
aliases:
|
aliases:
|
||||||
description:
|
description:
|
||||||
|
@ -104,6 +113,7 @@ options:
|
||||||
balancing.
|
balancing.
|
||||||
- You can use the same wildcard characters for aliases as you can for actual
|
- You can use the same wildcard characters for aliases as you can for actual
|
||||||
wide IP names.
|
wide IP names.
|
||||||
|
type: list
|
||||||
version_added: 2.7
|
version_added: 2.7
|
||||||
last_resort_pool:
|
last_resort_pool:
|
||||||
description:
|
description:
|
||||||
|
@ -111,6 +121,7 @@ options:
|
||||||
the wide IP.
|
the wide IP.
|
||||||
- The valid pools for this parameter are those with the C(type) specified in this
|
- The valid pools for this parameter are those with the C(type) specified in this
|
||||||
module.
|
module.
|
||||||
|
type: str
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
|
@ -211,12 +222,9 @@ try:
|
||||||
from library.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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.common import is_valid_fqdn
|
from library.module_utils.network.f5.common import is_valid_fqdn
|
||||||
from library.module_utils.network.f5.icontrol import tmos_version
|
from library.module_utils.network.f5.icontrol import tmos_version
|
||||||
from library.module_utils.network.f5.icontrol import module_provisioned
|
from library.module_utils.network.f5.icontrol import module_provisioned
|
||||||
|
@ -224,12 +232,9 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
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 F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
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 fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
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.common import is_valid_fqdn
|
from ansible.module_utils.network.f5.common import is_valid_fqdn
|
||||||
from ansible.module_utils.network.f5.icontrol import tmos_version
|
from ansible.module_utils.network.f5.icontrol import tmos_version
|
||||||
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
|
@ -560,7 +565,7 @@ class Difference(object):
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
self.module = kwargs.get('module', None)
|
||||||
self.client = kwargs.get('client', None)
|
self.client = F5RestClient(**self.module.params)
|
||||||
self.kwargs = kwargs
|
self.kwargs = kwargs
|
||||||
|
|
||||||
def exec_module(self):
|
def exec_module(self):
|
||||||
|
@ -591,7 +596,7 @@ class ModuleManager(object):
|
||||||
class BaseManager(object):
|
class BaseManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.module = kwargs.get('module', None)
|
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.want = ModuleParameters(params=self.module.params)
|
||||||
self.have = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -939,16 +944,12 @@ def main():
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
cleanup_tokens(client)
|
module.exit_json(**results)
|
||||||
exit_json(module, results, client)
|
|
||||||
except F5ModuleError as ex:
|
except F5ModuleError as ex:
|
||||||
cleanup_tokens(client)
|
module.fail_json(msg=str(ex))
|
||||||
fail_json(module, ex, client)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -134,11 +134,13 @@ class TestManager(unittest.TestCase):
|
||||||
|
|
||||||
def test_create_datacenter(self, *args):
|
def test_create_datacenter(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
name='foo',
|
||||||
state='present',
|
state='present',
|
||||||
password='admin',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
name='foo'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -158,11 +160,14 @@ class TestManager(unittest.TestCase):
|
||||||
|
|
||||||
def test_create_disabled_datacenter(self, *args):
|
def test_create_disabled_datacenter(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
name='foo',
|
||||||
state='disabled',
|
state='disabled',
|
||||||
password='admin',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
name='foo'
|
user='admin'
|
||||||
|
)
|
||||||
|
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -183,11 +188,14 @@ class TestManager(unittest.TestCase):
|
||||||
|
|
||||||
def test_create_enabled_datacenter(self, *args):
|
def test_create_enabled_datacenter(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
name='foo',
|
||||||
state='enabled',
|
state='enabled',
|
||||||
password='admin',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
name='foo'
|
user='admin'
|
||||||
|
)
|
||||||
|
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -208,11 +216,14 @@ class TestManager(unittest.TestCase):
|
||||||
|
|
||||||
def test_idempotent_disable_datacenter(self, *args):
|
def test_idempotent_disable_datacenter(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
name='foo',
|
||||||
state='disabled',
|
state='disabled',
|
||||||
password='admin',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
name='foo'
|
user='admin'
|
||||||
|
)
|
||||||
|
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -96,9 +96,11 @@ class TestManager(unittest.TestCase):
|
||||||
synchronization="yes",
|
synchronization="yes",
|
||||||
synchronization_group_name='foo',
|
synchronization_group_name='foo',
|
||||||
synchronize_zone_files="yes",
|
synchronize_zone_files="yes",
|
||||||
server='localhost',
|
provider=dict(
|
||||||
password='password',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_gtm_global_settings_general_1.json'))
|
current = ApiParameters(params=load_fixture('load_gtm_global_settings_general_1.json'))
|
||||||
|
|
|
@ -156,9 +156,11 @@ class TestManager(unittest.TestCase):
|
||||||
port=80,
|
port=80,
|
||||||
interval=20,
|
interval=20,
|
||||||
timeout=30,
|
timeout=30,
|
||||||
server='localhost',
|
provider=dict(
|
||||||
password='password',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -133,9 +133,11 @@ class TestManager(unittest.TestCase):
|
||||||
port=80,
|
port=80,
|
||||||
interval=20,
|
interval=20,
|
||||||
timeout=30,
|
timeout=30,
|
||||||
server='localhost',
|
provider=dict(
|
||||||
password='password',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -139,9 +139,11 @@ class TestManager(unittest.TestCase):
|
||||||
port=80,
|
port=80,
|
||||||
interval=20,
|
interval=20,
|
||||||
timeout=30,
|
timeout=30,
|
||||||
server='localhost',
|
provider=dict(
|
||||||
password='password',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -147,9 +147,11 @@ class TestManager(unittest.TestCase):
|
||||||
port=80,
|
port=80,
|
||||||
interval=20,
|
interval=20,
|
||||||
timeout=30,
|
timeout=30,
|
||||||
server='localhost',
|
provider=dict(
|
||||||
password='password',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -139,9 +139,11 @@ class TestManager(unittest.TestCase):
|
||||||
port=80,
|
port=80,
|
||||||
interval=20,
|
interval=20,
|
||||||
timeout=30,
|
timeout=30,
|
||||||
server='localhost',
|
provider=dict(
|
||||||
password='password',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -166,9 +168,11 @@ class TestManager(unittest.TestCase):
|
||||||
port=80,
|
port=80,
|
||||||
interval=20,
|
interval=20,
|
||||||
timeout=30,
|
timeout=30,
|
||||||
server='localhost',
|
provider=dict(
|
||||||
password='password',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_gtm_monitor_tcp_1.json'))
|
current = ApiParameters(params=load_fixture('load_gtm_monitor_tcp_1.json'))
|
||||||
|
@ -193,9 +197,11 @@ class TestManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='foo',
|
name='foo',
|
||||||
ignore_down_response=True,
|
ignore_down_response=True,
|
||||||
server='localhost',
|
provider=dict(
|
||||||
password='password',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_gtm_monitor_tcp_1.json'))
|
current = ApiParameters(params=load_fixture('load_gtm_monitor_tcp_1.json'))
|
||||||
|
|
|
@ -170,9 +170,11 @@ class TestManager(unittest.TestCase):
|
||||||
port=80,
|
port=80,
|
||||||
interval=20,
|
interval=20,
|
||||||
timeout=30,
|
timeout=30,
|
||||||
server='localhost',
|
provider=dict(
|
||||||
password='password',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -145,14 +145,17 @@ class TestUntypedManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='foo',
|
name='foo',
|
||||||
preferred_lb_method='round-robin',
|
preferred_lb_method='round-robin',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=self.spec.argument_spec,
|
argument_spec=self.spec.argument_spec,
|
||||||
supports_check_mode=self.spec.supports_check_mode
|
supports_check_mode=self.spec.supports_check_mode,
|
||||||
|
required_if=self.spec.required_if
|
||||||
)
|
)
|
||||||
|
|
||||||
# Override methods in the specific type of manager
|
# Override methods in the specific type of manager
|
||||||
|
@ -178,14 +181,17 @@ class TestUntypedManager(unittest.TestCase):
|
||||||
preferred_lb_method='topology',
|
preferred_lb_method='topology',
|
||||||
alternate_lb_method='drop-packet',
|
alternate_lb_method='drop-packet',
|
||||||
fallback_lb_method='cpu',
|
fallback_lb_method='cpu',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=self.spec.argument_spec,
|
argument_spec=self.spec.argument_spec,
|
||||||
supports_check_mode=self.spec.supports_check_mode
|
supports_check_mode=self.spec.supports_check_mode,
|
||||||
|
required_if=self.spec.required_if
|
||||||
)
|
)
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_gtm_pool_untyped_default.json'))
|
current = ApiParameters(params=load_fixture('load_gtm_pool_untyped_default.json'))
|
||||||
|
@ -214,14 +220,17 @@ class TestUntypedManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='foo',
|
name='foo',
|
||||||
state='absent',
|
state='absent',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=self.spec.argument_spec,
|
argument_spec=self.spec.argument_spec,
|
||||||
supports_check_mode=self.spec.supports_check_mode
|
supports_check_mode=self.spec.supports_check_mode,
|
||||||
|
required_if=self.spec.required_if
|
||||||
)
|
)
|
||||||
|
|
||||||
# Override methods in the specific type of manager
|
# Override methods in the specific type of manager
|
||||||
|
@ -263,14 +272,17 @@ class TestTypedManager(unittest.TestCase):
|
||||||
name='foo',
|
name='foo',
|
||||||
preferred_lb_method='round-robin',
|
preferred_lb_method='round-robin',
|
||||||
type='a',
|
type='a',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=self.spec.argument_spec,
|
argument_spec=self.spec.argument_spec,
|
||||||
supports_check_mode=self.spec.supports_check_mode
|
supports_check_mode=self.spec.supports_check_mode,
|
||||||
|
required_if=self.spec.required_if
|
||||||
)
|
)
|
||||||
|
|
||||||
# Override methods in the specific type of manager
|
# Override methods in the specific type of manager
|
||||||
|
@ -297,14 +309,17 @@ class TestTypedManager(unittest.TestCase):
|
||||||
alternate_lb_method='drop-packet',
|
alternate_lb_method='drop-packet',
|
||||||
fallback_lb_method='cpu',
|
fallback_lb_method='cpu',
|
||||||
type='a',
|
type='a',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=self.spec.argument_spec,
|
argument_spec=self.spec.argument_spec,
|
||||||
supports_check_mode=self.spec.supports_check_mode
|
supports_check_mode=self.spec.supports_check_mode,
|
||||||
|
required_if=self.spec.required_if
|
||||||
)
|
)
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_gtm_pool_a_default.json'))
|
current = ApiParameters(params=load_fixture('load_gtm_pool_a_default.json'))
|
||||||
|
@ -334,14 +349,17 @@ class TestTypedManager(unittest.TestCase):
|
||||||
name='foo',
|
name='foo',
|
||||||
type='a',
|
type='a',
|
||||||
state='absent',
|
state='absent',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=self.spec.argument_spec,
|
argument_spec=self.spec.argument_spec,
|
||||||
supports_check_mode=self.spec.supports_check_mode
|
supports_check_mode=self.spec.supports_check_mode,
|
||||||
|
required_if=self.spec.required_if
|
||||||
)
|
)
|
||||||
|
|
||||||
# Override methods in the specific type of manager
|
# Override methods in the specific type of manager
|
||||||
|
|
|
@ -164,9 +164,6 @@ class TestV1Manager(unittest.TestCase):
|
||||||
|
|
||||||
def test_create(self, *args):
|
def test_create(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
server='lb.mydomain.com',
|
|
||||||
user='admin',
|
|
||||||
password='secret',
|
|
||||||
name='GTM_Server',
|
name='GTM_Server',
|
||||||
datacenter='/Common/New York',
|
datacenter='/Common/New York',
|
||||||
server_type='bigip',
|
server_type='bigip',
|
||||||
|
@ -209,7 +206,12 @@ class TestV1Manager(unittest.TestCase):
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
],
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -265,9 +267,6 @@ class TestV2Manager(unittest.TestCase):
|
||||||
|
|
||||||
def test_create(self, *args):
|
def test_create(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
server='lb.mydomain.com',
|
|
||||||
user='admin',
|
|
||||||
password='secret',
|
|
||||||
name='GTM_Server',
|
name='GTM_Server',
|
||||||
datacenter='/Common/New York',
|
datacenter='/Common/New York',
|
||||||
server_type='bigip',
|
server_type='bigip',
|
||||||
|
@ -310,7 +309,12 @@ class TestV2Manager(unittest.TestCase):
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
],
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -111,7 +111,12 @@ class TestManager(unittest.TestCase):
|
||||||
destination=dict(
|
destination=dict(
|
||||||
region='Foobar',
|
region='Foobar',
|
||||||
),
|
),
|
||||||
weight=10
|
weight=10,
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -110,7 +110,7 @@ class TestManager(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.spec = ArgumentSpec()
|
self.spec = ArgumentSpec()
|
||||||
|
|
||||||
def test_create_topology_record(self, *args):
|
def test_create_topology_region(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='foobar',
|
name='foobar',
|
||||||
region_members=[
|
region_members=[
|
||||||
|
@ -122,7 +122,12 @@ class TestManager(unittest.TestCase):
|
||||||
datacenter='bazcenter'
|
datacenter='bazcenter'
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
partition='Common'
|
partition='Common',
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -133,7 +138,7 @@ class TestManager(unittest.TestCase):
|
||||||
|
|
||||||
# Override methods in the specific type of manager
|
# Override methods in the specific type of manager
|
||||||
mm = ModuleManager(module=module)
|
mm = ModuleManager(module=module)
|
||||||
mm.exists = Mock(side_effect=[False, True])
|
mm.exists = Mock(return_value=False)
|
||||||
mm.create_on_device = Mock(return_value=True)
|
mm.create_on_device = Mock(return_value=True)
|
||||||
|
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
|
|
|
@ -143,9 +143,11 @@ class TestUntypedManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='foo.baz.bar',
|
name='foo.baz.bar',
|
||||||
lb_method='round-robin',
|
lb_method='round-robin',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -192,9 +194,11 @@ class TestTypedManager(unittest.TestCase):
|
||||||
name='foo.baz.bar',
|
name='foo.baz.bar',
|
||||||
lb_method='round-robin',
|
lb_method='round-robin',
|
||||||
type='a',
|
type='a',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -224,9 +228,11 @@ class TestTypedManager(unittest.TestCase):
|
||||||
name='foo.baz.bar',
|
name='foo.baz.bar',
|
||||||
lb_method='round_robin',
|
lb_method='round_robin',
|
||||||
type='a',
|
type='a',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -256,9 +262,11 @@ class TestTypedManager(unittest.TestCase):
|
||||||
name='foo.baz.bar',
|
name='foo.baz.bar',
|
||||||
lb_method='global_availability',
|
lb_method='global_availability',
|
||||||
type='a',
|
type='a',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -294,9 +302,11 @@ class TestTypedManager(unittest.TestCase):
|
||||||
ratio=10
|
ratio=10
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -332,9 +342,11 @@ class TestTypedManager(unittest.TestCase):
|
||||||
ratio=10
|
ratio=10
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_gtm_wide_ip_with_pools.json'))
|
current = ApiParameters(params=load_fixture('load_gtm_wide_ip_with_pools.json'))
|
||||||
|
@ -372,9 +384,11 @@ class TestTypedManager(unittest.TestCase):
|
||||||
ratio=100
|
ratio=100
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin'
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_gtm_wide_ip_with_pools.json'))
|
current = ApiParameters(params=load_fixture('load_gtm_wide_ip_with_pools.json'))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue