From 5a020e71709d789cdd8b7c1b76f4be27ccb58e5d Mon Sep 17 00:00:00 2001 From: Tim Rupp Date: Thu, 23 Aug 2018 12:50:30 -0400 Subject: [PATCH] Minor fixes and enhancements to bigip modules (#44549) Various cleanup and fixes in docs and iterations. --- .../modules/network/f5/bigip_partition.py | 4 ++- .../modules/network/f5/bigip_profile_udp.py | 2 +- .../modules/network/f5/bigip_provision.py | 2 +- .../modules/network/f5/bigip_sys_global.py | 32 +++++++++---------- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/lib/ansible/modules/network/f5/bigip_partition.py b/lib/ansible/modules/network/f5/bigip_partition.py index fb2ade5ad9..92a1f1a03b 100644 --- a/lib/ansible/modules/network/f5/bigip_partition.py +++ b/lib/ansible/modules/network/f5/bigip_partition.py @@ -341,6 +341,7 @@ class ArgumentSpec(object): def main(): + client = None spec = ArgumentSpec() module = AnsibleModule( @@ -357,7 +358,8 @@ def main(): cleanup_tokens(client) module.exit_json(**results) except F5ModuleError as ex: - cleanup_tokens(client) + if client: + cleanup_tokens(client) module.fail_json(msg=str(ex)) diff --git a/lib/ansible/modules/network/f5/bigip_profile_udp.py b/lib/ansible/modules/network/f5/bigip_profile_udp.py index 1a4bf5b60f..444131f7ae 100644 --- a/lib/ansible/modules/network/f5/bigip_profile_udp.py +++ b/lib/ansible/modules/network/f5/bigip_profile_udp.py @@ -17,7 +17,7 @@ DOCUMENTATION = r''' module: bigip_profile_udp short_description: Manage UDP profiles on a BIG-IP description: - - Manage UDP profiles on a BIG-IP. There are a variety of UDP profiles, each with their + - Manage UDP profiles on a BIG-IP. Many of UDP profiles exist; each with their own adjustments to the standard C(udp) profile. Users of this module should be aware that many of the adjustable knobs have no module default. Instead, the default is assigned by the BIG-IP system itself which, in most cases, is acceptable. diff --git a/lib/ansible/modules/network/f5/bigip_provision.py b/lib/ansible/modules/network/f5/bigip_provision.py index 3fab9d68c9..73beae6106 100644 --- a/lib/ansible/modules/network/f5/bigip_provision.py +++ b/lib/ansible/modules/network/f5/bigip_provision.py @@ -342,7 +342,7 @@ class ModuleManager(object): # Sleep a little to let rebooting take effect time.sleep(20) - while nops < 6: + while nops < 3: try: self.client.reconnect() next_reboot = self._get_last_reboot() diff --git a/lib/ansible/modules/network/f5/bigip_sys_global.py b/lib/ansible/modules/network/f5/bigip_sys_global.py index 90b03b7a5e..0d7a45bb6d 100644 --- a/lib/ansible/modules/network/f5/bigip_sys_global.py +++ b/lib/ansible/modules/network/f5/bigip_sys_global.py @@ -78,7 +78,7 @@ author: EXAMPLES = r''' - name: Disable the setup utility bigip_sys_global: - gui_setup: disabled + gui_setup: no password: secret server: lb.mydomain.com user: admin @@ -93,9 +93,9 @@ banner_text: type: string sample: This is a corporate device. Do not touch. console_timeout: - description: > - The new number of seconds of inactivity before the system - logs off a user that is logged on. + description: + - The new number of seconds of inactivity before the system + logs off a user that is logged on. returned: changed type: int sample: 600 @@ -103,36 +103,36 @@ gui_setup: description: The new setting for the Setup utility. returned: changed type: string - sample: enabled + sample: yes lcd_display: description: The new setting for displaying the system menu on the LCD. returned: changed type: string - sample: enabled + sample: yes mgmt_dhcp: description: The new setting for whether the mgmt interface should DHCP or not. returned: changed type: string - sample: enabled + sample: yes net_reboot: description: The new setting for whether the system should boot to an ISO on the network or not. returned: changed type: string - sample: enabled + sample: yes quiet_boot: - description: > - The new setting for whether the system should suppress information to - the console during boot or not. + description: + - The new setting for whether the system should suppress information to + the console during boot or not. returned: changed type: string - sample: enabled + sample: yes security_banner: - description: > - The new setting for whether the system should display an advisory message - on the login screen or not. + description: + - The new setting for whether the system should display an advisory message + on the login screen or not. returned: changed type: string - sample: enabled + sample: yes ''' from ansible.module_utils.basic import AnsibleModule