From 05920b92d65f9a8a0e63286e2db95f2c76f39520 Mon Sep 17 00:00:00 2001 From: Tim Rupp Date: Thu, 23 Aug 2018 15:57:08 -0400 Subject: [PATCH] Misc fixes to bigip modules. (#44594) Adding docs, formatting docs, adding validation checks and values --- .../modules/network/f5/bigip_configsync_action.py | 5 +++++ lib/ansible/modules/network/f5/bigip_device_dns.py | 2 +- .../network/f5/bigip_device_group_member.py | 2 +- .../modules/network/f5/bigip_device_license.py | 14 ++++++++------ .../modules/network/f5/bigip_routedomain.py | 5 +++-- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/lib/ansible/modules/network/f5/bigip_configsync_action.py b/lib/ansible/modules/network/f5/bigip_configsync_action.py index 05f9d1394f..e573df7553 100644 --- a/lib/ansible/modules/network/f5/bigip_configsync_action.py +++ b/lib/ansible/modules/network/f5/bigip_configsync_action.py @@ -285,6 +285,11 @@ class ModuleManager(object): pass elif status == 'In Sync': return + elif status == 'Disconnected': + raise F5ModuleError( + "One or more devices are unreachable (disconnected). " + "Resolve any communication problems before attempting to sync." + ) else: raise F5ModuleError(status) diff --git a/lib/ansible/modules/network/f5/bigip_device_dns.py b/lib/ansible/modules/network/f5/bigip_device_dns.py index d3834d43f5..e1aec2ce54 100644 --- a/lib/ansible/modules/network/f5/bigip_device_dns.py +++ b/lib/ansible/modules/network/f5/bigip_device_dns.py @@ -17,7 +17,7 @@ DOCUMENTATION = r''' module: bigip_device_dns short_description: Manage BIG-IP device DNS settings description: - - Manage BIG-IP device DNS settings + - Manage BIG-IP device DNS settings. version_added: 2.2 options: cache: diff --git a/lib/ansible/modules/network/f5/bigip_device_group_member.py b/lib/ansible/modules/network/f5/bigip_device_group_member.py index 15c23645df..8ce8917dd2 100644 --- a/lib/ansible/modules/network/f5/bigip_device_group_member.py +++ b/lib/ansible/modules/network/f5/bigip_device_group_member.py @@ -36,7 +36,7 @@ options: required: True state: description: - - When C(present), ensures that the device group member. + - When C(present), ensures that the device group member exists. - When C(absent), ensures the device group member is removed. default: present choices: diff --git a/lib/ansible/modules/network/f5/bigip_device_license.py b/lib/ansible/modules/network/f5/bigip_device_license.py index 2b6e36b187..cd6f016b91 100644 --- a/lib/ansible/modules/network/f5/bigip_device_license.py +++ b/lib/ansible/modules/network/f5/bigip_device_license.py @@ -61,18 +61,20 @@ author: EXAMPLES = ''' - name: License BIG-IP using a key bigip_device_license: - server: "lb.mydomain.com" - user: "admin" - password: "secret" license_key: "XXXXX-XXXXX-XXXXX-XXXXX-XXXXXXX" + provider: + server: "lb.mydomain.com" + user: "admin" + password: "secret" delegate_to: localhost - name: Remove the license from the system bigip_device_license: - server: "lb.mydomain.com" - user: "admin" - password: "secret" state: "absent" + provider: + server: "lb.mydomain.com" + user: "admin" + password: "secret" delegate_to: localhost ''' diff --git a/lib/ansible/modules/network/f5/bigip_routedomain.py b/lib/ansible/modules/network/f5/bigip_routedomain.py index 2f19cd51bc..d1596d47be 100644 --- a/lib/ansible/modules/network/f5/bigip_routedomain.py +++ b/lib/ansible/modules/network/f5/bigip_routedomain.py @@ -61,6 +61,7 @@ options: description: - Dynamic routing protocols for the system to use in the route domain. choices: + - none - BFD - BGP - IS-IS @@ -322,7 +323,7 @@ class ModuleParameters(Parameters): def routing_protocol(self): if self._values['routing_protocol'] is None: return None - if len(self._values['routing_protocol']) == 1 and self._values['routing_protocol'][0] == '': + if len(self._values['routing_protocol']) == 1 and self._values['routing_protocol'][0] in ['', 'none']: return '' return self._values['routing_protocol'] @@ -578,7 +579,7 @@ class ArgumentSpec(object): vlans=dict(type='list'), routing_protocol=dict( type='list', - choices=['BFD', 'BGP', 'IS-IS', 'OSPFv2', 'OSPFv3', 'PIM', 'RIP', 'RIPng'] + choices=['BFD', 'BGP', 'IS-IS', 'OSPFv2', 'OSPFv3', 'PIM', 'RIP', 'RIPng', 'none'] ), bwc_policy=dict(), connection_limit=dict(type='int'),