Skip to content

Commit

Permalink
Version 1.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek0806 committed Nov 23, 2023
1 parent 78487e2 commit b8fd315
Show file tree
Hide file tree
Showing 27 changed files with 422 additions and 429 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file contains ignores rule violations for ansible-lint
ansible_collections/f5networks/f5os/changelogs/changelog.yaml yaml[indentation]
10 changes: 10 additions & 0 deletions ansible_collections/f5networks/f5os/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ F5Networks.F5OS Release Notes
.. contents:: Topics


v1.5.0
======

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

- client.py - added client property to return software version of the F5OS platform
- f5os.py - added code to fetch the software version of the F5OS platform
- teem.py - added a new field, f5SoftwareVersion to the teem data, and changed the field, F5OSPlatform to f5Platform

v1.4.0
======

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ plugins:
shell: {}
strategy: {}
vars: {}
version: 1.4.0
version: 1.5.0
10 changes: 10 additions & 0 deletions ansible_collections/f5networks/f5os/changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,13 @@ releases:
fragments:
- add-lag-info-f5os-device-info.yaml
release_date: '2023-10-12'
1.5.0:
changes:
minor_changes:
- client.py - added client property to return software version of the F5OS platform
- f5os.py - added code to fetch the software version of the F5OS platform
- teem.py - added a new field, f5SoftwareVersion to the teem data, and changed
the field, F5OSPlatform to f5Platform
fragments:
- teem-add-software-version-field.yaml
release_date: '2023-11-23'
32 changes: 16 additions & 16 deletions ansible_collections/f5networks/f5os/changelogs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ prelude_section_name: release_summary
prelude_section_title: Release Summary
sanitize_changelog: true
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: F5Networks.F5OS
trivial_section_name: trivial
use_fqcn: true
4 changes: 3 additions & 1 deletion ansible_collections/f5networks/f5os/galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ license:
name: f5os
namespace: f5networks
readme: README.md
build_ignore:
- tests
repository: https://github.com/F5Networks/f5-ansible-f5os
tags:
- f5
- networking
- rseries
- velos
version: 1.4.0
version: 1.5.0
29 changes: 29 additions & 0 deletions ansible_collections/f5networks/f5os/plugins/httpapi/f5os.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(self, connection):
self.connection = connection
self.access_token = None
self.platform_type = None
self.software_version = None

def login(self, username, password):
using_default_creds = (username == "admin") and (password == "admin")
Expand All @@ -63,6 +64,7 @@ def login(self, username, password):
self.connection._auth = {'X-Auth-Token': self.access_token}
if not using_default_creds:
self._set_platform_type()
self._set_software_version()
else:
raise AnsibleConnectionFailure('Server returned invalid response during connection authentication.')
else:
Expand Down Expand Up @@ -155,6 +157,33 @@ def _set_platform_type(self):
def get_platform_type(self):
return self.platform_type

def _rseries_software_version(self):
uri = ROOT + '/openconfig-system:system/f5-system-version:version'
response = self.send_request(path=uri, method='GET', headers=BASE_HEADERS)
if response['code'] != 200:
raise F5ModuleError(response['contents'])
version = response['contents']['f5-system-version:version']['os-version']
return version

def _velos_software_version(self):
uri = ROOT + '/openconfig-platform:components/component'
response = self.send_request(path=uri, method='GET', headers=BASE_HEADERS)
if response['code'] != 200:
raise F5ModuleError(response['contents'])

res = response['contents']
version = res['openconfig-platform:component'][0]['f5-platform:software']['state']['software-components']['software-component'][0]['state']['version']
return version

def _set_software_version(self):
if self.platform_type == 'Velos Partition':
self.software_version = self._velos_software_version()
elif self.platform_type == 'rSeries Platform':
self.software_version = self._rseries_software_version()

def get_software_version(self):
return self.software_version


def _check_seek_raising(error):
# small helper function to catch seek unsupported operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def ansible_version(self):
def module_name(self):
return self.module._name

@property
def software_version(self):
return self.plugin.get_software_version()


def send_teem(client, start_time):
""" Sends Teem Data if allowed."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def build_telemetry(self):
if 'f5networks' in module_name:
module_name = module_name.split('.')[2]
platform = self.f5client.platform
software_version = self.f5client.software_version
ansible_version = self.f5client.ansible_version
python_version = sys.version.split(' ', maxsplit=1)[0]
self.in_ci, ci_name = in_cicd()
Expand All @@ -101,7 +102,8 @@ def build_telemetry(self):
'CollectionName': f'{self.coll_name}',
'CollectionVersion': CURRENT_COLL_VERSION,
'CollectionModuleName': module_name,
'F5OSPlatform': platform,
'f5Platform': platform,
'f5SoftwareVersion': software_version,
'ControllerAnsibleVersion': ansible_version,
'ControllerPythonVersion': python_version,
'ControllerAsDocker': self.docker,
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.4.0"
CURRENT_COLL_VERSION = "1.5.0"
Original file line number Diff line number Diff line change
Expand Up @@ -80,40 +80,27 @@
'''

EXAMPLES = r'''
- hosts: all
collections:
- f5networks.f5os
connection: httpapi
vars:
ansible_host: "lb.mydomain.com"
ansible_user: "admin"
ansible_httpapi_password: "secret"
ansible_network_os: f5networks.f5os.f5os
ansible_httpapi_use_ssl: yes
tasks:
- name: Create backup config and import it to remote server
f5os_config_backup:
name: foo
remote_host: builds.mydomain.com
remote_path: /uploads/upload.php
timeout: 300
state: present
- name: Recreate existing backup file and upload it to remote server
f5os_config_backup:
name: foo
remote_host: builds.mydomain.com
remote_path: /uploads/upload.php
timeout: 300
force: true
state: present
- name: Remove backup file
f5os_config_backup:
name: foo
state: absent
- name: Create backup config and import it to remote server
f5os_config_backup:
name: foo
remote_host: builds.mydomain.com
remote_path: /uploads/upload.php
timeout: 300
state: present
- name: Recreate existing backup file and upload it to remote server
f5os_config_backup:
name: foo
remote_host: builds.mydomain.com
remote_path: /uploads/upload.php
timeout: 300
force: true
state: present
- name: Remove backup file
f5os_config_backup:
name: foo
state: absent
'''
RETURN = r'''
remote_host:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,22 @@
'''

EXAMPLES = r'''
- hosts: all
collections:
- f5networks.f5os
connection: httpapi
vars:
ansible_host: "lb.mydomain.com"
ansible_user: "admin"
ansible_httpapi_password: "secret"
ansible_network_os: f5networks.f5os.f5os
ansible_httpapi_use_ssl: yes
tasks:
- name: Collect interface and vlan information on F5OS device
f5os_device_info:
gather_subset:
- interfaces
- vlans
- name: Collect all F5OS device information
f5os_device_info:
gather_subset:
- all
- name: Collect all F5OS device information except system-info
f5os_device_info:
gather_subset:
- all
- "!system-info"
- name: Collect interface and vlan information on F5OS device
f5os_device_info:
gather_subset:
- interfaces
- vlans
- name: Collect all F5OS device information
f5os_device_info:
gather_subset:
- all
- name: Collect all F5OS device information except system-info
f5os_device_info:
gather_subset:
- all
- "!system-info"
'''
RETURN = r'''
lag_interfaces:
Expand Down
Loading

0 comments on commit b8fd315

Please sign in to comment.