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:
Tim Rupp
2018-04-25 07:16:11 -07:00
committed by GitHub
parent 1c49cc4377
commit fb264281de
19 changed files with 1232 additions and 532 deletions

View File

@@ -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