Skip to content

Commit

Permalink
Version 1.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
urohit011 committed Dec 4, 2024
1 parent bc8f39f commit 98bef70
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 22 deletions.
8 changes: 8 additions & 0 deletions ansible_collections/f5networks/next/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ F5Networks F5 BIG-IP Next Collection Release Notes

.. contents:: Topics

v1.5.0
======

Minor Changes
-------------

- cm_next_as3_deploy - fixed issue of AS3 Idempotency

v1.4.0
======

Expand Down
109 changes: 109 additions & 0 deletions ansible_collections/f5networks/next/changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
objects:
role: {}
plugins:
become: {}
cache: {}
callback: {}
cliconf: {}
connection: {}
filter: {}
httpapi:
cm:
description: HttpApi Plugin for BIG-IP Next Central Manager devices
name: cm
version_added: 1.0.0
inventory: {}
lookup: {}
module:
cm_backup_restore:
description: Backup and restore CM configuration
name: cm_backup_restore
namespace: ''
version_added: 1.0.0
cm_device_info:
description: Collect information from CM devices
name: cm_device_info
namespace: ''
version_added: 1.0.0
cm_files:
description: Manage files uploads/deletes on BIG-IP Next CM
name: cm_files
namespace: ''
version_added: 1.0.0
cm_next_as3_deploy:
description: Manages Deploying an AS3 declaration to a specified instance managed
by BIG-IP Next Central Manager.
name: cm_next_as3_deploy
namespace: ''
version_added: 1.0.0
cm_next_backup_restore:
description: Backup and restore BIG-IP Next instance configration through CM
name: cm_next_backup_restore
namespace: ''
version_added: 1.0.0
cm_next_deploy_f5os:
description: Module to manage deployments of BIG-IP Next instances on F5OS devices
name: cm_next_deploy_f5os
namespace: ''
version_added: 1.0.0
cm_next_deploy_vmware:
description: Module to manage deployments of BIG-IP Next instances on VMWARE
name: cm_next_deploy_vmware
namespace: ''
version_added: 1.0.0
cm_next_discover:
description: Module to Add/Delete BIG-IP Next Instances onto Central Manager
name: cm_next_discover
namespace: ''
version_added: 1.0.0
cm_next_files:
description: Manage BIG-IP Next instance files through CM
name: cm_next_files
namespace: ''
version_added: 1.0.0
cm_next_global_resiliency_group:
description: Manages Global Resiliency Group on the Central Manager.
name: cm_next_global_resiliency_group
namespace: ''
version_added: 1.0.0
cm_next_ha:
description: Configure High Availability for BIG-IP Next instances.
name: cm_next_ha
namespace: ''
version_added: 1.0.0
cm_next_ha_failover:
description: Fail-over BIG-IP Next HA instance on CM
name: cm_next_ha_failover
namespace: ''
version_added: 1.0.0
cm_next_license:
description: Manage license activation and deactivation of BIG-IP Next instances.
name: cm_next_license
namespace: ''
version_added: 1.3.0
cm_next_provider:
description: Manage providers on Central Manager
name: cm_next_provider
namespace: ''
version_added: 1.0.0
cm_next_upgrade:
description: Manage BIG-IP Next instance upgrades through CM
name: cm_next_upgrade
namespace: ''
version_added: 1.0.0
cm_ssl_certificate_create:
description: Manages certificate and/or key on the Central Manager.
name: cm_ssl_certificate_create
namespace: ''
version_added: 1.0.0
cm_ssl_certificate_import:
description: Manages certificate, key and PKCS12 on the Central Manager.
name: cm_ssl_certificate_import
namespace: ''
version_added: 1.0.0
netconf: {}
shell: {}
strategy: {}
test: {}
vars: {}
version: 1.5.0
7 changes: 7 additions & 0 deletions ansible_collections/f5networks/next/changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,10 @@ releases:
release_date: '2024-09-13'
1.4.0:
release_date: '2024-10-24'
1.5.0:
changes:
minor_changes:
- cm_next_as3_deploy - fixed issue of AS3 Idempotency
fragments:
- fix_as3_idempotency.yaml
release_date: '2024-12-04'
2 changes: 1 addition & 1 deletion ansible_collections/f5networks/next/galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ tags:
- networking
- next
- cm
version: 1.5.0-devel
version: 1.5.0
2 changes: 1 addition & 1 deletion ansible_collections/f5networks/next/plugins/httpapi/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def send_request(self, **kwargs):
data = json.dumps(body) if body or body == {} else None
try:
self._log_api_call(method, url, body)
self.send_log(f"URL:{url}")
self.send_log(f"URL: {url}")
response, response_data = self.connection.send(url, data, method=method, **kwargs)
response_value = self._get_response_value(response_data)
return dict(
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.5.0-devel"
CURRENT_COLL_VERSION = "1.5.0"
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class Parameters(AnsibleF5Parameters):
class ApiParameters(Parameters):
@property
def content(self):
if self._values['contents'].get('app_data') is None:
return self._values['contents'].get('request')
return self._values['contents'].get('app_data')

@property
Expand Down Expand Up @@ -264,7 +266,8 @@ def exec_module(self):
def present(self):
if self.exists():
return self.update()
return self.create()
else:
return self.create()

def update(self):
self.have = self.get_deployed_appsvc()
Expand Down Expand Up @@ -297,10 +300,7 @@ def absent(self):
def remove(self):
if self.module.check_mode: # pragma: no cover
return True
result = self.remove_from_device()
if self.exists():
raise F5ModuleError("Failed to delete the resource.")
return result
return self.remove_from_device()

def exists(self):
declaration = {}
Expand All @@ -319,8 +319,9 @@ def exists(self):
self.app_name = self.filter_app(self.want.content)
self.log_message(f"[exists] app name: {self.app_name}")

uri = (f"/applications?select=health,id,instances,name,gslb_enabled,fqdn,security_policies,type,tenant_name,"
f"modified,successful_instances,deployments_count&filter=name+eq+'{self.app_name}'")
# uri = (f"/applications?select=health,id,instances,name,gslb_enabled,fqdn,security_policies,type,tenant_name,"
# f"modified,successful_instances,deployments_count&filter=name+eq+'{self.app_name}'")
uri = (f"/applications?filter=name+eq+'{self.app_name}'")
self.log_message(f"[exists] uri: {uri}")
response = self.client.get(uri, scope=self.scope)
self.log_message(f"[exists] response code: {response['code']}")
Expand All @@ -329,8 +330,8 @@ def exists(self):
self.log_message(f"[exists] contents: {response['contents']}")
if response['contents']['count'] == 0:
return False
# if '_embedded' not in response['contents']:
# return False
if '_embedded' not in response['contents']:
return False
results = response['contents']['_embedded']['applications']
for key, val in results[0].items():
if key == "id":
Expand Down Expand Up @@ -447,6 +448,11 @@ def remove_from_device(self):
if response['code'] not in [200, 201, 202, 204, 207]:
raise F5ModuleError(response['contents'])
self.log_message(f"[remove_from_device]resp: {response.get('contents')}")
for x in range(0, period):
response = self.client.get(uri, scope=self.scope)
if response['code'] in [404]:
return True
time.sleep(delay)
return True

def filter_app(self, content):
Expand Down Expand Up @@ -494,7 +500,7 @@ def main():
try:
mm = ModuleManager(module=module, connection=Connection(module._socket_path))
mm.log_message(f"content: {mm.want.content}")
mm.log_message(f"app_name:{mm.want.app_name}")
mm.log_message(f"app_name: {mm.want.app_name}")
results = mm.exec_module()
module.exit_json(**results)
except F5ModuleError as ex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ def task_exists(self):
response = self.client.get(uri)

if response['code'] == 404:
self.log_message(f"The specified deployment task:{self.want.task_id} was not found.", 'error')
raise F5ModuleError(f"The specified deployment task:{self.want.task_id} was not found.")
self.log_message(f"The specified deployment task: {self.want.task_id} was not found.", 'error')
raise F5ModuleError(f"The specified deployment task: {self.want.task_id} was not found.")

if response['code'] not in [200, 201, 202]:
raise F5ModuleError(response['contents'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ def task_exists(self):
response = self.client.get(uri)

if response['code'] == 404:
self.log_message(f"The specified deployment task:{self.want.task_id} was not found.", 'error')
raise F5ModuleError(f"The specified deployment task:{self.want.task_id} was not found.")
self.log_message(f"The specified deployment task: {self.want.task_id} was not found.", 'error')
raise F5ModuleError(f"The specified deployment task: {self.want.task_id} was not found.")

if response['code'] not in [200, 201, 202]:
raise F5ModuleError(response['contents'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def file_exists(self):

if response['code'] not in [200, 201, 202]:
raise F5ModuleError(response['contents'])
self.log_message(f"Response:{response['contents']}")
self.log_message(f"Response: {response['contents']}")
if any([response['contents'].get('count', 0) == 0, not response['contents'].get('_embedded')]):
self.log_message("No file found")
return False
Expand Down Expand Up @@ -341,7 +341,7 @@ def create_on_device(self):
uri = f"/api/v1/spaces/default/instances/{self.device_uuid}/proxy-file-upload"
response = self.client.plugin.send_multipart(uri, form)

self.log_message(f"Response:{response['contents']}")
self.log_message(f"Response: {response['contents']}")

if response['code'] not in [200, 201, 202, 204]:
raise F5ModuleError(response['contents'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def host(self):
return None
port = self.port
if port:
return f"{self._values['address']}:{port}"
return f"{self._values['address']}: {port}"
else:
return self._values['address']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_module_parameters(self):

self.assertEqual(p.name, 'ansible-rseries')
self.assertEqual(p.type, 'RSERIES')
self.assertEqual(p.host, '192.168.1.1:8888')
self.assertEqual(p.host, '192.168.1.1: 8888')
self.assertEqual(p.port, 8888)

def test_module_parameters_port_raises(self):
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_create_rseries_provider(self, *args):
))

expected = {'connection': {'authentication': {'password': 'sekrit', 'type': 'basic', 'username': 'admin'},
'host': '192.168.1.1:8888'}, 'name': 'ansible-rseries', 'type': 'RSERIES'}
'host': '192.168.1.1: 8888'}, 'name': 'ansible-rseries', 'type': 'RSERIES'}
module = AnsibleModule(
argument_spec=self.spec.argument_spec,
supports_check_mode=self.spec.supports_check_mode,
Expand Down

0 comments on commit 98bef70

Please sign in to comment.