mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Adds various features and fixes (#39271)
* a refactor of pool member and node modules to be inline with current f5 conventions * Added priority_group_activation to pools * various other small convention fixes and bug fixes
This commit is contained in:
parent
1c49cc4377
commit
fb264281de
19 changed files with 1232 additions and 532 deletions
|
@ -17,7 +17,7 @@ DOCUMENTATION = r'''
|
|||
module: bigip_monitor_udp
|
||||
short_description: Manages F5 BIG-IP LTM udp monitors
|
||||
description: Manages F5 BIG-IP LTM udp monitors.
|
||||
version_added: "2.5"
|
||||
version_added: 2.5
|
||||
options:
|
||||
name:
|
||||
description:
|
||||
|
@ -150,30 +150,23 @@ import os
|
|||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.basic import env_fallback
|
||||
|
||||
HAS_DEVEL_IMPORTS = False
|
||||
|
||||
try:
|
||||
# Sideband repository used for dev
|
||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from library.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from library.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
except ImportError:
|
||||
HAS_F5SDK = False
|
||||
HAS_DEVEL_IMPORTS = True
|
||||
except ImportError:
|
||||
# Upstream Ansible
|
||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from ansible.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
|
@ -208,11 +201,6 @@ class Parameters(AnsibleF5Parameters):
|
|||
'destination', 'send', 'receive', 'interval', 'timeout', 'time_until_up'
|
||||
]
|
||||
|
||||
def _fqdn_name(self, value):
|
||||
if value is not None and not value.startswith('/'):
|
||||
return '/{0}/{1}'.format(self.partition, value)
|
||||
return value
|
||||
|
||||
def to_return(self):
|
||||
result = {}
|
||||
try:
|
||||
|
|
|
@ -18,7 +18,7 @@ module: bigip_node
|
|||
short_description: Manages F5 BIG-IP LTM nodes
|
||||
description:
|
||||
- Manages F5 BIG-IP LTM nodes.
|
||||
version_added: "1.4"
|
||||
version_added: 1.4
|
||||
options:
|
||||
state:
|
||||
description:
|
||||
|
@ -59,12 +59,12 @@ options:
|
|||
quorum:
|
||||
description:
|
||||
- Monitor quorum value when C(monitor_type) is C(m_of_n).
|
||||
version_added: "2.2"
|
||||
version_added: 2.2
|
||||
monitors:
|
||||
description:
|
||||
- Specifies the health monitors that the system currently uses to
|
||||
monitor this node.
|
||||
version_added: "2.2"
|
||||
version_added: 2.2
|
||||
address:
|
||||
description:
|
||||
- IP address of the node. This can be either IPv4 or IPv6. When creating a
|
||||
|
@ -73,7 +73,7 @@ options:
|
|||
aliases:
|
||||
- ip
|
||||
- host
|
||||
version_added: "2.2"
|
||||
version_added: 2.2
|
||||
fqdn:
|
||||
description:
|
||||
- FQDN name of the node. This can be any name that is a valid RFC 1123 DNS
|
||||
|
@ -86,7 +86,7 @@ options:
|
|||
provided. This parameter cannot be updated after it is set.
|
||||
aliases:
|
||||
- hostname
|
||||
version_added: "2.5"
|
||||
version_added: 2.5
|
||||
description:
|
||||
description:
|
||||
- Specifies descriptive text that identifies the node.
|
||||
|
@ -97,7 +97,9 @@ options:
|
|||
version_added: 2.5
|
||||
notes:
|
||||
- Requires the netaddr Python package on the host. This is as easy as
|
||||
pip install netaddr
|
||||
C(pip install netaddr).
|
||||
requirements:
|
||||
- netaddr
|
||||
extends_documentation_fragment: f5
|
||||
author:
|
||||
- Tim Rupp (@caphrim007)
|
||||
|
@ -216,30 +218,25 @@ import time
|
|||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.basic import env_fallback
|
||||
|
||||
HAS_DEVEL_IMPORTS = False
|
||||
|
||||
try:
|
||||
# Sideband repository used for dev
|
||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from library.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from library.module_utils.network.f5.common import fq_name
|
||||
from library.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
except ImportError:
|
||||
HAS_F5SDK = False
|
||||
HAS_DEVEL_IMPORTS = True
|
||||
except ImportError:
|
||||
# Upstream Ansible
|
||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from ansible.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from ansible.module_utils.network.f5.common import fq_name
|
||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
|
@ -291,11 +288,6 @@ class Parameters(AnsibleF5Parameters):
|
|||
except Exception:
|
||||
return result
|
||||
|
||||
def _fqdn_name(self, value):
|
||||
if value is not None and not value.startswith('/'):
|
||||
return '/{0}/{1}'.format(self.partition, value)
|
||||
return value
|
||||
|
||||
@property
|
||||
def monitors_list(self):
|
||||
if self._values['monitors'] is None:
|
||||
|
@ -310,13 +302,12 @@ class Parameters(AnsibleF5Parameters):
|
|||
def monitors(self):
|
||||
if self._values['monitors'] is None:
|
||||
return None
|
||||
monitors = [self._fqdn_name(x) for x in self.monitors_list]
|
||||
monitors = [fq_name(self.partition, x) for x in self.monitors_list]
|
||||
if self.monitor_type == 'm_of_n':
|
||||
monitors = ' '.join(monitors)
|
||||
result = 'min %s of { %s }' % (self.quorum, monitors)
|
||||
else:
|
||||
result = ' and '.join(monitors).strip()
|
||||
|
||||
return result
|
||||
|
||||
@property
|
||||
|
|
|
@ -18,7 +18,7 @@ module: bigip_partition
|
|||
short_description: Manage BIG-IP partitions
|
||||
description:
|
||||
- Manage BIG-IP partitions.
|
||||
version_added: "2.5"
|
||||
version_added: 2.5
|
||||
options:
|
||||
name:
|
||||
description:
|
||||
|
@ -107,30 +107,23 @@ description:
|
|||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
HAS_DEVEL_IMPORTS = False
|
||||
|
||||
try:
|
||||
# Sideband repository used for dev
|
||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from library.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from library.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
except ImportError:
|
||||
HAS_F5SDK = False
|
||||
HAS_DEVEL_IMPORTS = True
|
||||
except ImportError:
|
||||
# Upstream Ansible
|
||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from ansible.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
|
|
|
@ -23,7 +23,7 @@ description:
|
|||
the description, and things unrelated to the policy rules themselves.
|
||||
It is also the first module that should be used when creating rules as
|
||||
the C(bigip_policy_rule) module requires a policy parameter.
|
||||
version_added: "2.5"
|
||||
version_added: 2.5
|
||||
options:
|
||||
description:
|
||||
description:
|
||||
|
@ -168,30 +168,23 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils.basic import env_fallback
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
HAS_DEVEL_IMPORTS = False
|
||||
|
||||
try:
|
||||
# Sideband repository used for dev
|
||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from library.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from library.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
except ImportError:
|
||||
HAS_F5SDK = False
|
||||
HAS_DEVEL_IMPORTS = True
|
||||
except ImportError:
|
||||
# Upstream Ansible
|
||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from ansible.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
|
|
|
@ -41,7 +41,7 @@ options:
|
|||
- When C(type) is C(ignore), will remove all existing actions from this
|
||||
rule.
|
||||
required: true
|
||||
choices: [ 'forward', 'enable', 'ignore' ]
|
||||
choices: ['forward', 'enable', 'ignore']
|
||||
pool:
|
||||
description:
|
||||
- Pool that you want to forward traffic to.
|
||||
|
@ -77,7 +77,7 @@ options:
|
|||
list will provide a match.
|
||||
- When C(type) is C(all_traffic), will remove all existing conditions from
|
||||
this rule.
|
||||
required: true
|
||||
required: True
|
||||
choices: [ 'http_uri', 'all_traffic' ]
|
||||
path_begins_with_any:
|
||||
description:
|
||||
|
@ -120,6 +120,7 @@ EXAMPLES = r'''
|
|||
actions:
|
||||
- type: forward
|
||||
pool: pool-svrs
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Add multiple rules to the new policy
|
||||
bigip_policy_rule:
|
||||
|
@ -127,6 +128,7 @@ EXAMPLES = r'''
|
|||
name: "{{ item.name }}"
|
||||
conditions: "{{ item.conditions }}"
|
||||
actions: "{{ item.actions }}"
|
||||
delegate_to: localhost
|
||||
loop:
|
||||
- name: rule1
|
||||
actions:
|
||||
|
@ -151,6 +153,7 @@ EXAMPLES = r'''
|
|||
- type: all_traffic
|
||||
actions:
|
||||
- type: ignore
|
||||
delegate_to: localhost
|
||||
'''
|
||||
|
||||
RETURN = r'''
|
||||
|
@ -197,30 +200,25 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils.basic import env_fallback
|
||||
from ansible.module_utils.six import iteritems
|
||||
|
||||
HAS_DEVEL_IMPORTS = False
|
||||
|
||||
try:
|
||||
# Sideband repository used for dev
|
||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from library.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from library.module_utils.network.f5.common import fq_name
|
||||
from library.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
except ImportError:
|
||||
HAS_F5SDK = False
|
||||
HAS_DEVEL_IMPORTS = True
|
||||
except ImportError:
|
||||
# Upstream Ansible
|
||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from ansible.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from ansible.module_utils.network.f5.common import fq_name
|
||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
|
@ -241,10 +239,9 @@ class Parameters(AnsibleF5Parameters):
|
|||
'actions', 'conditions', 'description'
|
||||
]
|
||||
|
||||
def _fqdn_name(self, value):
|
||||
if value is not None and not value.startswith('/'):
|
||||
return '/{0}/{1}'.format(self.partition, value)
|
||||
return value
|
||||
returnable = [
|
||||
'description'
|
||||
]
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
@ -254,13 +251,6 @@ class Parameters(AnsibleF5Parameters):
|
|||
def description(self):
|
||||
return self._values.get('description', None)
|
||||
|
||||
@property
|
||||
def strategy(self):
|
||||
if self._values['strategy'] is None:
|
||||
return None
|
||||
result = self._fqdn_name(self._values['strategy'])
|
||||
return result
|
||||
|
||||
@property
|
||||
def policy(self):
|
||||
if self._values['policy'] is None:
|
||||
|
@ -407,7 +397,7 @@ class ModuleParameters(Parameters):
|
|||
raise F5ModuleError(
|
||||
"A 'pool' must be specified when the 'forward' type is used."
|
||||
)
|
||||
action['pool'] = self._fqdn_name(item['pool'])
|
||||
action['pool'] = fq_name(self.partition, item['pool'])
|
||||
|
||||
def _handle_enable_action(self, action, item):
|
||||
"""Handle the nuances of the enable type
|
||||
|
@ -422,7 +412,7 @@ class ModuleParameters(Parameters):
|
|||
"An 'asm_policy' must be specified when the 'enable' type is used."
|
||||
)
|
||||
action.update(dict(
|
||||
policy=self._fqdn_name(item['asm_policy']),
|
||||
policy=fq_name(self.partition, item['asm_policy']),
|
||||
asm=True
|
||||
))
|
||||
|
||||
|
@ -836,9 +826,9 @@ class ArgumentSpec(object):
|
|||
'all_traffic'
|
||||
],
|
||||
required=True
|
||||
)
|
||||
),
|
||||
path_begins_with_any=dict()
|
||||
),
|
||||
path_begins_with_any=dict()
|
||||
),
|
||||
name=dict(required=True),
|
||||
policy=dict(required=True),
|
||||
|
|
|
@ -23,7 +23,7 @@ options:
|
|||
description:
|
||||
description:
|
||||
- Specifies descriptive text that identifies the pool.
|
||||
version_added: "2.3"
|
||||
version_added: 2.3
|
||||
name:
|
||||
description:
|
||||
- Pool name
|
||||
|
@ -34,7 +34,7 @@ options:
|
|||
description:
|
||||
- Load balancing method. When creating a new pool, if this value is not
|
||||
specified, the default of C(round-robin) will be used.
|
||||
version_added: "1.3"
|
||||
version_added: 1.3
|
||||
choices:
|
||||
- dynamic-ratio-member
|
||||
- dynamic-ratio-node
|
||||
|
@ -54,7 +54,7 @@ options:
|
|||
- ratio-session
|
||||
- round-robin
|
||||
- weighted-least-connections-member
|
||||
- weighted-least-connections-nod
|
||||
- weighted-least-connections-node
|
||||
monitor_type:
|
||||
description:
|
||||
- Monitor rule type when C(monitors) is specified.
|
||||
|
@ -69,32 +69,32 @@ options:
|
|||
or already existing on the device.
|
||||
- Both C(single) and C(and_list) are functionally identical since BIG-IP
|
||||
considers all monitors as "a list".
|
||||
version_added: "1.3"
|
||||
version_added: 1.3
|
||||
choices: ['and_list', 'm_of_n', 'single']
|
||||
quorum:
|
||||
description:
|
||||
- Monitor quorum value when C(monitor_type) is C(m_of_n).
|
||||
- Quorum must be a value of 1 or greater when C(monitor_type) is C(m_of_n).
|
||||
version_added: "1.3"
|
||||
version_added: 1.3
|
||||
monitors:
|
||||
description:
|
||||
- Monitor template name list. If the partition is not provided as part of
|
||||
the monitor name, then the C(partition) option will be used instead.
|
||||
version_added: "1.3"
|
||||
version_added: 1.3
|
||||
slow_ramp_time:
|
||||
description:
|
||||
- Sets the ramp-up time (in seconds) to gradually ramp up the load on
|
||||
newly added or freshly detected up pool members.
|
||||
version_added: "1.3"
|
||||
version_added: 1.3
|
||||
reselect_tries:
|
||||
description:
|
||||
- Sets the number of times the system tries to contact a pool member
|
||||
after a passive failure.
|
||||
version_added: "2.2"
|
||||
version_added: 2.2
|
||||
service_down_action:
|
||||
description:
|
||||
- Sets the action to take when node goes down in pool.
|
||||
version_added: "1.3"
|
||||
version_added: 1.3
|
||||
choices:
|
||||
- none
|
||||
- reset
|
||||
|
@ -124,6 +124,25 @@ options:
|
|||
that are numbers.
|
||||
- Data will be persisted, not ephemeral.
|
||||
version_added: 2.5
|
||||
priority_group_activation:
|
||||
description:
|
||||
- Specifies whether the system load balances traffic according to the priority
|
||||
number assigned to the pool member.
|
||||
- When creating a new pool, if this parameter is not specified, the default of
|
||||
C(0) will be used.
|
||||
- To disable this setting, provide the value C(0).
|
||||
- Once you enable this setting, you can specify pool member priority when you
|
||||
create a new pool or on a pool member's properties screen.
|
||||
- The system treats same-priority pool members as a group.
|
||||
- To enable priority group activation, provide a number from C(0) to C(65535)
|
||||
that represents the minimum number of members that must be available in one
|
||||
priority group before the system directs traffic to members in a lower
|
||||
priority group.
|
||||
- When a sufficient number of members become available in the higher priority
|
||||
group, the system again directs traffic to the higher priority group.
|
||||
aliases:
|
||||
- minimum_active_members
|
||||
version_added: 2.6
|
||||
notes:
|
||||
- Requires BIG-IP software version >= 12.
|
||||
- To add members do a pool, use the C(bigip_pool_member) module. Previously, the
|
||||
|
@ -144,7 +163,7 @@ EXAMPLES = r'''
|
|||
state: present
|
||||
name: my-pool
|
||||
partition: Common
|
||||
lb_method: least-connection-member
|
||||
lb_method: least-connections-member
|
||||
slow_ramp_time: 120
|
||||
delegate_to: localhost
|
||||
|
||||
|
@ -307,6 +326,11 @@ metadata:
|
|||
returned: changed
|
||||
type: dict
|
||||
sample: {'key1': 'foo', 'key2': 'bar'}
|
||||
priority_group_activation:
|
||||
description: The new minimum number of members to activate the priorty group.
|
||||
returned: changed
|
||||
type: int
|
||||
sample: 10
|
||||
'''
|
||||
|
||||
import re
|
||||
|
@ -315,30 +339,25 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils.basic import env_fallback
|
||||
from ansible.module_utils.six import iteritems
|
||||
|
||||
HAS_DEVEL_IMPORTS = False
|
||||
|
||||
try:
|
||||
# Sideband repository used for dev
|
||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from library.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from library.module_utils.network.f5.common import fq_name
|
||||
from library.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
except ImportError:
|
||||
HAS_F5SDK = False
|
||||
HAS_DEVEL_IMPORTS = True
|
||||
except ImportError:
|
||||
# Upstream Ansible
|
||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from ansible.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from ansible.module_utils.network.f5.common import fq_name
|
||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
|
@ -358,24 +377,26 @@ class Parameters(AnsibleF5Parameters):
|
|||
'slowRampTime': 'slow_ramp_time',
|
||||
'reselectTries': 'reselect_tries',
|
||||
'serviceDownAction': 'service_down_action',
|
||||
'monitor': 'monitors'
|
||||
'monitor': 'monitors',
|
||||
'minActiveMembers': 'priority_group_activation'
|
||||
}
|
||||
|
||||
api_attributes = [
|
||||
'description', 'name', 'loadBalancingMode', 'monitor', 'slowRampTime',
|
||||
'reselectTries', 'serviceDownAction', 'metadata'
|
||||
'reselectTries', 'serviceDownAction', 'metadata', 'minActiveMembers'
|
||||
]
|
||||
|
||||
returnables = [
|
||||
'monitor_type', 'quorum', 'monitors', 'service_down_action',
|
||||
'description', 'lb_method', 'slow_ramp_time',
|
||||
'reselect_tries', 'monitor', 'name', 'partition', 'metadata'
|
||||
'reselect_tries', 'monitor', 'name', 'partition', 'metadata',
|
||||
'priority_group_activation'
|
||||
]
|
||||
|
||||
updatables = [
|
||||
'monitor_type', 'quorum', 'monitors', 'service_down_action',
|
||||
'description', 'lb_method', 'slow_ramp_time', 'reselect_tries',
|
||||
'metadata'
|
||||
'metadata', 'priority_group_activation'
|
||||
]
|
||||
|
||||
@property
|
||||
|
@ -389,23 +410,6 @@ class Parameters(AnsibleF5Parameters):
|
|||
raise F5ModuleError('Provided lb_method is unknown')
|
||||
return lb_method
|
||||
|
||||
def _fqdn_name(self, value):
|
||||
if value is not None and not value.startswith('/'):
|
||||
return '/{0}/{1}'.format(self.partition, value)
|
||||
return value
|
||||
|
||||
@property
|
||||
def monitors(self):
|
||||
if self._values['monitors'] is None:
|
||||
return None
|
||||
monitors = [self._fqdn_name(x) for x in self.monitors_list]
|
||||
if self.monitor_type == 'm_of_n':
|
||||
monitors = ' '.join(monitors)
|
||||
result = 'min %s of { %s }' % (self.quorum, monitors)
|
||||
else:
|
||||
result = ' and '.join(monitors).strip()
|
||||
return result
|
||||
|
||||
def _verify_quorum_type(self, quorum):
|
||||
try:
|
||||
if quorum is None:
|
||||
|
@ -416,6 +420,24 @@ class Parameters(AnsibleF5Parameters):
|
|||
"The specified 'quorum' must be an integer."
|
||||
)
|
||||
|
||||
@property
|
||||
def monitors(self):
|
||||
if self._values['monitors'] is None:
|
||||
return None
|
||||
monitors = [fq_name(self.partition, x) for x in self.monitors_list]
|
||||
if self.monitor_type == 'm_of_n':
|
||||
monitors = ' '.join(monitors)
|
||||
result = 'min %s of { %s }' % (self.quorum, monitors)
|
||||
else:
|
||||
result = ' and '.join(monitors).strip()
|
||||
return result
|
||||
|
||||
@property
|
||||
def priority_group_activation(self):
|
||||
if self._values['priority_group_activation'] is None:
|
||||
return None
|
||||
return int(self._values['priority_group_activation'])
|
||||
|
||||
|
||||
class ApiParameters(Parameters):
|
||||
@property
|
||||
|
@ -447,7 +469,7 @@ class ApiParameters(Parameters):
|
|||
if self._values['monitors'] is None:
|
||||
return []
|
||||
try:
|
||||
result = re.findall(r'/\w+/[^\s}]+', self._values['monitors'])
|
||||
result = re.findall(r'/[\w-]+/[^\s}]+', self._values['monitors'])
|
||||
return result
|
||||
except Exception:
|
||||
return self._values['monitors']
|
||||
|
@ -534,7 +556,7 @@ class UsableChanges(Changes):
|
|||
class ReportableChanges(Changes):
|
||||
@property
|
||||
def monitors(self):
|
||||
result = sorted(re.findall(r'/\w+/[^\s}]+', self._values['monitors']))
|
||||
result = sorted(re.findall(r'/[\w-]+/[^\s}]+', self._values['monitors']))
|
||||
return result
|
||||
|
||||
@property
|
||||
|
@ -794,6 +816,8 @@ class ModuleManager(object):
|
|||
raise F5ModuleError(
|
||||
"When using a 'monitor_type' of 'single', only one monitor may be provided"
|
||||
)
|
||||
if self.want.priority_group_activation is None:
|
||||
self.want.update({'priority_group_activation': 0})
|
||||
|
||||
self._set_changed_options()
|
||||
if self.module.check_mode:
|
||||
|
@ -903,6 +927,10 @@ class ArgumentSpec(object):
|
|||
partition=dict(
|
||||
default='Common',
|
||||
fallback=(env_fallback, ['F5_PARTITION'])
|
||||
),
|
||||
priority_group_activation=dict(
|
||||
type='int',
|
||||
aliases=['minimum_active_members']
|
||||
)
|
||||
)
|
||||
self.argument_spec = {}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -16,8 +16,9 @@ DOCUMENTATION = r'''
|
|||
---
|
||||
module: bigip_profile_client_ssl
|
||||
short_description: Manages client SSL profiles on a BIG-IP
|
||||
description: Manages client SSL profiles on a BIG-IP.
|
||||
version_added: "2.5"
|
||||
description:
|
||||
- Manages client SSL profiles on a BIG-IP.
|
||||
version_added: 2.5
|
||||
options:
|
||||
name:
|
||||
description:
|
||||
|
@ -41,7 +42,8 @@ options:
|
|||
type of each certificate/key type. This means that you can only have one
|
||||
RSA, one DSA, and one ECDSA per profile. If you attempt to assign two
|
||||
RSA, DSA, or ECDSA certificate/key combo, the device will reject this.
|
||||
- This list is a complex list that specifies a number of keys. There are several supported keys.
|
||||
- This list is a complex list that specifies a number of keys. There are
|
||||
several supported keys.
|
||||
suboptions:
|
||||
cert:
|
||||
description:
|
||||
|
@ -131,30 +133,25 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils.basic import env_fallback
|
||||
from ansible.module_utils.six import iteritems
|
||||
|
||||
HAS_DEVEL_IMPORTS = False
|
||||
|
||||
try:
|
||||
# Sideband repository used for dev
|
||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from library.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from library.module_utils.network.f5.common import fq_name
|
||||
from library.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
except ImportError:
|
||||
HAS_F5SDK = False
|
||||
HAS_DEVEL_IMPORTS = True
|
||||
except ImportError:
|
||||
# Upstream Ansible
|
||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
||||
from ansible.module_utils.network.f5.bigip import F5Client
|
||||
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 fqdn_name
|
||||
from ansible.module_utils.network.f5.common import fq_name
|
||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||
try:
|
||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
|
@ -181,11 +178,6 @@ class Parameters(AnsibleF5Parameters):
|
|||
|
||||
|
||||
class ModuleParameters(Parameters):
|
||||
def _fqdn_name(self, value):
|
||||
if value is not None and not value.startswith('/'):
|
||||
return '/{0}/{1}'.format(self.partition, value)
|
||||
return value
|
||||
|
||||
def _key_filename(self, name):
|
||||
if name.endswith('.key'):
|
||||
return name
|
||||
|
@ -202,14 +194,14 @@ class ModuleParameters(Parameters):
|
|||
if 'chain' not in item or item['chain'] == 'none':
|
||||
result = 'none'
|
||||
else:
|
||||
result = self._cert_filename(self._fqdn_name(item['chain']))
|
||||
result = self._cert_filename(fq_name(self.partition, item['chain']))
|
||||
return result
|
||||
|
||||
@property
|
||||
def parent(self):
|
||||
if self._values['parent'] is None:
|
||||
return None
|
||||
result = self._fqdn_name(self._values['parent'])
|
||||
result = fq_name(self.partition, self._values['parent'])
|
||||
return result
|
||||
|
||||
@property
|
||||
|
@ -233,8 +225,8 @@ class ModuleParameters(Parameters):
|
|||
filename, ex = os.path.splitext(name)
|
||||
tmp = {
|
||||
'name': filename,
|
||||
'cert': self._fqdn_name(cert),
|
||||
'key': self._fqdn_name(key),
|
||||
'cert': fq_name(self.partition, cert),
|
||||
'key': fq_name(self.partition, key),
|
||||
'chain': chain
|
||||
}
|
||||
if 'passphrase' in item:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue