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