From 12689935065226a355a7166d759eb437cc5ae94a Mon Sep 17 00:00:00 2001 From: Wojciech Wypior Date: Fri, 2 Aug 2019 22:09:20 -0700 Subject: [PATCH] added previously omitted parameter in gtm topology module (#60015) --- .../network/f5/bigip_gtm_topology_region.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/ansible/modules/network/f5/bigip_gtm_topology_region.py b/lib/ansible/modules/network/f5/bigip_gtm_topology_region.py index e1d9568960a..4cf784e68dd 100644 --- a/lib/ansible/modules/network/f5/bigip_gtm_topology_region.py +++ b/lib/ansible/modules/network/f5/bigip_gtm_topology_region.py @@ -38,6 +38,11 @@ options: - Only a single list entry can be specified together with negate. type: bool default: no + subnet: + description: + - An IP address and network mask in the CIDR format. + type: str + version_added: 2.9 region: description: - Specifies the name of region already defined in the configuration. @@ -167,6 +172,7 @@ try: from library.module_utils.network.f5.common import f5_argument_spec from library.module_utils.network.f5.common import flatten_boolean from library.module_utils.network.f5.compare import cmp_simple_list + from library.module_utils.network.f5.ipaddress import is_valid_ip_network except ImportError: from ansible.module_utils.network.f5.bigip import F5RestClient from ansible.module_utils.network.f5.common import F5ModuleError @@ -176,6 +182,7 @@ except ImportError: from ansible.module_utils.network.f5.common import f5_argument_spec from ansible.module_utils.network.f5.common import flatten_boolean from ansible.module_utils.network.f5.compare import cmp_simple_list + from ansible.module_utils.network.f5.ipaddress import is_valid_ip_network class Parameters(AnsibleF5Parameters): @@ -531,8 +538,19 @@ class ModuleParameters(Parameters): return key, self.countries.get(value, value) if key == 'geo_isp': return 'geoip-isp', value + if key == 'subnet': + return key, self._test_subnet(value) return key, value + def _test_subnet(self, item): + if item is None: + return None + if is_valid_ip_network(item): + return item + raise F5ModuleError( + "Specified 'subnet' is not a valid subnet." + ) + class Changes(Parameters): def to_return(self): @@ -822,6 +840,7 @@ class ArgumentSpec(object): type='list', elements='dict', options=dict( + subnet=dict(), region=dict(), continent=dict(), country=dict(),