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 (#53983)
Adds variable types to docs Refactors unit tests to remove deprecated parameters
This commit is contained in:
parent
348b6e7da9
commit
648ac17be3
40 changed files with 497 additions and 470 deletions
|
@ -27,35 +27,39 @@ options:
|
||||||
filename:
|
filename:
|
||||||
description:
|
description:
|
||||||
- Name of the qkview to create on the remote BIG-IP.
|
- Name of the qkview to create on the remote BIG-IP.
|
||||||
|
type: str
|
||||||
default: "localhost.localdomain.qkview"
|
default: "localhost.localdomain.qkview"
|
||||||
dest:
|
dest:
|
||||||
description:
|
description:
|
||||||
- Destination on your local filesystem when you want to save the qkview.
|
- Destination on your local filesystem when you want to save the qkview.
|
||||||
|
type: path
|
||||||
required: True
|
required: True
|
||||||
asm_request_log:
|
asm_request_log:
|
||||||
description:
|
description:
|
||||||
- When C(True), includes the ASM request log data. When C(False),
|
- When C(True), includes the ASM request log data. When C(False),
|
||||||
excludes the ASM request log data.
|
excludes the ASM request log data.
|
||||||
default: no
|
|
||||||
type: bool
|
type: bool
|
||||||
|
default: no
|
||||||
max_file_size:
|
max_file_size:
|
||||||
description:
|
description:
|
||||||
- Max file size, in bytes, of the qkview to create. By default, no max
|
- Max file size, in bytes, of the qkview to create. By default, no max
|
||||||
file size is specified.
|
file size is specified.
|
||||||
|
type: int
|
||||||
default: 0
|
default: 0
|
||||||
complete_information:
|
complete_information:
|
||||||
description:
|
description:
|
||||||
- Include complete information in the qkview.
|
- Include complete information in the qkview.
|
||||||
default: no
|
|
||||||
type: bool
|
type: bool
|
||||||
|
default: no
|
||||||
exclude_core:
|
exclude_core:
|
||||||
description:
|
description:
|
||||||
- Exclude core files from the qkview.
|
- Exclude core files from the qkview.
|
||||||
default: no
|
|
||||||
type: bool
|
type: bool
|
||||||
|
default: no
|
||||||
exclude:
|
exclude:
|
||||||
description:
|
description:
|
||||||
- Exclude various file from the qkview.
|
- Exclude various file from the qkview.
|
||||||
|
type: list
|
||||||
choices:
|
choices:
|
||||||
- all
|
- all
|
||||||
- audit
|
- audit
|
||||||
|
@ -65,8 +69,8 @@ options:
|
||||||
description:
|
description:
|
||||||
- If C(no), the file will only be transferred if the destination does not
|
- If C(no), the file will only be transferred if the destination does not
|
||||||
exist.
|
exist.
|
||||||
default: yes
|
|
||||||
type: bool
|
type: bool
|
||||||
|
default: yes
|
||||||
notes:
|
notes:
|
||||||
- This module does not include the "max time" or "restrict to blade" options.
|
- This module does not include the "max time" or "restrict to blade" options.
|
||||||
- If you are using this module with either Ansible Tower or Ansible AWX, you
|
- If you are using this module with either Ansible Tower or Ansible AWX, you
|
||||||
|
@ -115,20 +119,14 @@ 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 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.icontrol import download_file
|
from library.module_utils.network.f5.icontrol import download_file
|
||||||
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 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.icontrol import download_file
|
from ansible.module_utils.network.f5.icontrol import download_file
|
||||||
|
|
||||||
|
@ -220,7 +218,7 @@ class Parameters(AnsibleF5Parameters):
|
||||||
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):
|
||||||
|
@ -256,7 +254,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 = Parameters(params=self.module.params)
|
self.want = Parameters(params=self.module.params)
|
||||||
self.changes = Parameters()
|
self.changes = Parameters()
|
||||||
|
@ -595,16 +593,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:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of the remote role.
|
- Specifies the name of the remote role.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
line_order:
|
line_order:
|
||||||
description:
|
description:
|
||||||
|
@ -35,11 +36,13 @@ options:
|
||||||
you set the first line at 1000. This allows you, in the future, to insert
|
you set the first line at 1000. This allows you, in the future, to insert
|
||||||
lines before the first line.
|
lines before the first line.
|
||||||
- When creating a new remote role, this parameter is required.
|
- When creating a new remote role, this parameter is required.
|
||||||
|
type: int
|
||||||
attribute_string:
|
attribute_string:
|
||||||
description:
|
description:
|
||||||
- Specifies the user account attributes saved in the group, in the format
|
- Specifies the user account attributes saved in the group, in the format
|
||||||
C(cn=, ou=, dc=).
|
C(cn=, ou=, dc=).
|
||||||
- When creating a new remote role, this parameter is required.
|
- When creating a new remote role, this parameter is required.
|
||||||
|
type: str
|
||||||
remote_access:
|
remote_access:
|
||||||
description:
|
description:
|
||||||
- Enables or disables remote access for the specified group of remotely
|
- Enables or disables remote access for the specified group of remotely
|
||||||
|
@ -61,6 +64,7 @@ options:
|
||||||
C(operator), C(application-editor), C(manager), C(certificate-manager),
|
C(operator), C(application-editor), C(manager), C(certificate-manager),
|
||||||
C(irule-manager), C(user-manager), C(resource-administrator), C(auditor),
|
C(irule-manager), C(user-manager), C(resource-administrator), C(auditor),
|
||||||
C(administrator), C(firewall-manager).
|
C(administrator), C(firewall-manager).
|
||||||
|
type: str
|
||||||
partition_access:
|
partition_access:
|
||||||
description:
|
description:
|
||||||
- Specifies the accessible partitions for the account.
|
- Specifies the accessible partitions for the account.
|
||||||
|
@ -70,6 +74,7 @@ options:
|
||||||
as determined by the permissions conferred by the user's C(assigned_role).
|
as determined by the permissions conferred by the user's C(assigned_role).
|
||||||
- When creating a new remote role, if this parameter is not specified, the default
|
- When creating a new remote role, if this parameter is not specified, the default
|
||||||
is C(all).
|
is C(all).
|
||||||
|
type: str
|
||||||
terminal_access:
|
terminal_access:
|
||||||
description:
|
description:
|
||||||
- Specifies terminal-based accessibility for remote accounts not already
|
- Specifies terminal-based accessibility for remote accounts not already
|
||||||
|
@ -78,14 +83,16 @@ options:
|
||||||
may also be specified.
|
may also be specified.
|
||||||
- When creating a new remote role, if this parameter is not specified, the default
|
- When creating a new remote role, if this parameter is not specified, the default
|
||||||
is C(none).
|
is C(none).
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), guarantees that the remote role exists.
|
- When C(present), guarantees that the remote role exists.
|
||||||
- When C(absent), removes the remote role from the system.
|
- When C(absent), removes the remote role from the system.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
|
default: present
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -150,20 +157,14 @@ 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 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 flatten_boolean
|
from library.module_utils.network.f5.common import flatten_boolean
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
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 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 flatten_boolean
|
from ansible.module_utils.network.f5.common import flatten_boolean
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
|
|
||||||
|
@ -314,7 +315,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()
|
||||||
|
@ -540,16 +541,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,22 +23,27 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The name of the route domain.
|
- The name of the route domain.
|
||||||
|
type: str
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
bwc_policy:
|
bwc_policy:
|
||||||
description:
|
description:
|
||||||
- The bandwidth controller for the route domain.
|
- The bandwidth controller for the route domain.
|
||||||
|
type: str
|
||||||
connection_limit:
|
connection_limit:
|
||||||
description:
|
description:
|
||||||
- The maximum number of concurrent connections allowed for the
|
- The maximum number of concurrent connections allowed for the
|
||||||
route domain. Setting this to C(0) turns off connection limits.
|
route domain. Setting this to C(0) turns off connection limits.
|
||||||
|
type: int
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- Specifies descriptive text that identifies the route domain.
|
- Specifies descriptive text that identifies the route domain.
|
||||||
|
type: str
|
||||||
flow_eviction_policy:
|
flow_eviction_policy:
|
||||||
description:
|
description:
|
||||||
- The eviction policy to use with this route domain. Apply an eviction
|
- The eviction policy to use with this route domain. Apply an eviction
|
||||||
policy to provide customized responses to flow overflows and slow
|
policy to provide customized responses to flow overflows and slow
|
||||||
flows on the route domain.
|
flows on the route domain.
|
||||||
|
type: str
|
||||||
id:
|
id:
|
||||||
description:
|
description:
|
||||||
- The unique identifying integer representing the route domain.
|
- The unique identifying integer representing the route domain.
|
||||||
|
@ -47,19 +52,23 @@ options:
|
||||||
making modifications to it (for instance during update and delete operations).
|
making modifications to it (for instance during update and delete operations).
|
||||||
Instead, the C(name) parameter is used. In version 2.6, the C(name) value will
|
Instead, the C(name) parameter is used. In version 2.6, the C(name) value will
|
||||||
become a required parameter.
|
become a required parameter.
|
||||||
|
type: int
|
||||||
parent:
|
parent:
|
||||||
description:
|
description:
|
||||||
- Specifies the route domain the system searches when it cannot
|
- Specifies the route domain the system searches when it cannot
|
||||||
find a route in the configured domain.
|
find a route in the configured domain.
|
||||||
|
type: str
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Partition to create the route domain on. Partitions cannot be updated
|
- Partition to create the route domain on. Partitions cannot be updated
|
||||||
once they are created.
|
once they are created.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
routing_protocol:
|
routing_protocol:
|
||||||
description:
|
description:
|
||||||
- Dynamic routing protocols for the system to use in the route domain.
|
- Dynamic routing protocols for the system to use in the route domain.
|
||||||
|
type: list
|
||||||
choices:
|
choices:
|
||||||
- none
|
- none
|
||||||
- BFD
|
- BFD
|
||||||
|
@ -73,13 +82,15 @@ options:
|
||||||
service_policy:
|
service_policy:
|
||||||
description:
|
description:
|
||||||
- Service policy to associate with the route domain.
|
- Service policy to associate with the route domain.
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether the route domain should exist or not.
|
- Whether the route domain should exist or not.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
strict:
|
strict:
|
||||||
description:
|
description:
|
||||||
- Specifies whether the system enforces cross-routing restrictions or not.
|
- Specifies whether the system enforces cross-routing restrictions or not.
|
||||||
|
@ -87,9 +98,11 @@ options:
|
||||||
vlans:
|
vlans:
|
||||||
description:
|
description:
|
||||||
- VLANs for the system to use in the route domain.
|
- VLANs for the system to use in the route domain.
|
||||||
|
type: list
|
||||||
fw_enforced_policy:
|
fw_enforced_policy:
|
||||||
description:
|
description:
|
||||||
- Specifies AFM policy to be attached to route domain.
|
- Specifies AFM policy to be attached to route domain.
|
||||||
|
type: str
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
|
@ -188,23 +201,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 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.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.compare import cmp_simple_list
|
from ansible.module_utils.network.f5.compare import cmp_simple_list
|
||||||
|
|
||||||
|
|
||||||
|
@ -450,7 +457,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, client=self.client)
|
self.want = ModuleParameters(params=self.module.params, client=self.client)
|
||||||
self.have = ApiParameters(client=self.client)
|
self.have = ApiParameters(client=self.client)
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -708,19 +715,16 @@ 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_one_of=spec.required_one_of
|
||||||
)
|
)
|
||||||
|
|
||||||
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__':
|
||||||
|
|
|
@ -25,50 +25,59 @@ options:
|
||||||
- The IP addresses for the new self IP. This value is ignored upon update
|
- The IP addresses for the new self IP. This value is ignored upon update
|
||||||
as addresses themselves cannot be changed after they are created.
|
as addresses themselves cannot be changed after they are created.
|
||||||
- This value is required when creating new self IPs.
|
- This value is required when creating new self IPs.
|
||||||
|
type: str
|
||||||
allow_service:
|
allow_service:
|
||||||
description:
|
description:
|
||||||
- Configure port lockdown for the Self IP. By default, the Self IP has a
|
- Configure port lockdown for the Self IP. By default, the Self IP has a
|
||||||
"default deny" policy. This can be changed to allow TCP and UDP ports
|
"default deny" policy. This can be changed to allow TCP and UDP ports
|
||||||
as well as specific protocols. This list should contain C(protocol):C(port)
|
as well as specific protocols. This list should contain C(protocol):C(port)
|
||||||
values.
|
values.
|
||||||
|
type: list
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The self IP to create.
|
- The self IP to create.
|
||||||
- If this parameter is not specified, then it will default to the value supplied
|
- If this parameter is not specified, then it will default to the value supplied
|
||||||
in the C(address) parameter.
|
in the C(address) parameter.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- Description of the traffic selector.
|
- Description of the traffic selector.
|
||||||
|
type: str
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
netmask:
|
netmask:
|
||||||
description:
|
description:
|
||||||
- The netmask for the self IP. When creating a new Self IP, this value
|
- The netmask for the self IP. When creating a new Self IP, this value
|
||||||
is required.
|
is required.
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), guarantees that the Self-IP exists with the provided
|
- When C(present), guarantees that the Self-IP exists with the provided
|
||||||
attributes.
|
attributes.
|
||||||
- When C(absent), removes the Self-IP from the system.
|
- When C(absent), removes the Self-IP from the system.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
|
default: present
|
||||||
traffic_group:
|
traffic_group:
|
||||||
description:
|
description:
|
||||||
- The traffic group for the Self IP addresses in an active-active,
|
- The traffic group for the Self IP addresses in an active-active,
|
||||||
redundant load balancer configuration. When creating a new Self IP, if
|
redundant load balancer configuration. When creating a new Self IP, if
|
||||||
this value is not specified, the default of C(/Common/traffic-group-local-only)
|
this value is not specified, the default of C(/Common/traffic-group-local-only)
|
||||||
will be used.
|
will be used.
|
||||||
|
type: str
|
||||||
vlan:
|
vlan:
|
||||||
description:
|
description:
|
||||||
- The VLAN that the new self IPs will be on. When creating a new Self
|
- The VLAN that the new self IPs will be on. When creating a new Self
|
||||||
IP, this value is required.
|
IP, this value is required.
|
||||||
|
type: str
|
||||||
route_domain:
|
route_domain:
|
||||||
description:
|
description:
|
||||||
- The route domain id of the system. When creating a new Self IP, if
|
- The route domain id of the system. When creating a new Self IP, if
|
||||||
this value is not specified, a default value of C(0) will be used.
|
this value is not specified, a default value of C(0) will be used.
|
||||||
- This value cannot be changed after it is set.
|
- This value cannot be changed after it is set.
|
||||||
|
type: int
|
||||||
version_added: 2.3
|
version_added: 2.3
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
|
@ -76,6 +85,7 @@ options:
|
||||||
for Self IPs, but the address used may not match any other address used
|
for Self IPs, but the address used may not match any other address used
|
||||||
by a Self IP. In that sense, Self IPs are not isolated by partitions as
|
by a Self IP. In that sense, Self IPs are not isolated by partitions as
|
||||||
other resources on a BIG-IP are.
|
other resources on a BIG-IP are.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
|
@ -226,12 +236,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.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
from library.module_utils.network.f5.ipaddress import ipv6_netmask_to_cidr
|
from library.module_utils.network.f5.ipaddress import ipv6_netmask_to_cidr
|
||||||
from library.module_utils.compat.ipaddress import ip_address
|
from library.module_utils.compat.ipaddress import ip_address
|
||||||
|
@ -242,12 +249,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.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
from ansible.module_utils.network.f5.ipaddress import ipv6_netmask_to_cidr
|
from ansible.module_utils.network.f5.ipaddress import ipv6_netmask_to_cidr
|
||||||
from ansible.module_utils.compat.ipaddress import ip_address
|
from ansible.module_utils.compat.ipaddress import ip_address
|
||||||
|
@ -575,7 +579,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()
|
||||||
|
@ -837,16 +841,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__':
|
||||||
|
|
|
@ -25,27 +25,33 @@ options:
|
||||||
description:
|
description:
|
||||||
- Name of the service policy.
|
- Name of the service policy.
|
||||||
required: True
|
required: True
|
||||||
|
type: str
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- Description of the service policy.
|
- Description of the service policy.
|
||||||
|
type: str
|
||||||
timer_policy:
|
timer_policy:
|
||||||
description:
|
description:
|
||||||
- The timer policy to attach to the service policy.
|
- The timer policy to attach to the service policy.
|
||||||
|
type: str
|
||||||
port_misuse_policy:
|
port_misuse_policy:
|
||||||
description:
|
description:
|
||||||
- The port misuse policy to attach to the service policy.
|
- The port misuse policy to attach to the service policy.
|
||||||
- Requires that C(afm) be provisioned to use. If C(afm) is not provisioned, this parameter
|
- Requires that C(afm) be provisioned to use. If C(afm) is not provisioned, this parameter
|
||||||
will be ignored.
|
will be ignored.
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether the resource should exist or not.
|
- Whether the resource should exist or not.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
|
@ -94,22 +100,16 @@ 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 f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
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 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.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 f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
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 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.icontrol import module_provisioned
|
from ansible.module_utils.network.f5.icontrol import module_provisioned
|
||||||
|
|
||||||
|
@ -206,7 +206,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()
|
||||||
|
@ -428,16 +428,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,33 +24,39 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of the SMTP server configuration.
|
- Specifies the name of the SMTP server configuration.
|
||||||
|
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
|
||||||
smtp_server:
|
smtp_server:
|
||||||
description:
|
description:
|
||||||
- SMTP server host name in the format of a fully qualified domain name.
|
- SMTP server host name in the format of a fully qualified domain name.
|
||||||
- This value is required when create a new SMTP configuration.
|
- This value is required when create a new SMTP configuration.
|
||||||
|
type: str
|
||||||
smtp_server_port:
|
smtp_server_port:
|
||||||
description:
|
description:
|
||||||
- Specifies the SMTP port number.
|
- Specifies the SMTP port number.
|
||||||
- When creating a new SMTP configuration, the default is C(25) when
|
- When creating a new SMTP configuration, the default is C(25) when
|
||||||
C(encryption) is C(none) or C(tls). The default is C(465) when C(ssl)
|
C(encryption) is C(none) or C(tls). The default is C(465) when C(ssl) is selected.
|
||||||
is selected.
|
type: int
|
||||||
local_host_name:
|
local_host_name:
|
||||||
description:
|
description:
|
||||||
- Host name used in SMTP headers in the format of a fully qualified
|
- Host name used in SMTP headers in the format of a fully qualified
|
||||||
domain name. This setting does not refer to the BIG-IP system's hostname.
|
domain name. This setting does not refer to the BIG-IP system's hostname.
|
||||||
|
type: str
|
||||||
from_address:
|
from_address:
|
||||||
description:
|
description:
|
||||||
- Email address that the email is being sent from. This is the "Reply-to"
|
- Email address that the email is being sent from. This is the "Reply-to"
|
||||||
address that the recipient sees.
|
address that the recipient sees.
|
||||||
|
type: str
|
||||||
encryption:
|
encryption:
|
||||||
description:
|
description:
|
||||||
- Specifies whether the SMTP server requires an encrypted connection in
|
- Specifies whether the SMTP server requires an encrypted connection in
|
||||||
order to send mail.
|
order to send mail.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- none
|
- none
|
||||||
- ssl
|
- ssl
|
||||||
|
@ -67,17 +73,20 @@ options:
|
||||||
smtp_server_username:
|
smtp_server_username:
|
||||||
description:
|
description:
|
||||||
- User name that the SMTP server requires when validating a user.
|
- User name that the SMTP server requires when validating a user.
|
||||||
|
type: str
|
||||||
smtp_server_password:
|
smtp_server_password:
|
||||||
description:
|
description:
|
||||||
- Password that the SMTP server requires when validating a user.
|
- Password that the SMTP server requires when validating a user.
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the SMTP configuration exists.
|
- When C(present), ensures that the SMTP configuration exists.
|
||||||
- When C(absent), ensures that the SMTP configuration does not exist.
|
- When C(absent), ensures that the SMTP configuration does not exist.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
update_password:
|
update_password:
|
||||||
description:
|
description:
|
||||||
- Passwords are stored encrypted, so the module cannot know if the supplied
|
- Passwords are stored encrypted, so the module cannot know if the supplied
|
||||||
|
@ -87,10 +96,11 @@ options:
|
||||||
- When C(always), will always update the password.
|
- When C(always), will always update the password.
|
||||||
- When C(on_create), will only set the password for newly created SMTP server
|
- When C(on_create), will only set the password for newly created SMTP server
|
||||||
configurations.
|
configurations.
|
||||||
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)
|
||||||
|
@ -153,10 +163,7 @@ 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 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 is_valid_hostname
|
from library.module_utils.network.f5.common import is_valid_hostname
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
@ -164,10 +171,7 @@ 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 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 is_valid_hostname
|
from ansible.module_utils.network.f5.common import is_valid_hostname
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
@ -332,7 +336,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()
|
||||||
|
@ -552,16 +556,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,21 +24,26 @@ options:
|
||||||
description:
|
description:
|
||||||
- List of members to put in the SNAT pool. When a C(state) of present is
|
- List of members to put in the SNAT pool. When a C(state) of present is
|
||||||
provided, this parameter is required. Otherwise, it is optional.
|
provided, this parameter is required. Otherwise, it is optional.
|
||||||
|
type: list
|
||||||
aliases:
|
aliases:
|
||||||
- member
|
- member
|
||||||
name:
|
name:
|
||||||
description: The name of the SNAT pool.
|
description:
|
||||||
|
- The name of the SNAT pool.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether the SNAT pool should exist or not.
|
- Whether the SNAT pool should exist or not.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
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
|
||||||
|
@ -101,23 +106,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.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.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
|
||||||
|
|
||||||
|
@ -221,7 +220,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()
|
||||||
|
@ -443,16 +442,12 @@ def main():
|
||||||
required_if=spec.required_if
|
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,16 +29,19 @@ options:
|
||||||
to the system's default of C(127.0.0.0/8).
|
to the system's default of C(127.0.0.0/8).
|
||||||
- You can remove all allowed addresses by either providing the word C(none), or
|
- You can remove all allowed addresses by either providing the word C(none), or
|
||||||
by providing the empty string C("").
|
by providing the empty string C("").
|
||||||
|
type: raw
|
||||||
version_added: 2.6
|
version_added: 2.6
|
||||||
contact:
|
contact:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of the person who administers the SNMP
|
- Specifies the name of the person who administers the SNMP
|
||||||
service for this system.
|
service for this system.
|
||||||
|
type: str
|
||||||
agent_status_traps:
|
agent_status_traps:
|
||||||
description:
|
description:
|
||||||
- When C(enabled), ensures that the system sends a trap whenever the
|
- When C(enabled), ensures that the system sends a trap whenever the
|
||||||
SNMP agent starts running or stops running. This is usually enabled
|
SNMP agent starts running or stops running. This is usually enabled
|
||||||
by default on a BIG-IP.
|
by default on a BIG-IP.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- enabled
|
- enabled
|
||||||
- disabled
|
- disabled
|
||||||
|
@ -47,6 +50,7 @@ options:
|
||||||
- When C(enabled), ensures that the system sends authentication warning
|
- When C(enabled), ensures that the system sends authentication warning
|
||||||
traps to the trap destinations. This is usually disabled by default on
|
traps to the trap destinations. This is usually disabled by default on
|
||||||
a BIG-IP.
|
a BIG-IP.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- enabled
|
- enabled
|
||||||
- disabled
|
- disabled
|
||||||
|
@ -55,12 +59,14 @@ options:
|
||||||
- When C(enabled), ensures that the system sends device warning traps
|
- When C(enabled), ensures that the system sends device warning traps
|
||||||
to the trap destinations. This is usually enabled by default on a
|
to the trap destinations. This is usually enabled by default on a
|
||||||
BIG-IP.
|
BIG-IP.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- enabled
|
- enabled
|
||||||
- disabled
|
- disabled
|
||||||
location:
|
location:
|
||||||
description:
|
description:
|
||||||
- Specifies the description of this system's physical location.
|
- Specifies the description of this system's physical location.
|
||||||
|
type: str
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -127,22 +133,16 @@ 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 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.compat.ipaddress import ip_network
|
from library.module_utils.compat.ipaddress import ip_network
|
||||||
from library.module_utils.network.f5.common import is_valid_hostname
|
from library.module_utils.network.f5.common import is_valid_hostname
|
||||||
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 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.compat.ipaddress import ip_network
|
from ansible.module_utils.compat.ipaddress import ip_network
|
||||||
from ansible.module_utils.network.f5.common import is_valid_hostname
|
from ansible.module_utils.network.f5.common import is_valid_hostname
|
||||||
|
|
||||||
|
@ -287,7 +287,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 = ApiParameters()
|
self.have = ApiParameters()
|
||||||
self.want = ModuleParameters(params=self.module.params)
|
self.want = ModuleParameters(params=self.module.params)
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -413,16 +413,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,14 +27,19 @@ options:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the address list and entries exists.
|
- When C(present), ensures that the address list and entries exists.
|
||||||
- When C(absent), ensures the address list is removed.
|
- When C(absent), ensures the address list is removed.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
version:
|
version:
|
||||||
description:
|
description:
|
||||||
- Specifies to which Simple Network Management Protocol (SNMP) version the trap destination applies.
|
- Specifies to which Simple Network Management Protocol (SNMP) version the trap destination applies.
|
||||||
choices: ['v1', 'v2c', 'v3']
|
type: str
|
||||||
|
choices:
|
||||||
|
- v1
|
||||||
|
- v2c
|
||||||
|
- v3
|
||||||
default: v2c
|
default: v2c
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
|
@ -42,11 +47,13 @@ options:
|
||||||
- When C(version) is C(v1) or C(v2c), this parameter is required.
|
- When C(version) is C(v1) or C(v2c), this parameter is required.
|
||||||
- The name C(public) is a reserved name on the BIG-IP. This module handles that name differently
|
- The name C(public) is a reserved name on the BIG-IP. This module handles that name differently
|
||||||
than others. Functionally, you should not see a difference however.
|
than others. Functionally, you should not see a difference however.
|
||||||
|
type: str
|
||||||
community:
|
community:
|
||||||
description:
|
description:
|
||||||
- Specifies the community string (password) for access to the MIB.
|
- Specifies the community string (password) for access to the MIB.
|
||||||
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
||||||
something else, this parameter is ignored.
|
something else, this parameter is ignored.
|
||||||
|
type: str
|
||||||
source:
|
source:
|
||||||
description:
|
description:
|
||||||
- Specifies the source address for access to the MIB.
|
- Specifies the source address for access to the MIB.
|
||||||
|
@ -59,23 +66,27 @@ options:
|
||||||
- This parameter should be provided when C(state) is C(absent), so that the correct community
|
- This parameter should be provided when C(state) is C(absent), so that the correct community
|
||||||
is removed. To remove the C(public) SNMP community that comes with a BIG-IP, this parameter
|
is removed. To remove the C(public) SNMP community that comes with a BIG-IP, this parameter
|
||||||
should be set to C(default).
|
should be set to C(default).
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Specifies the port for the trap destination.
|
- Specifies the port for the trap destination.
|
||||||
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
||||||
something else, this parameter is ignored.
|
something else, this parameter is ignored.
|
||||||
|
type: int
|
||||||
oid:
|
oid:
|
||||||
description:
|
description:
|
||||||
- Specifies the object identifier (OID) for the record.
|
- Specifies the object identifier (OID) for the record.
|
||||||
- When C(version) is C(v3), this parameter is required.
|
- When C(version) is C(v3), this parameter is required.
|
||||||
- When C(version) is either C(v1) or C(v2c), if this value is specified, then C(source)
|
- When C(version) is either C(v1) or C(v2c), if this value is specified, then C(source)
|
||||||
must not be set to C(all).
|
must not be set to C(all).
|
||||||
|
type: str
|
||||||
access:
|
access:
|
||||||
description:
|
description:
|
||||||
- Specifies the user's access level to the MIB.
|
- Specifies the user's access level to the MIB.
|
||||||
- When creating a new community, if this parameter is not specified, the default is C(ro).
|
- When creating a new community, if this parameter is not specified, the default is C(ro).
|
||||||
- When C(ro), specifies that the user can view the MIB, but cannot modify the MIB.
|
- When C(ro), specifies that the user can view the MIB, but cannot modify the MIB.
|
||||||
- When C(rw), specifies that the user can view and modify the MIB.
|
- When C(rw), specifies that the user can view and modify the MIB.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- ro
|
- ro
|
||||||
- rw
|
- rw
|
||||||
|
@ -88,7 +99,10 @@ options:
|
||||||
be used.
|
be used.
|
||||||
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
||||||
something else, this parameter is ignored.
|
something else, this parameter is ignored.
|
||||||
choices: ['4', '6']
|
type: str
|
||||||
|
choices:
|
||||||
|
- '4'
|
||||||
|
- '6'
|
||||||
snmp_username:
|
snmp_username:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of the user for whom you want to grant access to the SNMP v3 MIB.
|
- Specifies the name of the user for whom you want to grant access to the SNMP v3 MIB.
|
||||||
|
@ -96,6 +110,7 @@ options:
|
||||||
else, this parameter is ignored.
|
else, this parameter is ignored.
|
||||||
- When creating a new SNMP C(v3) community, this parameter is required.
|
- When creating a new SNMP C(v3) community, this parameter is required.
|
||||||
- This parameter cannot be changed once it has been set.
|
- This parameter cannot be changed once it has been set.
|
||||||
|
type: str
|
||||||
snmp_auth_protocol:
|
snmp_auth_protocol:
|
||||||
description:
|
description:
|
||||||
- Specifies the authentication method for the user.
|
- Specifies the authentication method for the user.
|
||||||
|
@ -104,6 +119,7 @@ options:
|
||||||
- When C(none), specifies that user does not require authentication.
|
- When C(none), specifies that user does not require authentication.
|
||||||
- When creating a new SNMP C(v3) community, if this parameter is not specified, the default
|
- When creating a new SNMP C(v3) community, if this parameter is not specified, the default
|
||||||
of C(sha) will be used.
|
of C(sha) will be used.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- md5
|
- md5
|
||||||
- sha
|
- sha
|
||||||
|
@ -113,6 +129,7 @@ options:
|
||||||
- Specifies the password for the user.
|
- Specifies the password for the user.
|
||||||
- When creating a new SNMP C(v3) community, this parameter is required.
|
- When creating a new SNMP C(v3) community, this parameter is required.
|
||||||
- This value must be at least 8 characters long.
|
- This value must be at least 8 characters long.
|
||||||
|
type: str
|
||||||
snmp_privacy_protocol:
|
snmp_privacy_protocol:
|
||||||
description:
|
description:
|
||||||
- Specifies the encryption protocol.
|
- Specifies the encryption protocol.
|
||||||
|
@ -123,6 +140,7 @@ options:
|
||||||
- When C(none), specifies that the system does not encrypt the user information.
|
- When C(none), specifies that the system does not encrypt the user information.
|
||||||
- When creating a new SNMP C(v3) community, if this parameter is not specified, the
|
- When creating a new SNMP C(v3) community, if this parameter is not specified, the
|
||||||
default of C(aes) will be used.
|
default of C(aes) will be used.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- aes
|
- aes
|
||||||
- des
|
- des
|
||||||
|
@ -132,17 +150,20 @@ options:
|
||||||
- Specifies the password for the user.
|
- Specifies the password for the user.
|
||||||
- When creating a new SNMP C(v3) community, this parameter is required.
|
- When creating a new SNMP C(v3) community, this parameter is required.
|
||||||
- This value must be at least 8 characters long.
|
- This value must be at least 8 characters long.
|
||||||
|
type: str
|
||||||
update_password:
|
update_password:
|
||||||
description:
|
description:
|
||||||
- C(always) will allow to update passwords if the user chooses to do so.
|
- C(always) will allow to update passwords if the user chooses to do so.
|
||||||
C(on_create) will only set the password for newly created resources.
|
C(on_create) will only set the password for newly created resources.
|
||||||
default: always
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- always
|
- always
|
||||||
- on_create
|
- on_create
|
||||||
|
default: always
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
type: str
|
||||||
default: Common
|
default: Common
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
|
@ -253,20 +274,14 @@ 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 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
|
|
||||||
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 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
|
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -520,7 +535,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()
|
||||||
|
@ -892,16 +907,12 @@ def main():
|
||||||
required_if=spec.required_if
|
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__':
|
||||||
|
|
|
@ -23,22 +23,29 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Name of the SNMP configuration endpoint.
|
- Name of the SNMP configuration endpoint.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
snmp_version:
|
snmp_version:
|
||||||
description:
|
description:
|
||||||
- Specifies to which Simple Network Management Protocol (SNMP) version
|
- Specifies to which Simple Network Management Protocol (SNMP) version
|
||||||
the trap destination applies.
|
the trap destination applies.
|
||||||
choices: ['1', '2c']
|
type: str
|
||||||
|
choices:
|
||||||
|
- '1'
|
||||||
|
- '2c'
|
||||||
community:
|
community:
|
||||||
description:
|
description:
|
||||||
- Specifies the community name for the trap destination.
|
- Specifies the community name for the trap destination.
|
||||||
|
type: str
|
||||||
destination:
|
destination:
|
||||||
description:
|
description:
|
||||||
- Specifies the address for the trap destination. This can be either an
|
- Specifies the address for the trap destination. This can be either an
|
||||||
IP address or a hostname.
|
IP address or a hostname.
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Specifies the port for the trap destination.
|
- Specifies the port for the trap destination.
|
||||||
|
type: str
|
||||||
network:
|
network:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of the trap network. This option is not supported in
|
- Specifies the name of the trap network. This option is not supported in
|
||||||
|
@ -48,6 +55,7 @@ options:
|
||||||
value when configuring a BIG-IP will cause the module to stop and report
|
value when configuring a BIG-IP will cause the module to stop and report
|
||||||
an error. The usual remedy is to choose one of the other options, such as
|
an error. The usual remedy is to choose one of the other options, such as
|
||||||
C(management).
|
C(management).
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- other
|
- other
|
||||||
- management
|
- management
|
||||||
|
@ -56,13 +64,15 @@ options:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the resource exists.
|
- When C(present), ensures that the resource exists.
|
||||||
- When C(absent), ensures that the resource does not exist.
|
- When C(absent), ensures that the resource does not exist.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
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
|
||||||
notes:
|
notes:
|
||||||
|
@ -142,21 +152,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 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
|
||||||
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 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
|
||||||
|
|
||||||
|
|
||||||
|
@ -296,7 +300,7 @@ class V1Parameters(Parameters):
|
||||||
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):
|
||||||
|
@ -337,7 +341,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
|
||||||
|
|
||||||
def exec_module(self):
|
def exec_module(self):
|
||||||
|
@ -665,16 +669,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__':
|
||||||
|
|
|
@ -29,21 +29,23 @@ options:
|
||||||
exist.
|
exist.
|
||||||
- Generally should be C(yes) only in cases where you have reason
|
- Generally should be C(yes) only in cases where you have reason
|
||||||
to believe that the image was corrupted during upload.
|
to believe that the image was corrupted during upload.
|
||||||
default: no
|
|
||||||
type: bool
|
type: bool
|
||||||
|
default: no
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the image is uploaded.
|
- When C(present), ensures that the image is uploaded.
|
||||||
- When C(absent), ensures that the image is removed.
|
- When C(absent), ensures that the image is removed.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
|
default: present
|
||||||
image:
|
image:
|
||||||
description:
|
description:
|
||||||
- The image to put on the remote device.
|
- The image to put on the remote device.
|
||||||
- This may be an absolute or relative location on the Ansible controller.
|
- This may be an absolute or relative location on the Ansible controller.
|
||||||
- Image names, whether they are base ISOs or hotfix ISOs, B(must) be unique.
|
- Image names, whether they are base ISOs or hotfix ISOs, B(must) be unique.
|
||||||
|
type: str
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -115,19 +117,13 @@ 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 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 upload_file
|
from library.module_utils.network.f5.icontrol import upload_file
|
||||||
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 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 upload_file
|
from ansible.module_utils.network.f5.icontrol import upload_file
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,7 +209,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()
|
||||||
|
@ -467,16 +463,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,9 +23,11 @@ options:
|
||||||
image:
|
image:
|
||||||
description:
|
description:
|
||||||
- Image to install on the remote device.
|
- Image to install on the remote device.
|
||||||
|
type: str
|
||||||
volume:
|
volume:
|
||||||
description:
|
description:
|
||||||
- The volume to install the software image to.
|
- The volume to install the software image to.
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(installed), ensures that the software is installed on the volume
|
- When C(installed), ensures that the software is installed on the volume
|
||||||
|
@ -33,10 +35,11 @@ options:
|
||||||
into the new software.
|
into the new software.
|
||||||
- When C(activated), performs the same operation as C(installed), but
|
- When C(activated), performs the same operation as C(installed), but
|
||||||
the system is rebooted to the new software.
|
the system is rebooted to the new software.
|
||||||
default: activated
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- activated
|
- activated
|
||||||
- installed
|
- installed
|
||||||
|
default: activated
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -78,18 +81,12 @@ 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 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
|
|
||||||
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 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
|
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -252,7 +249,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, client=self.client)
|
self.want = ModuleParameters(params=self.module.params, client=self.client)
|
||||||
self.have = ApiParameters(client=self.client)
|
self.have = ApiParameters(client=self.client)
|
||||||
self.changes = UsableChanges()
|
self.changes = UsableChanges()
|
||||||
|
@ -491,16 +488,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:
|
||||||
frequency:
|
frequency:
|
||||||
description:
|
description:
|
||||||
- Specifies the schedule for the automatic update check.
|
- Specifies the schedule for the automatic update check.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- daily
|
- daily
|
||||||
- monthly
|
- monthly
|
||||||
|
@ -88,18 +89,12 @@ 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 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
|
|
||||||
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 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
|
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -206,12 +201,12 @@ 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()
|
||||||
|
|
||||||
def exec_module(self): # lgtm [py/similar-function]
|
def exec_module(self):
|
||||||
result = dict()
|
result = dict()
|
||||||
|
|
||||||
changed = self.update()
|
changed = self.update()
|
||||||
|
@ -328,16 +323,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,28 +27,33 @@ options:
|
||||||
- Sets the contents of a certificate directly to the specified value.
|
- Sets the contents of a certificate directly to the specified value.
|
||||||
This is used with lookup plugins or for anything with formatting or
|
This is used with lookup plugins or for anything with formatting or
|
||||||
- C(content) must be provided when C(state) is C(present).
|
- C(content) must be provided when C(state) is C(present).
|
||||||
|
type: str
|
||||||
aliases: ['cert_content']
|
aliases: ['cert_content']
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Certificate state. This determines if the provided certificate
|
- Certificate state. This determines if the provided certificate
|
||||||
and key is to be made C(present) on the device or C(absent).
|
and key is to be made C(present) on the device or C(absent).
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- SSL Certificate Name. This is the cert name used when importing a certificate
|
- SSL Certificate Name. This is the cert name used when importing a certificate
|
||||||
into the F5. It also determines the filenames of the objects on the LTM.
|
into the F5. It also determines the filenames of the objects on the LTM.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
issuer_cert:
|
issuer_cert:
|
||||||
description:
|
description:
|
||||||
- Issuer certificate used for OCSP monitoring.
|
- Issuer certificate used for OCSP monitoring.
|
||||||
- This parameter is only valid on versions of BIG-IP 13.0.0 or above.
|
- This parameter is only valid on versions of BIG-IP 13.0.0 or above.
|
||||||
|
type: str
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
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
|
||||||
notes:
|
notes:
|
||||||
|
@ -134,10 +139,7 @@ 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 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 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.icontrol import upload_file
|
from library.module_utils.network.f5.icontrol import upload_file
|
||||||
|
@ -145,10 +147,7 @@ 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 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 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.icontrol import upload_file
|
from ansible.module_utils.network.f5.icontrol import upload_file
|
||||||
|
@ -311,7 +310,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()
|
||||||
|
@ -568,16 +567,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:
|
||||||
- Sets the contents of a key directly to the specified value. This is
|
- Sets the contents of a key directly to the specified value. This is
|
||||||
used with lookup plugins or for anything with formatting or templating.
|
used with lookup plugins or for anything with formatting or templating.
|
||||||
This must be provided when C(state) is C(present).
|
This must be provided when C(state) is C(present).
|
||||||
|
type: str
|
||||||
aliases:
|
aliases:
|
||||||
- key_content
|
- key_content
|
||||||
state:
|
state:
|
||||||
|
@ -33,20 +34,24 @@ options:
|
||||||
- When C(present), ensures that the key is uploaded to the device. When
|
- When C(present), ensures that the key is uploaded to the device. When
|
||||||
C(absent), ensures that the key is removed from the device. If the key
|
C(absent), ensures that the key is removed from the device. If the key
|
||||||
is currently in use, the module will not be able to remove the key.
|
is currently in use, the module will not be able to remove the key.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The name of the key.
|
- The name of the key.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
passphrase:
|
passphrase:
|
||||||
description:
|
description:
|
||||||
- Passphrase on key.
|
- Passphrase on key.
|
||||||
|
type: str
|
||||||
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
|
||||||
notes:
|
notes:
|
||||||
|
@ -118,20 +123,14 @@ 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 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.icontrol import upload_file
|
from library.module_utils.network.f5.icontrol import upload_file
|
||||||
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 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.icontrol import upload_file
|
from ansible.module_utils.network.f5.icontrol import upload_file
|
||||||
|
|
||||||
|
@ -273,7 +272,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()
|
||||||
|
@ -509,16 +508,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,10 +23,12 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Specifies the name of the OCSP certificate validator.
|
- Specifies the name of the OCSP certificate validator.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
cache_error_timeout:
|
cache_error_timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the lifetime of an error response in the cache, in seconds.
|
- Specifies the lifetime of an error response in the cache, in seconds.
|
||||||
|
type: int
|
||||||
proxy_server_pool:
|
proxy_server_pool:
|
||||||
description:
|
description:
|
||||||
- Specifies the proxy server pool the BIG-IP system uses to fetch the OCSP
|
- Specifies the proxy server pool the BIG-IP system uses to fetch the OCSP
|
||||||
|
@ -35,17 +37,21 @@ options:
|
||||||
- Use this option when either the OCSP responder cannot be reached on any of
|
- Use this option when either the OCSP responder cannot be reached on any of
|
||||||
BIG-IP system's interfaces or one or more servers can proxy an HTTP request
|
BIG-IP system's interfaces or one or more servers can proxy an HTTP request
|
||||||
to an external server and fetch the response.
|
to an external server and fetch the response.
|
||||||
|
type: str
|
||||||
cache_timeout:
|
cache_timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the lifetime of the OCSP response in the cache, in seconds.
|
- Specifies the lifetime of the OCSP response in the cache, in seconds.
|
||||||
|
type: str
|
||||||
clock_skew:
|
clock_skew:
|
||||||
description:
|
description:
|
||||||
- Specifies the tolerable absolute difference in the clocks of the responder
|
- Specifies the tolerable absolute difference in the clocks of the responder
|
||||||
and the BIG-IP system, in seconds.
|
and the BIG-IP system, in seconds.
|
||||||
|
type: int
|
||||||
connections_limit:
|
connections_limit:
|
||||||
description:
|
description:
|
||||||
- Specifies the maximum number of connections per second allowed for the
|
- Specifies the maximum number of connections per second allowed for the
|
||||||
OCSP certificate validator.
|
OCSP certificate validator.
|
||||||
|
type: int
|
||||||
dns_resolver:
|
dns_resolver:
|
||||||
description:
|
description:
|
||||||
- Specifies the internal DNS resolver the BIG-IP system uses to fetch the
|
- Specifies the internal DNS resolver the BIG-IP system uses to fetch the
|
||||||
|
@ -55,29 +61,36 @@ options:
|
||||||
- Use this option when either there is a DNS server that can do the
|
- Use this option when either there is a DNS server that can do the
|
||||||
name-resolution of the OCSP responders or the OCSP responder can be
|
name-resolution of the OCSP responders or the OCSP responder can be
|
||||||
reached on one of BIG-IP system's interfaces.
|
reached on one of BIG-IP system's interfaces.
|
||||||
|
type: str
|
||||||
route_domain:
|
route_domain:
|
||||||
description:
|
description:
|
||||||
- Specifies the route domain for fetching an OCSP response using HTTP
|
- Specifies the route domain for fetching an OCSP response using HTTP
|
||||||
forward proxy.
|
forward proxy.
|
||||||
|
type: str
|
||||||
hash_algorithm:
|
hash_algorithm:
|
||||||
description:
|
description:
|
||||||
- Specifies a hash algorithm used to sign an OCSP request.
|
- Specifies a hash algorithm used to sign an OCSP request.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- sha256
|
- sha256
|
||||||
- sha1
|
- sha1
|
||||||
certificate:
|
certificate:
|
||||||
description:
|
description:
|
||||||
- Specifies a certificate used to sign an OCSP request.
|
- Specifies a certificate used to sign an OCSP request.
|
||||||
|
type: str
|
||||||
key:
|
key:
|
||||||
description:
|
description:
|
||||||
- Specifies a key used to sign an OCSP request.
|
- Specifies a key used to sign an OCSP request.
|
||||||
|
type: str
|
||||||
passphrase:
|
passphrase:
|
||||||
description:
|
description:
|
||||||
- Specifies a passphrase used to sign an OCSP request.
|
- Specifies a passphrase used to sign an OCSP request.
|
||||||
|
type: str
|
||||||
status_age:
|
status_age:
|
||||||
description:
|
description:
|
||||||
- Specifies the maximum allowed lag time that the BIG-IP system accepts for
|
- Specifies the maximum allowed lag time that the BIG-IP system accepts for
|
||||||
the 'thisUpdate' time in the OCSP response.
|
the 'thisUpdate' time in the OCSP response.
|
||||||
|
type: int
|
||||||
strict_responder_checking:
|
strict_responder_checking:
|
||||||
description:
|
description:
|
||||||
- Specifies whether the responder's certificate is checked for an OCSP
|
- Specifies whether the responder's certificate is checked for an OCSP
|
||||||
|
@ -87,36 +100,42 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the time interval that the BIG-IP system waits for before
|
- Specifies the time interval that the BIG-IP system waits for before
|
||||||
ending the connection to the OCSP responder, in seconds.
|
ending the connection to the OCSP responder, in seconds.
|
||||||
|
type: int
|
||||||
trusted_responders:
|
trusted_responders:
|
||||||
description:
|
description:
|
||||||
- Specifies the certificates used for validating the OCSP response
|
- Specifies the certificates used for validating the OCSP response
|
||||||
when the responder's certificate has been omitted from the response.
|
when the responder's certificate has been omitted from the response.
|
||||||
|
type: str
|
||||||
responder_url:
|
responder_url:
|
||||||
description:
|
description:
|
||||||
- Specifies the absolute URL that overrides the OCSP responder URL
|
- Specifies the absolute URL that overrides the OCSP responder URL
|
||||||
obtained from the certificate's AIA extensions. This should be an
|
obtained from the certificate's AIA extensions. This should be an
|
||||||
HTTP-based URL.
|
HTTP-based URL.
|
||||||
|
type: str
|
||||||
update_password:
|
update_password:
|
||||||
description:
|
description:
|
||||||
- C(always) will allow to update passwords if the user chooses to do so.
|
- C(always) will allow to update passwords if the user chooses to do so.
|
||||||
C(on_create) will only set the password for newly created OCSP validators.
|
C(on_create) will only set the password for newly created OCSP validators.
|
||||||
default: always
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- always
|
- always
|
||||||
- on_create
|
- on_create
|
||||||
|
default: always
|
||||||
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
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the resource exists.
|
- When C(present), ensures that the resource exists.
|
||||||
- When C(absent), ensures that the resource does not exist.
|
- When C(absent), ensures that the resource does not exist.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
notes:
|
notes:
|
||||||
- Requires BIG-IP >= 13.x.
|
- Requires BIG-IP >= 13.x.
|
||||||
|
@ -222,11 +241,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.icontrol import tmos_version
|
from library.module_utils.network.f5.icontrol import tmos_version
|
||||||
|
@ -234,11 +250,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.icontrol import tmos_version
|
from ansible.module_utils.network.f5.icontrol import tmos_version
|
||||||
|
@ -490,7 +503,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()
|
||||||
|
@ -750,16 +763,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__':
|
||||||
|
|
|
@ -23,21 +23,25 @@ options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Name of the static route.
|
- Name of the static route.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- Descriptive text that identifies the route.
|
- Descriptive text that identifies the route.
|
||||||
|
type: str
|
||||||
destination:
|
destination:
|
||||||
description:
|
description:
|
||||||
- Specifies an IP address for the static entry in the routing table.
|
- Specifies an IP address for the static entry in the routing table.
|
||||||
When creating a new static route, this value is required.
|
When creating a new static route, this value is required.
|
||||||
- This value cannot be changed once it is set.
|
- This value cannot be changed once it is set.
|
||||||
|
type: str
|
||||||
netmask:
|
netmask:
|
||||||
description:
|
description:
|
||||||
- The netmask for the static route. When creating a new static route, this value
|
- The netmask for the static route. When creating a new static route, this value
|
||||||
is required.
|
is required.
|
||||||
- This value can be in either IP or CIDR format.
|
- This value can be in either IP or CIDR format.
|
||||||
- This value cannot be changed once it is set.
|
- This value cannot be changed once it is set.
|
||||||
|
type: str
|
||||||
gateway_address:
|
gateway_address:
|
||||||
description:
|
description:
|
||||||
- Specifies the router for the system to use when forwarding packets
|
- Specifies the router for the system to use when forwarding packets
|
||||||
|
@ -46,15 +50,18 @@ options:
|
||||||
IPv6 address that starts with C(FE80:), the address will be treated
|
IPv6 address that starts with C(FE80:), the address will be treated
|
||||||
as a link-local address. This requires that the C(vlan) parameter
|
as a link-local address. This requires that the C(vlan) parameter
|
||||||
also be supplied.
|
also be supplied.
|
||||||
|
type: str
|
||||||
vlan:
|
vlan:
|
||||||
description:
|
description:
|
||||||
- Specifies the VLAN or Tunnel through which the system forwards packets
|
- Specifies the VLAN or Tunnel through which the system forwards packets
|
||||||
to the destination. When C(gateway_address) is a link-local IPv6
|
to the destination. When C(gateway_address) is a link-local IPv6
|
||||||
address, this value is required
|
address, this value is required.
|
||||||
|
type: str
|
||||||
pool:
|
pool:
|
||||||
description:
|
description:
|
||||||
- Specifies the pool through which the system forwards packets to the
|
- Specifies the pool through which the system forwards packets to the
|
||||||
destination.
|
destination.
|
||||||
|
type: str
|
||||||
reject:
|
reject:
|
||||||
description:
|
description:
|
||||||
- Specifies that the system drops packets sent to the destination.
|
- Specifies that the system drops packets sent to the destination.
|
||||||
|
@ -62,24 +69,28 @@ options:
|
||||||
mtu:
|
mtu:
|
||||||
description:
|
description:
|
||||||
- Specifies a specific maximum transmission unit (MTU).
|
- Specifies a specific maximum transmission unit (MTU).
|
||||||
|
type: str
|
||||||
route_domain:
|
route_domain:
|
||||||
description:
|
description:
|
||||||
- The route domain id of the system. When creating a new static route, if
|
- The route domain id of the system. When creating a new static route, if
|
||||||
this value is not specified, a default value of C(0) will be used.
|
this value is not specified, a default value of C(0) will be used.
|
||||||
- This value cannot be changed once it is set.
|
- This value cannot be changed once it is set.
|
||||||
|
type: int
|
||||||
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.6
|
version_added: 2.6
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), ensures that the static route exists.
|
- When C(present), ensures that the static route exists.
|
||||||
- When C(absent), ensures that the static does not exist.
|
- When C(absent), ensures that the static does not exist.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
default: present
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -158,12 +169,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.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
from library.module_utils.network.f5.ipaddress import ipv6_netmask_to_cidr
|
from library.module_utils.network.f5.ipaddress import ipv6_netmask_to_cidr
|
||||||
from library.module_utils.compat.ipaddress import ip_address
|
from library.module_utils.compat.ipaddress import ip_address
|
||||||
|
@ -173,12 +181,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.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
from ansible.module_utils.network.f5.ipaddress import ipv6_netmask_to_cidr
|
from ansible.module_utils.network.f5.ipaddress import ipv6_netmask_to_cidr
|
||||||
from ansible.module_utils.compat.ipaddress import ip_address
|
from ansible.module_utils.compat.ipaddress import ip_address
|
||||||
|
@ -446,7 +451,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()
|
||||||
|
@ -686,16 +691,12 @@ def main():
|
||||||
mutually_exclusive=spec.mutually_exclusive,
|
mutually_exclusive=spec.mutually_exclusive,
|
||||||
)
|
)
|
||||||
|
|
||||||
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:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of ARP messages from the tmm daemon
|
- Specifies the lowest level of ARP messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- debug
|
- debug
|
||||||
- error
|
- error
|
||||||
|
@ -34,6 +35,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of HTTP compression messages from the tmm daemon
|
- Specifies the lowest level of HTTP compression messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- debug
|
- debug
|
||||||
- error
|
- error
|
||||||
|
@ -44,6 +46,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of HTTP messages from the tmm daemon
|
- Specifies the lowest level of HTTP messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- debug
|
- debug
|
||||||
- error
|
- error
|
||||||
|
@ -54,6 +57,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of IP address messages from the tmm daemon
|
- Specifies the lowest level of IP address messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- debug
|
- debug
|
||||||
- informational
|
- informational
|
||||||
|
@ -63,6 +67,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of iRule messages from the tmm daemon
|
- Specifies the lowest level of iRule messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- debug
|
- debug
|
||||||
- error
|
- error
|
||||||
|
@ -73,6 +78,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of Layer 4 messages from the tmm daemon
|
- Specifies the lowest level of Layer 4 messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- debug
|
- debug
|
||||||
- informational
|
- informational
|
||||||
|
@ -81,6 +87,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of network messages from the tmm daemon
|
- Specifies the lowest level of network messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- critical
|
- critical
|
||||||
- debug
|
- debug
|
||||||
|
@ -92,6 +99,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of operating system messages from the tmm daemon
|
- Specifies the lowest level of operating system messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- alert
|
- alert
|
||||||
- critical
|
- critical
|
||||||
|
@ -105,6 +113,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of PVA messages from the tmm daemon
|
- Specifies the lowest level of PVA messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- debug
|
- debug
|
||||||
- informational
|
- informational
|
||||||
|
@ -113,6 +122,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the lowest level of SSL messages from the tmm daemon
|
- Specifies the lowest level of SSL messages from the tmm daemon
|
||||||
to include in the system log.
|
to include in the system log.
|
||||||
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- alert
|
- alert
|
||||||
- critical
|
- critical
|
||||||
|
@ -126,9 +136,10 @@ options:
|
||||||
description:
|
description:
|
||||||
- The state of the log level on the system. When C(present), guarantees
|
- The state of the log level on the system. When C(present), guarantees
|
||||||
that an existing log level is set to C(value).
|
that an existing log level is set to C(value).
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
|
default: present
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Wojciech Wypior (@wojtek0806)
|
- Wojciech Wypior (@wojtek0806)
|
||||||
|
@ -204,18 +215,12 @@ 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 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
|
|
||||||
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 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
|
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -325,7 +330,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()
|
||||||
|
@ -476,16 +481,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,6 +23,7 @@ options:
|
||||||
key:
|
key:
|
||||||
description:
|
description:
|
||||||
- The database variable to manipulate.
|
- The database variable to manipulate.
|
||||||
|
type: str
|
||||||
required: True
|
required: True
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
|
@ -30,14 +31,16 @@ options:
|
||||||
that an existing variable is set to C(value). When C(reset) sets the
|
that an existing variable is set to C(value). When C(reset) sets the
|
||||||
variable back to the default value. At least one of value and state
|
variable back to the default value. At least one of value and state
|
||||||
C(reset) are required.
|
C(reset) are required.
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
- reset
|
- reset
|
||||||
|
default: present
|
||||||
value:
|
value:
|
||||||
description:
|
description:
|
||||||
- The value to set the key to. At least one of value and state C(reset)
|
- The value to set the key to. At least one of value and state C(reset)
|
||||||
are required.
|
are required.
|
||||||
|
type: str
|
||||||
notes:
|
notes:
|
||||||
- Requires BIG-IP version 12.0.0 or greater
|
- Requires BIG-IP version 12.0.0 or greater
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
|
@ -101,18 +104,12 @@ 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 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
|
|
||||||
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 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
|
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -197,7 +194,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()
|
||||||
|
@ -394,16 +391,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,10 +23,12 @@ options:
|
||||||
banner_text:
|
banner_text:
|
||||||
description:
|
description:
|
||||||
- Specifies the text to present in the advisory banner.
|
- Specifies the text to present in the advisory banner.
|
||||||
|
type: str
|
||||||
console_timeout:
|
console_timeout:
|
||||||
description:
|
description:
|
||||||
- Specifies the number of seconds of inactivity before the system logs
|
- Specifies the number of seconds of inactivity before the system logs
|
||||||
off a user that is logged on.
|
off a user that is logged on.
|
||||||
|
type: int
|
||||||
gui_setup:
|
gui_setup:
|
||||||
description:
|
description:
|
||||||
- C(yes) or C(no) the Setup utility in the browser-based
|
- C(yes) or C(no) the Setup utility in the browser-based
|
||||||
|
@ -65,9 +67,10 @@ options:
|
||||||
description:
|
description:
|
||||||
- The state of the variable on the system. When C(present), guarantees
|
- The state of the variable on the system. When C(present), guarantees
|
||||||
that an existing variable is set to C(value).
|
that an existing variable is set to C(value).
|
||||||
default: present
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
|
default: present
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -140,19 +143,13 @@ 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 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 flatten_boolean
|
from library.module_utils.network.f5.common import flatten_boolean
|
||||||
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 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 flatten_boolean
|
from ansible.module_utils.network.f5.common import flatten_boolean
|
||||||
|
|
||||||
|
|
||||||
|
@ -347,7 +344,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()
|
||||||
|
@ -497,16 +494,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__':
|
||||||
|
|
|
@ -106,9 +106,11 @@ class TestMadmLocationManager(unittest.TestCase):
|
||||||
def test_create_qkview_default_options(self, *args):
|
def test_create_qkview_default_options(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
dest='/tmp/foo.qkview',
|
dest='/tmp/foo.qkview',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
password='password'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -144,9 +146,11 @@ class TestBulkLocationManager(unittest.TestCase):
|
||||||
def test_create_qkview_default_options(self, *args):
|
def test_create_qkview_default_options(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
dest='/tmp/foo.qkview',
|
dest='/tmp/foo.qkview',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
password='password'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -90,9 +90,11 @@ class TestManager(unittest.TestCase):
|
||||||
name='foo',
|
name='foo',
|
||||||
line_order=1000,
|
line_order=1000,
|
||||||
attribute_string='bar',
|
attribute_string='bar',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
password='password',
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -106,14 +106,17 @@ class TestManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='foo',
|
name='foo',
|
||||||
id=1234,
|
id=1234,
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
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_one_of=self.spec.required_one_of
|
||||||
)
|
)
|
||||||
mm = ModuleManager(module=module)
|
mm = ModuleManager(module=module)
|
||||||
|
|
||||||
|
|
|
@ -149,9 +149,11 @@ class TestManager(unittest.TestCase):
|
||||||
state='present',
|
state='present',
|
||||||
traffic_group='traffic-group-local-only',
|
traffic_group='traffic-group-local-only',
|
||||||
vlan='net1',
|
vlan='net1',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -183,9 +185,11 @@ class TestManager(unittest.TestCase):
|
||||||
state='present',
|
state='present',
|
||||||
traffic_group='traffic-group-local-only',
|
traffic_group='traffic-group-local-only',
|
||||||
vlan='net1',
|
vlan='net1',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_tm_net_self.json'))
|
current = ApiParameters(params=load_fixture('load_tm_net_self.json'))
|
||||||
|
|
|
@ -109,9 +109,11 @@ class TestManager(unittest.TestCase):
|
||||||
port_misuse_policy='misuse1',
|
port_misuse_policy='misuse1',
|
||||||
partition='Common',
|
partition='Common',
|
||||||
state='present',
|
state='present',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -124,9 +124,11 @@ class TestManager(unittest.TestCase):
|
||||||
from_address='no-reply@mydomain.com',
|
from_address='no-reply@mydomain.com',
|
||||||
authentication=True,
|
authentication=True,
|
||||||
partition='Common',
|
partition='Common',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
password='password',
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -99,14 +99,17 @@ class TestManager(unittest.TestCase):
|
||||||
name='my-snat-pool',
|
name='my-snat-pool',
|
||||||
state='present',
|
state='present',
|
||||||
members=['10.10.10.10', '20.20.20.20'],
|
members=['10.10.10.10', '20.20.20.20'],
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
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
|
||||||
)
|
)
|
||||||
mm = ModuleManager(module=module)
|
mm = ModuleManager(module=module)
|
||||||
|
|
||||||
|
@ -126,16 +129,19 @@ class TestManager(unittest.TestCase):
|
||||||
name='asdasd',
|
name='asdasd',
|
||||||
state='present',
|
state='present',
|
||||||
members=['1.1.1.1', '2.2.2.2'],
|
members=['1.1.1.1', '2.2.2.2'],
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_ltm_snatpool.json'))
|
current = ApiParameters(params=load_fixture('load_ltm_snatpool.json'))
|
||||||
|
|
||||||
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
|
||||||
)
|
)
|
||||||
mm = ModuleManager(module=module)
|
mm = ModuleManager(module=module)
|
||||||
|
|
||||||
|
@ -152,16 +158,19 @@ class TestManager(unittest.TestCase):
|
||||||
name='asdasd',
|
name='asdasd',
|
||||||
state='present',
|
state='present',
|
||||||
members=['30.30.30.30'],
|
members=['30.30.30.30'],
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_ltm_snatpool.json'))
|
current = ApiParameters(params=load_fixture('load_ltm_snatpool.json'))
|
||||||
|
|
||||||
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
|
||||||
)
|
)
|
||||||
mm = ModuleManager(module=module)
|
mm = ModuleManager(module=module)
|
||||||
|
|
||||||
|
|
|
@ -72,9 +72,6 @@ class TestParameters(unittest.TestCase):
|
||||||
contact='Alice@foo.org',
|
contact='Alice@foo.org',
|
||||||
device_warning_traps='enabled',
|
device_warning_traps='enabled',
|
||||||
location='Lunar orbit',
|
location='Lunar orbit',
|
||||||
password='password',
|
|
||||||
server='localhost',
|
|
||||||
user='admin'
|
|
||||||
)
|
)
|
||||||
p = ModuleParameters(params=args)
|
p = ModuleParameters(params=args)
|
||||||
assert p.agent_status_traps == 'enabled'
|
assert p.agent_status_traps == 'enabled'
|
||||||
|
@ -88,9 +85,6 @@ class TestParameters(unittest.TestCase):
|
||||||
agent_status_traps='disabled',
|
agent_status_traps='disabled',
|
||||||
agent_authentication_traps='disabled',
|
agent_authentication_traps='disabled',
|
||||||
device_warning_traps='disabled',
|
device_warning_traps='disabled',
|
||||||
password='password',
|
|
||||||
server='localhost',
|
|
||||||
user='admin'
|
|
||||||
)
|
)
|
||||||
p = ModuleParameters(params=args)
|
p = ModuleParameters(params=args)
|
||||||
assert p.agent_status_traps == 'disabled'
|
assert p.agent_status_traps == 'disabled'
|
||||||
|
@ -132,9 +126,11 @@ class TestManager(unittest.TestCase):
|
||||||
def test_update_agent_status_traps(self, *args):
|
def test_update_agent_status_traps(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
agent_status_traps='enabled',
|
agent_status_traps='enabled',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Configure the parameters that would be returned by querying the
|
# Configure the parameters that would be returned by querying the
|
||||||
|
@ -168,9 +164,11 @@ class TestManager(unittest.TestCase):
|
||||||
'foo',
|
'foo',
|
||||||
'baz.foo.com'
|
'baz.foo.com'
|
||||||
],
|
],
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Configure the parameters that would be returned by querying the
|
# Configure the parameters that would be returned by querying the
|
||||||
|
@ -204,9 +202,11 @@ class TestManager(unittest.TestCase):
|
||||||
allowed_addresses=[
|
allowed_addresses=[
|
||||||
'default'
|
'default'
|
||||||
],
|
],
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Configure the parameters that would be returned by querying the
|
# Configure the parameters that would be returned by querying the
|
||||||
|
@ -236,9 +236,11 @@ class TestManager(unittest.TestCase):
|
||||||
def test_update_allowed_addresses_empty(self, *args):
|
def test_update_allowed_addresses_empty(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
allowed_addresses=[''],
|
allowed_addresses=[''],
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Configure the parameters that would be returned by querying the
|
# Configure the parameters that would be returned by querying the
|
||||||
|
|
|
@ -170,14 +170,17 @@ class TestManager(unittest.TestCase):
|
||||||
ip_version=4,
|
ip_version=4,
|
||||||
state='present',
|
state='present',
|
||||||
partition='Common',
|
partition='Common',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
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
|
||||||
)
|
)
|
||||||
m1 = V1Manager(module=module)
|
m1 = V1Manager(module=module)
|
||||||
|
|
||||||
|
@ -194,6 +197,7 @@ class TestManager(unittest.TestCase):
|
||||||
|
|
||||||
def test_create_v1_community_1(self, *args):
|
def test_create_v1_community_1(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
name='foo',
|
||||||
version='v1',
|
version='v1',
|
||||||
community='foo',
|
community='foo',
|
||||||
source='1.1.1.1',
|
source='1.1.1.1',
|
||||||
|
@ -203,14 +207,17 @@ class TestManager(unittest.TestCase):
|
||||||
ip_version=4,
|
ip_version=4,
|
||||||
state='present',
|
state='present',
|
||||||
partition='Common',
|
partition='Common',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
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
|
||||||
)
|
)
|
||||||
m1 = V1Manager(module=module)
|
m1 = V1Manager(module=module)
|
||||||
|
|
||||||
|
@ -237,14 +244,17 @@ class TestManager(unittest.TestCase):
|
||||||
snmp_privacy_password='secretsecret',
|
snmp_privacy_password='secretsecret',
|
||||||
state='present',
|
state='present',
|
||||||
partition='Common',
|
partition='Common',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
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
|
||||||
)
|
)
|
||||||
m1 = V2Manager(module=module)
|
m1 = V2Manager(module=module)
|
||||||
|
|
||||||
|
@ -270,14 +280,17 @@ class TestManager(unittest.TestCase):
|
||||||
snmp_privacy_password='secretsecret',
|
snmp_privacy_password='secretsecret',
|
||||||
state='present',
|
state='present',
|
||||||
partition='Common',
|
partition='Common',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
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
|
||||||
)
|
)
|
||||||
m1 = V2Manager(module=module)
|
m1 = V2Manager(module=module)
|
||||||
|
|
||||||
|
|
|
@ -79,9 +79,6 @@ class TestParameters(unittest.TestCase):
|
||||||
destination='10.10.10.10',
|
destination='10.10.10.10',
|
||||||
port=1000,
|
port=1000,
|
||||||
network='other',
|
network='other',
|
||||||
password='password',
|
|
||||||
server='localhost',
|
|
||||||
user='admin'
|
|
||||||
)
|
)
|
||||||
p = V2Parameters(params=args)
|
p = V2Parameters(params=args)
|
||||||
assert p.name == 'foo'
|
assert p.name == 'foo'
|
||||||
|
@ -99,9 +96,6 @@ class TestParameters(unittest.TestCase):
|
||||||
destination='10.10.10.10',
|
destination='10.10.10.10',
|
||||||
port=1000,
|
port=1000,
|
||||||
network='other',
|
network='other',
|
||||||
password='password',
|
|
||||||
server='localhost',
|
|
||||||
user='admin'
|
|
||||||
)
|
)
|
||||||
p = V1Parameters(params=args)
|
p = V1Parameters(params=args)
|
||||||
assert p.name == 'foo'
|
assert p.name == 'foo'
|
||||||
|
@ -142,9 +136,11 @@ class TestManager(unittest.TestCase):
|
||||||
destination='10.10.10.10',
|
destination='10.10.10.10',
|
||||||
port=1000,
|
port=1000,
|
||||||
network='other',
|
network='other',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -177,9 +173,11 @@ class TestManager(unittest.TestCase):
|
||||||
community='public',
|
community='public',
|
||||||
destination='10.10.10.10',
|
destination='10.10.10.10',
|
||||||
port=1000,
|
port=1000,
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -100,9 +100,11 @@ class TestManager(unittest.TestCase):
|
||||||
def test_create(self, *args):
|
def test_create(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
image='/path/to/BIGIP-13.0.0.0.0.1645.iso',
|
image='/path/to/BIGIP-13.0.0.0.0.1645.iso',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
password='password',
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters(params=load_fixture('load_sys_software_image_1.json'))
|
current = ApiParameters(params=load_fixture('load_sys_software_image_1.json'))
|
||||||
|
|
|
@ -85,9 +85,11 @@ class TestManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
image='BIGIP-13.0.0.0.0.1645.iso',
|
image='BIGIP-13.0.0.0.0.1645.iso',
|
||||||
volume='HD1.2',
|
volume='HD1.2',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
password='password',
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
current = ApiParameters()
|
current = ApiParameters()
|
||||||
|
|
|
@ -94,9 +94,11 @@ class TestManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
auto_check='no',
|
auto_check='no',
|
||||||
auto_phone_home='no',
|
auto_phone_home='no',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Configure the parameters that would be returned by querying the
|
# Configure the parameters that would be returned by querying the
|
||||||
|
|
|
@ -106,9 +106,11 @@ class TestCertificateManager(unittest.TestCase):
|
||||||
name='foo',
|
name='foo',
|
||||||
content=load_fixture('cert1.crt'),
|
content=load_fixture('cert1.crt'),
|
||||||
state='present',
|
state='present',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -130,9 +132,11 @@ class TestCertificateManager(unittest.TestCase):
|
||||||
name='foo',
|
name='foo',
|
||||||
content=load_fixture('chain1.crt'),
|
content=load_fixture('chain1.crt'),
|
||||||
state='present',
|
state='present',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -93,9 +93,11 @@ class TestModuleManager(unittest.TestCase):
|
||||||
name='foo',
|
name='foo',
|
||||||
content=load_fixture('cert1.key'),
|
content=load_fixture('cert1.key'),
|
||||||
state='present',
|
state='present',
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -106,14 +106,18 @@ class TestManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='foo',
|
name='foo',
|
||||||
clock_skew=100,
|
clock_skew=100,
|
||||||
password='password',
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
|
password='password',
|
||||||
user='admin'
|
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,
|
||||||
|
mutually_exclusive=self.spec.mutually_exclusive,
|
||||||
|
required_together=self.spec.required_together
|
||||||
)
|
)
|
||||||
mm = ModuleManager(module=module)
|
mm = ModuleManager(module=module)
|
||||||
|
|
||||||
|
|
|
@ -157,13 +157,15 @@ class TestManager(unittest.TestCase):
|
||||||
def test_create_blackhole(self, *args):
|
def test_create_blackhole(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='test-route',
|
name='test-route',
|
||||||
password='admin',
|
|
||||||
server='localhost',
|
|
||||||
user='admin',
|
|
||||||
state='present',
|
state='present',
|
||||||
destination='10.10.10.10',
|
destination='10.10.10.10',
|
||||||
netmask='255.255.255.255',
|
netmask='255.255.255.255',
|
||||||
reject='yes'
|
reject='yes',
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -183,13 +185,15 @@ class TestManager(unittest.TestCase):
|
||||||
def test_create_route_to_pool(self, *args):
|
def test_create_route_to_pool(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='test-route',
|
name='test-route',
|
||||||
password='admin',
|
|
||||||
server='localhost',
|
|
||||||
user='admin',
|
|
||||||
state='present',
|
state='present',
|
||||||
destination='10.10.10.10',
|
destination='10.10.10.10',
|
||||||
netmask='255.255.255.255',
|
netmask='255.255.255.255',
|
||||||
pool="test-pool"
|
pool="test-pool",
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -210,13 +214,15 @@ class TestManager(unittest.TestCase):
|
||||||
def test_create_route_to_vlan(self, *args):
|
def test_create_route_to_vlan(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='test-route',
|
name='test-route',
|
||||||
password='admin',
|
|
||||||
server='localhost',
|
|
||||||
user='admin',
|
|
||||||
state='present',
|
state='present',
|
||||||
destination='10.10.10.10',
|
destination='10.10.10.10',
|
||||||
netmask='255.255.255.255',
|
netmask='255.255.255.255',
|
||||||
vlan="test-vlan"
|
vlan="test-vlan",
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -237,11 +243,13 @@ class TestManager(unittest.TestCase):
|
||||||
def test_update_description(self, *args):
|
def test_update_description(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='test-route',
|
name='test-route',
|
||||||
password='admin',
|
|
||||||
server='localhost',
|
|
||||||
user='admin',
|
|
||||||
state='present',
|
state='present',
|
||||||
description='foo description'
|
description='foo description',
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -264,11 +272,13 @@ class TestManager(unittest.TestCase):
|
||||||
def test_update_description_idempotent(self, *args):
|
def test_update_description_idempotent(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='test-route',
|
name='test-route',
|
||||||
password='admin',
|
|
||||||
server='localhost',
|
|
||||||
user='admin',
|
|
||||||
state='present',
|
state='present',
|
||||||
description='asdasd'
|
description='asdasd',
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -292,10 +302,12 @@ class TestManager(unittest.TestCase):
|
||||||
def test_delete(self, *args):
|
def test_delete(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='test-route',
|
name='test-route',
|
||||||
password='admin',
|
state='absent',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
state='absent'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -316,11 +328,13 @@ class TestManager(unittest.TestCase):
|
||||||
def test_invalid_unknown_params(self, *args):
|
def test_invalid_unknown_params(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='test-route',
|
name='test-route',
|
||||||
password='admin',
|
|
||||||
server='localhost',
|
|
||||||
user='admin',
|
|
||||||
state='present',
|
state='present',
|
||||||
foo="bar"
|
foo="bar",
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
with patch('ansible.module_utils.f5_utils.AnsibleModule.fail_json') as mo:
|
with patch('ansible.module_utils.f5_utils.AnsibleModule.fail_json') as mo:
|
||||||
mo.return_value = True
|
mo.return_value = True
|
||||||
|
@ -334,14 +348,16 @@ class TestManager(unittest.TestCase):
|
||||||
def test_create_with_route_domain(self, *args):
|
def test_create_with_route_domain(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
name='test-route',
|
name='test-route',
|
||||||
password='admin',
|
|
||||||
server='localhost',
|
|
||||||
user='admin',
|
|
||||||
state='present',
|
state='present',
|
||||||
destination='10.10.10.10',
|
destination='10.10.10.10',
|
||||||
netmask='255.255.255.255',
|
netmask='255.255.255.255',
|
||||||
route_domain=1,
|
route_domain=1,
|
||||||
reject='yes'
|
reject='yes',
|
||||||
|
provider=dict(
|
||||||
|
server='localhost',
|
||||||
|
password='password',
|
||||||
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|
|
@ -115,9 +115,11 @@ class TestManager(unittest.TestCase):
|
||||||
arp_log_level='debug',
|
arp_log_level='debug',
|
||||||
layer4_log_level='debug',
|
layer4_log_level='debug',
|
||||||
password='admin',
|
password='admin',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
state='present'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Configure the parameters that would be returned by querying the
|
# Configure the parameters that would be returned by querying the
|
||||||
|
|
|
@ -67,9 +67,6 @@ class TestParameters(unittest.TestCase):
|
||||||
args = dict(
|
args = dict(
|
||||||
key='foo',
|
key='foo',
|
||||||
value='bar',
|
value='bar',
|
||||||
password='password',
|
|
||||||
server='localhost',
|
|
||||||
user='admin'
|
|
||||||
)
|
)
|
||||||
p = Parameters(params=args)
|
p = Parameters(params=args)
|
||||||
assert p.key == 'foo'
|
assert p.key == 'foo'
|
||||||
|
@ -79,10 +76,7 @@ class TestParameters(unittest.TestCase):
|
||||||
args = dict(
|
args = dict(
|
||||||
key='foo',
|
key='foo',
|
||||||
value='bar',
|
value='bar',
|
||||||
password='password',
|
|
||||||
server='localhost',
|
|
||||||
defaultValue='baz',
|
defaultValue='baz',
|
||||||
user='admin'
|
|
||||||
|
|
||||||
)
|
)
|
||||||
p = Parameters(params=args)
|
p = Parameters(params=args)
|
||||||
|
@ -99,10 +93,12 @@ class TestManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
key='provision.cpu.afm',
|
key='provision.cpu.afm',
|
||||||
value='1',
|
value='1',
|
||||||
password='admin',
|
state='present',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
state='present'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Configure the parameters that would be returned by querying the
|
# Configure the parameters that would be returned by querying the
|
||||||
|
|
|
@ -108,10 +108,12 @@ class TestManager(unittest.TestCase):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
banner_text='this is a banner',
|
banner_text='this is a banner',
|
||||||
console_timeout=100,
|
console_timeout=100,
|
||||||
password='admin',
|
state='present',
|
||||||
|
provider=dict(
|
||||||
server='localhost',
|
server='localhost',
|
||||||
user='admin',
|
password='password',
|
||||||
state='present'
|
user='admin'
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Configure the parameters that would be returned by querying the
|
# Configure the parameters that would be returned by querying the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue