Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek0806 committed Feb 12, 2024
2 parents 9f7c277 + cea7e46 commit 9c01c52
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ This collection packages and distributes modules, and plugins.

## Requirements

- ansible >= 2.13
- ansible >= 2.14
- packaging

## Python Version Notice
Collection only supports python 3.6 and above, however F5 recommends Python 3.8 and above.
Collection only supports python 3.9 and above.

## Installation
To install in ansible default or defined paths use:
Expand Down
21 changes: 18 additions & 3 deletions ansible_collections/f5networks/f5_modules/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
==============================================
F5Networks F5_Modules Collection Release Notes
==============================================
===============================================
F5Networks F5\_Modules Collection Release Notes
===============================================

.. contents:: Topics

v1.28.0
=======

Bugfixes
--------

- bigip_gtm_monitor_bigip - fixed an issue where IP and port were not applied correctly when creating new monitor.
- bigip_gtm_monitor_firepass - fixed an issue where IP and port were not applied correctly when creating new monitor.
- bigip_gtm_monitor_http - fixed an issue where IP and port were not applied correctly when creating new monitor.
- bigip_gtm_monitor_https- fixed an issue where IP and port were not applied correctly when creating new monitor.
- bigip_gtm_monitor_tcp - fixed an issue where IP and port were not applied correctly when creating new monitor.
- bigip_gtm_monitor_tcp_half_open - fixed an issue where IP and port were not applied correctly when creating new monitor.
- bigip_gtm_topology_region - fixed an issue where if multiple states with spaces in values were defined, module would throw invalid command error
- bigip_gtm_topology_region - fixed an issue where states names that contained spaces caused the idempotency to break.
- bigip_ssl_key_cert - fixed an issue where the passphrase was not being properly send to the BIG-IP.

v1.27.1
=======
Expand Down
4 changes: 2 additions & 2 deletions ansible_collections/f5networks/f5_modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ This collection packages and distributes modules, and plugins.

## Requirements

- ansible >= 2.13
- ansible >= 2.14
- packaging

## Python Version Notice
Collection only supports python 3.6 and above, however F5 recommends Python 3.8 and above.
Collection only supports python 3.9 and above.

## Installation
To install in ansible default or defined paths use:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,32 @@ releases:
fragments:
- bigiq-device-discovery-doc-changes.yaml
release_date: '2023-11-23'
1.28.0:
changes:
bugfixes:
- bigip_gtm_monitor_bigip - fixed an issue where IP and port were not applied
correctly when creating new monitor.
- bigip_gtm_monitor_firepass - fixed an issue where IP and port were not applied
correctly when creating new monitor.
- bigip_gtm_monitor_http - fixed an issue where IP and port were not applied
correctly when creating new monitor.
- bigip_gtm_monitor_https- fixed an issue where IP and port were not applied
correctly when creating new monitor.
- bigip_gtm_monitor_tcp - fixed an issue where IP and port were not applied
correctly when creating new monitor.
- bigip_gtm_monitor_tcp_half_open - fixed an issue where IP and port were not
applied correctly when creating new monitor.
- bigip_gtm_topology_region - fixed an issue where if multiple states with spaces
in values were defined, module would throw invalid command error
- bigip_gtm_topology_region - fixed an issue where states names that contained
spaces caused the idempotency to break.
- bigip_ssl_key_cert - fixed an issue where the passphrase was not being properly
send to the BIG-IP.
fragments:
- fix-gtm-monitors.yaml
- fix-gtm-topo-region.yaml
- fix-ssl-key-cert-passphrase-bug.yaml
release_date: '2024-02-12'
1.3.0:
changes:
bugfixes:
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/f5networks/f5_modules/galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ tags:
- networking
- bigip
- bigiq
version: 1.27.1
version: 1.28.0
2 changes: 1 addition & 1 deletion ansible_collections/f5networks/f5_modules/meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
requires_ansible: '>=2.13.0'
requires_ansible: '>=2.14.0'
plugin_routing:
modules:
bigip_device_facts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

# This collection version needs to be updated at each release
CURRENT_COLL_VERSION = "1.27.1"
CURRENT_COLL_VERSION = "1.28.0"
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@ def to_return(self):


class UsableChanges(Changes):
@property
def destination(self):
if self.ip is None and self.port is None:
return None
destination = '{0}:{1}'.format(self.ip, self.port)
return destination

@property
def ignore_down_response(self):
if self._values['ignore_down_response']:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,13 @@ def to_return(self):


class UsableChanges(Changes):
@property
def destination(self):
if self.ip is None and self.port is None:
return None
destination = '{0}:{1}'.format(self.ip, self.port)
return destination

@property
def ignore_down_response(self):
if self._values['ignore_down_response'] is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def timeout(self):
return int(self._values['timeout'])

@property
def ip(self): # lgtm [py/similar-function]
def ip(self):
if self._values['ip'] is None:
return None
if self._values['ip'] in ['*', '0.0.0.0']:
Expand Down Expand Up @@ -440,6 +440,13 @@ def to_return(self):


class UsableChanges(Changes):
@property
def destination(self):
if self.ip is None and self.port is None:
return None
destination = '{0}:{1}'.format(self.ip, self.port)
return destination

@property
def transparent(self):
if self._values['transparent'] is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,13 @@ def to_return(self):


class UsableChanges(Changes):
@property
def destination(self):
if self.ip is None and self.port is None:
return None
destination = '{0}:{1}'.format(self.ip, self.port)
return destination

@property
def transparent(self):
if self._values['transparent'] is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,13 @@ def to_return(self):


class UsableChanges(Changes):
@property
def destination(self):
if self.ip is None and self.port is None:
return None
destination = '{0}:{1}'.format(self.ip, self.port)
return destination

@property
def transparent(self):
if self._values['transparent'] is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ def to_return(self):


class UsableChanges(Changes):
@property
def destination(self):
if self.ip is None and self.port is None:
return None
destination = '{0}:{1}'.format(self.ip, self.port)
return destination

@property
def transparent(self):
if self._values['transparent']:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
type: list
sample: [{"continent": "EU"}, {"country": "PL"}]
'''

import copy
from datetime import datetime

Expand Down Expand Up @@ -195,9 +194,15 @@ def region_members(self):
members = self._values['region_members']
if members is None:
return None
result = [member['name'] for member in members]
result = [self._replace_quotes(member['name']) for member in members]
return result

@staticmethod
def _replace_quotes(value):
# we need to remove the double quotes from the items on the list so that comparison engine
# does not return change
return value.replace('"', '')


class ModuleParameters(Parameters):
countries = {
Expand Down Expand Up @@ -502,13 +507,6 @@ def region_members(self):
result.append(item)
return result

def _flatten_negate(self, item):
result = flatten_boolean(item['negate'])
item.pop('negate')
if result == 'yes':
return 'not'
return None

def _change_value(self, key, value):
if key in ['region', 'pool', 'datacenter']:
return key, fq_name(self.partition, value)
Expand All @@ -524,7 +522,8 @@ def _change_value(self, key, value):
return key, self._test_subnet(value)
return key, value

def _test_subnet(self, item):
@staticmethod
def _test_subnet(item):
if item is None:
return None
if is_valid_ip_network(item):
Expand All @@ -533,6 +532,14 @@ def _test_subnet(self, item):
"Specified 'subnet' is not a valid subnet."
)

@staticmethod
def _flatten_negate(item):
result = flatten_boolean(item['negate'])
item.pop('negate')
if result == 'yes':
return 'not'
return None


class Changes(Parameters):
def to_return(self):
Expand All @@ -554,7 +561,17 @@ def region_members(self):
return None
if not members:
return 'none'
return ' '.join(members)
result = [self.escape_spaces(member) for member in members]
return ' '.join(result)

@staticmethod
def escape_spaces(item):
# this method is needed as the API has problems in handling spaces and using just double quotes causes
# api to complain about quote imbalance
if item.startswith('state ') and ' ' in item[len('state '):]:
return item[:len('state ')] + '\\"{0}\\"'.format(item[len('state '):])
else:
return item


class ReportableChanges(Changes):
Expand Down Expand Up @@ -733,6 +750,7 @@ def create_on_device(self):
self.client.provider['server'],
self.client.provider['server_port']
)

resp = self.client.api.post(uri, json=payload)
try:
response = resp.json()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ def _prepare_links_for_update(self, params_dict):
)
key_params_dict = params_dict.copy()
key_params_dict['sourcePath'] = self.want.key_source_path
if self.want.passphrase:
key_params_dict['passphrase'] = self.want.passphrase
links_and_params.append({'link': key_link, 'params': key_params_dict})

if self.want.cert_name:
Expand Down Expand Up @@ -612,6 +614,8 @@ def _prepare_links_for_create(self, params_dict):
key_params_dict = params_dict.copy()
key_params_dict['name'] = self.want.key_filename
key_params_dict['sourcePath'] = self.want.key_source_path + "_key"
if self.want.passphrase:
key_params_dict['passphrase'] = self.want.passphrase
links_and_params.append({'link': key_link, 'params': key_params_dict})

if self.want.cert_name:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
plugins/action/bigip.py action-plugin-docs # undocumented action plugin to fix, existed before sanity test was added
plugins/action/bigiq.py action-plugin-docs # undocumented action plugin to fix, existed before sanity test was added
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DictDataLoader(DataLoader):

def __init__(self, file_mapping=None):
file_mapping = {} if file_mapping is None else file_mapping
assert type(file_mapping) == dict
assert type(file_mapping) is dict

super(DictDataLoader, self).__init__()

Expand Down

0 comments on commit 9c01c52

Please sign in to comment.