mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Fixes F5 conventions and adds features (#39189)
This patch fixes a number of convention changes in F5 modules. Additionally, it adds some features to bigip vlan and other modules
This commit is contained in:
parent
4aac0f5f18
commit
19d229a8e0
9 changed files with 91 additions and 93 deletions
|
@ -24,7 +24,7 @@ description:
|
||||||
Your other parameters will be ignored in this case. Changing the C(root)
|
Your other parameters will be ignored in this case. Changing the C(root)
|
||||||
password is not an idempotent operation. Therefore, it will change it
|
password is not an idempotent operation. Therefore, it will change it
|
||||||
every time this module attempts to change it.
|
every time this module attempts to change it.
|
||||||
version_added: "2.4"
|
version_added: 2.4
|
||||||
options:
|
options:
|
||||||
full_name:
|
full_name:
|
||||||
description:
|
description:
|
||||||
|
@ -70,7 +70,7 @@ options:
|
||||||
- C(always) will allow to update passwords if the user chooses to do so.
|
- C(always) will allow to update passwords if the user chooses to do so.
|
||||||
C(on_create) will only set the password for newly created users. When
|
C(on_create) will only set the password for newly created users. When
|
||||||
C(username_credential) is C(root), this value will be forced to C(always).
|
C(username_credential) is C(root), this value will be forced to C(always).
|
||||||
default: on_create
|
default: always
|
||||||
choices:
|
choices:
|
||||||
- always
|
- always
|
||||||
- on_create
|
- on_create
|
||||||
|
@ -196,30 +196,23 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.basic import env_fallback
|
from ansible.module_utils.basic import env_fallback
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
HAS_DEVEL_IMPORTS = False
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Sideband repository used for dev
|
|
||||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
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.bigip import F5Client
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
||||||
from library.module_utils.network.f5.common import cleanup_tokens
|
from library.module_utils.network.f5.common import cleanup_tokens
|
||||||
from library.module_utils.network.f5.common import fqdn_name
|
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
try:
|
try:
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_F5SDK = False
|
HAS_F5SDK = False
|
||||||
HAS_DEVEL_IMPORTS = True
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Upstream Ansible
|
|
||||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
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.bigip import F5Client
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
||||||
from ansible.module_utils.network.f5.common import cleanup_tokens
|
from ansible.module_utils.network.f5.common import cleanup_tokens
|
||||||
from ansible.module_utils.network.f5.common import fqdn_name
|
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
try:
|
try:
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
|
|
|
@ -20,7 +20,7 @@ description:
|
||||||
- Manages vCMP guests on a BIG-IP. This functionality only exists on
|
- Manages vCMP guests on a BIG-IP. This functionality only exists on
|
||||||
actual hardware and must be enabled by provisioning C(vcmp) with the
|
actual hardware and must be enabled by provisioning C(vcmp) with the
|
||||||
C(bigip_provision) module.
|
C(bigip_provision) module.
|
||||||
version_added: "2.5"
|
version_added: 2.5
|
||||||
options:
|
options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
|
@ -68,6 +68,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- When C(state) is C(absent), will additionally delete the virtual disk associated
|
- When C(state) is C(absent), will additionally delete the virtual disk associated
|
||||||
with the vCMP guest. By default, this value is C(no).
|
with the vCMP guest. By default, this value is C(no).
|
||||||
|
type: bool
|
||||||
default: no
|
default: no
|
||||||
mgmt_address:
|
mgmt_address:
|
||||||
description:
|
description:
|
||||||
|
@ -179,33 +180,30 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.basic import env_fallback
|
from ansible.module_utils.basic import env_fallback
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
HAS_DEVEL_IMPORTS = False
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Sideband repository used for dev
|
|
||||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
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.bigip import F5Client
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
||||||
from library.module_utils.network.f5.common import cleanup_tokens
|
from library.module_utils.network.f5.common import 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
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
try:
|
try:
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
|
from f5.utils.responses.handlers import Stats
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_F5SDK = False
|
HAS_F5SDK = False
|
||||||
HAS_DEVEL_IMPORTS = True
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Upstream Ansible
|
|
||||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
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.bigip import F5Client
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
||||||
from ansible.module_utils.network.f5.common import cleanup_tokens
|
from ansible.module_utils.network.f5.common import 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
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
try:
|
try:
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
|
from f5.utils.responses.handlers import Stats
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_F5SDK = False
|
HAS_F5SDK = False
|
||||||
|
|
||||||
|
@ -215,11 +213,6 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_NETADDR = False
|
HAS_NETADDR = False
|
||||||
|
|
||||||
try:
|
|
||||||
from f5.utils.responses.handlers import Stats
|
|
||||||
except ImportError:
|
|
||||||
HAS_F5SDK = False
|
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
api_map = {
|
api_map = {
|
||||||
|
@ -246,11 +239,6 @@ class Parameters(AnsibleF5Parameters):
|
||||||
'state'
|
'state'
|
||||||
]
|
]
|
||||||
|
|
||||||
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):
|
def to_return(self):
|
||||||
result = {}
|
result = {}
|
||||||
try:
|
try:
|
||||||
|
@ -318,7 +306,7 @@ class Parameters(AnsibleF5Parameters):
|
||||||
def vlans(self):
|
def vlans(self):
|
||||||
if self._values['vlans'] is None:
|
if self._values['vlans'] is None:
|
||||||
return None
|
return None
|
||||||
result = [self._fqdn_name(x) for x in self._values['vlans']]
|
result = [fq_name(self.partition, x) for x in self._values['vlans']]
|
||||||
result.sort()
|
result.sort()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -439,11 +427,6 @@ class ModuleManager(object):
|
||||||
version=warning['version']
|
version=warning['version']
|
||||||
)
|
)
|
||||||
|
|
||||||
def _fqdn_name(self, value):
|
|
||||||
if value is not None and not value.startswith('/'):
|
|
||||||
return '/{0}/{1}'.format(self.partition, value)
|
|
||||||
return value
|
|
||||||
|
|
||||||
def present(self):
|
def present(self):
|
||||||
if self.exists():
|
if self.exists():
|
||||||
return self.update()
|
return self.update()
|
||||||
|
|
|
@ -18,14 +18,20 @@ module: bigip_virtual_address
|
||||||
short_description: Manage LTM virtual addresses on a BIG-IP
|
short_description: Manage LTM virtual addresses on a BIG-IP
|
||||||
description:
|
description:
|
||||||
- Manage LTM virtual addresses on a BIG-IP.
|
- Manage LTM virtual addresses on a BIG-IP.
|
||||||
version_added: "2.4"
|
version_added: 2.4
|
||||||
options:
|
options:
|
||||||
|
name:
|
||||||
|
description:
|
||||||
|
- Name of the virtual address.
|
||||||
|
- If this parameter is not provided, then the value of C(address) will
|
||||||
|
be used.
|
||||||
|
version_added: 2.6
|
||||||
address:
|
address:
|
||||||
description:
|
description:
|
||||||
- Virtual address. This value cannot be modified after it is set.
|
- Virtual address. This value cannot be modified after it is set.
|
||||||
required: True
|
- If you never created a virtual address, but did create virtual servers, then
|
||||||
aliases:
|
a virtual address for each virtual server was created automatically. The name
|
||||||
- name
|
of this virtual address is its IP address value.
|
||||||
netmask:
|
netmask:
|
||||||
description:
|
description:
|
||||||
- Netmask of the provided virtual address. This value cannot be
|
- Netmask of the provided virtual address. This value cannot be
|
||||||
|
@ -192,30 +198,25 @@ from ansible.module_utils.basic import env_fallback
|
||||||
from ansible.module_utils.parsing.convert_bool import BOOLEANS_TRUE
|
from ansible.module_utils.parsing.convert_bool import BOOLEANS_TRUE
|
||||||
from ansible.module_utils.parsing.convert_bool import BOOLEANS_FALSE
|
from ansible.module_utils.parsing.convert_bool import BOOLEANS_FALSE
|
||||||
|
|
||||||
HAS_DEVEL_IMPORTS = False
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Sideband repository used for dev
|
|
||||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
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.bigip import F5Client
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
||||||
from library.module_utils.network.f5.common import cleanup_tokens
|
from library.module_utils.network.f5.common import 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
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
try:
|
try:
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_F5SDK = False
|
HAS_F5SDK = False
|
||||||
HAS_DEVEL_IMPORTS = True
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Upstream Ansible
|
|
||||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
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.bigip import F5Client
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
||||||
from ansible.module_utils.network.f5.common import cleanup_tokens
|
from ansible.module_utils.network.f5.common import 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
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
try:
|
try:
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
|
@ -243,12 +244,12 @@ class Parameters(AnsibleF5Parameters):
|
||||||
|
|
||||||
updatables = [
|
updatables = [
|
||||||
'use_route_advertisement', 'auto_delete', 'icmp_echo', 'connection_limit',
|
'use_route_advertisement', 'auto_delete', 'icmp_echo', 'connection_limit',
|
||||||
'arp_state', 'enabled', 'advertise_route', 'traffic_group'
|
'arp_state', 'enabled', 'advertise_route', 'traffic_group', 'address'
|
||||||
]
|
]
|
||||||
|
|
||||||
returnables = [
|
returnables = [
|
||||||
'use_route_advertisement', 'auto_delete', 'icmp_echo', 'connection_limit',
|
'use_route_advertisement', 'auto_delete', 'icmp_echo', 'connection_limit',
|
||||||
'netmask', 'arp_state', 'address', 'state'
|
'netmask', 'arp_state', 'address', 'state', 'traffic_group'
|
||||||
]
|
]
|
||||||
|
|
||||||
api_attributes = [
|
api_attributes = [
|
||||||
|
@ -256,11 +257,6 @@ class Parameters(AnsibleF5Parameters):
|
||||||
'advertiseRoute', 'arp', 'mask', 'enabled', 'serverScope', 'trafficGroup'
|
'advertiseRoute', 'arp', 'mask', 'enabled', 'serverScope', 'trafficGroup'
|
||||||
]
|
]
|
||||||
|
|
||||||
def _fqdn_name(self, value):
|
|
||||||
if value is not None and not value.startswith('/'):
|
|
||||||
return '/{0}/{1}'.format(self.partition, value)
|
|
||||||
return value
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def advertise_route(self):
|
def advertise_route(self):
|
||||||
if self._values['advertise_route'] is None:
|
if self._values['advertise_route'] is None:
|
||||||
|
@ -351,7 +347,7 @@ class Parameters(AnsibleF5Parameters):
|
||||||
if self._values['traffic_group'] is None:
|
if self._values['traffic_group'] is None:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
result = self._fqdn_name(self._values['traffic_group'])
|
result = fq_name(self.partition, self._values['traffic_group'])
|
||||||
if result.startswith('/Common/'):
|
if result.startswith('/Common/'):
|
||||||
return result
|
return result
|
||||||
else:
|
else:
|
||||||
|
@ -367,10 +363,30 @@ class Parameters(AnsibleF5Parameters):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
class ApiParameters(Parameters):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ModuleParameters(Parameters):
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
if self._values['name'] is None:
|
||||||
|
return str(self.address)
|
||||||
|
return self._values['name']
|
||||||
|
|
||||||
|
|
||||||
class Changes(Parameters):
|
class Changes(Parameters):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class UsableChanges(Changes):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ReportableChanges(Changes):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Difference(object):
|
class Difference(object):
|
||||||
def __init__(self, want, have=None):
|
def __init__(self, want, have=None):
|
||||||
self.want = want
|
self.want = want
|
||||||
|
@ -403,8 +419,8 @@ class ModuleManager(object):
|
||||||
self.module = kwargs.get('module', None)
|
self.module = kwargs.get('module', None)
|
||||||
self.client = kwargs.get('client', None)
|
self.client = kwargs.get('client', None)
|
||||||
self.have = None
|
self.have = None
|
||||||
self.want = Parameters(client=self.client, params=self.module.params)
|
self.want = ModuleParameters(client=self.client, params=self.module.params)
|
||||||
self.changes = Changes()
|
self.changes = UsableChanges()
|
||||||
|
|
||||||
def _set_changed_options(self):
|
def _set_changed_options(self):
|
||||||
changed = {}
|
changed = {}
|
||||||
|
@ -412,7 +428,7 @@ class ModuleManager(object):
|
||||||
if getattr(self.want, key) is not None:
|
if getattr(self.want, key) is not None:
|
||||||
changed[key] = getattr(self.want, key)
|
changed[key] = getattr(self.want, key)
|
||||||
if changed:
|
if changed:
|
||||||
self.changes = Changes(params=changed)
|
self.changes = UsableChanges(params=changed)
|
||||||
|
|
||||||
def _update_changed_options(self):
|
def _update_changed_options(self):
|
||||||
diff = Difference(self.want, self.have)
|
diff = Difference(self.want, self.have)
|
||||||
|
@ -428,7 +444,7 @@ class ModuleManager(object):
|
||||||
else:
|
else:
|
||||||
changed[k] = change
|
changed[k] = change
|
||||||
if changed:
|
if changed:
|
||||||
self.changes = Changes(params=changed)
|
self.changes = UsableChanges(params=changed)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -470,15 +486,15 @@ class ModuleManager(object):
|
||||||
|
|
||||||
def read_current_from_device(self):
|
def read_current_from_device(self):
|
||||||
resource = self.client.api.tm.ltm.virtual_address_s.virtual_address.load(
|
resource = self.client.api.tm.ltm.virtual_address_s.virtual_address.load(
|
||||||
name=self.want.address,
|
name=self.want.name,
|
||||||
partition=self.want.partition
|
partition=self.want.partition
|
||||||
)
|
)
|
||||||
result = resource.attrs
|
result = resource.attrs
|
||||||
return Parameters(params=result)
|
return ApiParameters(params=result)
|
||||||
|
|
||||||
def exists(self):
|
def exists(self):
|
||||||
result = self.client.api.tm.ltm.virtual_address_s.virtual_address.exists(
|
result = self.client.api.tm.ltm.virtual_address_s.virtual_address.exists(
|
||||||
name=self.want.address,
|
name=self.want.name,
|
||||||
partition=self.want.partition
|
partition=self.want.partition
|
||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
|
@ -505,9 +521,9 @@ class ModuleManager(object):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def update_on_device(self):
|
def update_on_device(self):
|
||||||
params = self.want.api_params()
|
params = self.changes.api_params()
|
||||||
resource = self.client.api.tm.ltm.virtual_address_s.virtual_address.load(
|
resource = self.client.api.tm.ltm.virtual_address_s.virtual_address.load(
|
||||||
name=self.want.address,
|
name=self.want.name,
|
||||||
partition=self.want.partition
|
partition=self.want.partition
|
||||||
)
|
)
|
||||||
resource.modify(**params)
|
resource.modify(**params)
|
||||||
|
@ -525,9 +541,9 @@ class ModuleManager(object):
|
||||||
raise F5ModuleError("Failed to create the virtual address")
|
raise F5ModuleError("Failed to create the virtual address")
|
||||||
|
|
||||||
def create_on_device(self):
|
def create_on_device(self):
|
||||||
params = self.want.api_params()
|
params = self.changes.api_params()
|
||||||
self.client.api.tm.ltm.virtual_address_s.virtual_address.create(
|
self.client.api.tm.ltm.virtual_address_s.virtual_address.create(
|
||||||
name=self.want.address,
|
name=self.want.name,
|
||||||
partition=self.want.partition,
|
partition=self.want.partition,
|
||||||
address=self.want.address,
|
address=self.want.address,
|
||||||
**params
|
**params
|
||||||
|
@ -543,7 +559,7 @@ class ModuleManager(object):
|
||||||
|
|
||||||
def remove_from_device(self):
|
def remove_from_device(self):
|
||||||
resource = self.client.api.tm.ltm.virtual_address_s.virtual_address.load(
|
resource = self.client.api.tm.ltm.virtual_address_s.virtual_address.load(
|
||||||
name=self.want.address,
|
name=self.want.name,
|
||||||
partition=self.want.partition
|
partition=self.want.partition
|
||||||
)
|
)
|
||||||
resource.delete()
|
resource.delete()
|
||||||
|
@ -557,11 +573,8 @@ class ArgumentSpec(object):
|
||||||
default='present',
|
default='present',
|
||||||
choices=['present', 'absent', 'disabled', 'enabled']
|
choices=['present', 'absent', 'disabled', 'enabled']
|
||||||
),
|
),
|
||||||
address=dict(
|
name=dict(),
|
||||||
type='str',
|
address=dict(),
|
||||||
required=True,
|
|
||||||
aliases=['name']
|
|
||||||
),
|
|
||||||
netmask=dict(
|
netmask=dict(
|
||||||
type='str',
|
type='str',
|
||||||
default='255.255.255.255',
|
default='255.255.255.255',
|
||||||
|
@ -593,6 +606,9 @@ class ArgumentSpec(object):
|
||||||
self.argument_spec = {}
|
self.argument_spec = {}
|
||||||
self.argument_spec.update(f5_argument_spec)
|
self.argument_spec.update(f5_argument_spec)
|
||||||
self.argument_spec.update(argument_spec)
|
self.argument_spec.update(argument_spec)
|
||||||
|
self.required_one_of = [
|
||||||
|
['name', 'address']
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -18,7 +18,7 @@ module: bigip_vlan
|
||||||
short_description: Manage VLANs on a BIG-IP system
|
short_description: Manage VLANs on a BIG-IP system
|
||||||
description:
|
description:
|
||||||
- Manage VLANs on a BIG-IP system
|
- Manage VLANs on a BIG-IP system
|
||||||
version_added: "2.2"
|
version_added: 2.2
|
||||||
options:
|
options:
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
|
@ -71,6 +71,17 @@ options:
|
||||||
specifies that the default CMP hash uses L4 ports.
|
specifies that the default CMP hash uses L4 ports.
|
||||||
- When creating a new VLAN, if this parameter is not specified, the default
|
- When creating a new VLAN, if this parameter is not specified, the default
|
||||||
of C(default) is used.
|
of C(default) is used.
|
||||||
|
choices:
|
||||||
|
- default
|
||||||
|
- destination-address
|
||||||
|
- source-address
|
||||||
|
- dst-ip
|
||||||
|
- src-ip
|
||||||
|
- dest
|
||||||
|
- destination
|
||||||
|
- source
|
||||||
|
- dst
|
||||||
|
- src
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
dag_tunnel:
|
dag_tunnel:
|
||||||
description:
|
description:
|
||||||
|
@ -82,6 +93,9 @@ options:
|
||||||
of C(outer) is used.
|
of C(outer) is used.
|
||||||
- This parameter is not supported on Virtual Editions of BIG-IP.
|
- This parameter is not supported on Virtual Editions of BIG-IP.
|
||||||
version_added: 2.5
|
version_added: 2.5
|
||||||
|
choices:
|
||||||
|
- inner
|
||||||
|
- outer
|
||||||
dag_round_robin:
|
dag_round_robin:
|
||||||
description:
|
description:
|
||||||
- Specifies whether some of the stateless traffic on the VLAN should be
|
- Specifies whether some of the stateless traffic on the VLAN should be
|
||||||
|
@ -187,27 +201,22 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.basic import env_fallback
|
from ansible.module_utils.basic import env_fallback
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Sideband repository used for dev
|
|
||||||
from library.module_utils.network.f5.bigip import HAS_F5SDK
|
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.bigip import F5Client
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
||||||
from library.module_utils.network.f5.common import cleanup_tokens
|
from library.module_utils.network.f5.common import cleanup_tokens
|
||||||
from library.module_utils.network.f5.common import fqdn_name
|
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
try:
|
try:
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_F5SDK = False
|
HAS_F5SDK = False
|
||||||
HAS_DEVEL_IMPORTS = True
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Upstream Ansible
|
|
||||||
from ansible.module_utils.network.f5.bigip import HAS_F5SDK
|
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.bigip import F5Client
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
||||||
from ansible.module_utils.network.f5.common import cleanup_tokens
|
from ansible.module_utils.network.f5.common import cleanup_tokens
|
||||||
from ansible.module_utils.network.f5.common import fqdn_name
|
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
try:
|
try:
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
|
|
|
@ -1172,10 +1172,7 @@ lib/ansible/modules/network/f5/bigip_static_route.py E325
|
||||||
lib/ansible/modules/network/f5/bigip_sys_global.py E326
|
lib/ansible/modules/network/f5/bigip_sys_global.py E326
|
||||||
lib/ansible/modules/network/f5/bigip_ucs.py E325
|
lib/ansible/modules/network/f5/bigip_ucs.py E325
|
||||||
lib/ansible/modules/network/f5/bigip_ucs.py E326
|
lib/ansible/modules/network/f5/bigip_ucs.py E326
|
||||||
lib/ansible/modules/network/f5/bigip_user.py E324
|
|
||||||
lib/ansible/modules/network/f5/bigip_vcmp_guest.py E325
|
|
||||||
lib/ansible/modules/network/f5/bigip_virtual_server.py E326
|
lib/ansible/modules/network/f5/bigip_virtual_server.py E326
|
||||||
lib/ansible/modules/network/f5/bigip_vlan.py E326
|
|
||||||
lib/ansible/modules/network/f5/bigiq_regkey_license.py E325
|
lib/ansible/modules/network/f5/bigiq_regkey_license.py E325
|
||||||
lib/ansible/modules/network/fortimanager/fmgr_script.py E324
|
lib/ansible/modules/network/fortimanager/fmgr_script.py E324
|
||||||
lib/ansible/modules/network/fortios/fortios_address.py E324
|
lib/ansible/modules/network/fortios/fortios_address.py E324
|
||||||
|
|
|
@ -21,11 +21,11 @@ from ansible.compat.tests.mock import patch
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.bigip_user import Parameters
|
from library.modules.bigip_user import Parameters
|
||||||
from library.bigip_user import ModuleManager
|
from library.modules.bigip_user import ModuleManager
|
||||||
from library.bigip_user import ArgumentSpec
|
from library.modules.bigip_user import ArgumentSpec
|
||||||
from library.bigip_user import UnparitionedManager
|
from library.modules.bigip_user import UnparitionedManager
|
||||||
from library.bigip_user import PartitionedManager
|
from library.modules.bigip_user import PartitionedManager
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
from test.unit.modules.utils import set_module_args
|
from test.unit.modules.utils import set_module_args
|
||||||
|
|
|
@ -21,9 +21,9 @@ from ansible.compat.tests.mock import patch
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.bigip_vcmp_guest import Parameters
|
from library.modules.bigip_vcmp_guest import Parameters
|
||||||
from library.bigip_vcmp_guest import ModuleManager
|
from library.modules.bigip_vcmp_guest import ModuleManager
|
||||||
from library.bigip_vcmp_guest import ArgumentSpec
|
from library.modules.bigip_vcmp_guest import ArgumentSpec
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
from test.unit.modules.utils import set_module_args
|
from test.unit.modules.utils import set_module_args
|
||||||
|
|
|
@ -20,9 +20,9 @@ from ansible.compat.tests.mock import patch
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.bigip_virtual_address import Parameters
|
from library.modules.bigip_virtual_address import Parameters
|
||||||
from library.bigip_virtual_address import ModuleManager
|
from library.modules.bigip_virtual_address import ModuleManager
|
||||||
from library.bigip_virtual_address import ArgumentSpec
|
from library.modules.bigip_virtual_address import ArgumentSpec
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
from test.unit.modules.utils import set_module_args
|
from test.unit.modules.utils import set_module_args
|
||||||
|
|
|
@ -20,10 +20,10 @@ from ansible.compat.tests.mock import patch
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.bigip_vlan import ApiParameters
|
from library.modules.bigip_vlan import ApiParameters
|
||||||
from library.bigip_vlan import ModuleParameters
|
from library.modules.bigip_vlan import ModuleParameters
|
||||||
from library.bigip_vlan import ModuleManager
|
from library.modules.bigip_vlan import ModuleManager
|
||||||
from library.bigip_vlan import ArgumentSpec
|
from library.modules.bigip_vlan import ArgumentSpec
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||||
from test.unit.modules.utils import set_module_args
|
from test.unit.modules.utils import set_module_args
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue