1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Removes bigip_provision from skip file (#32525)

This commit is contained in:
Tim Rupp 2017-11-02 17:40:41 -07:00 committed by GitHub
parent 5b1db00b65
commit 45787f6ef2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 20 deletions

View file

@ -21,7 +21,7 @@ description:
standard levels of Dedicated, Nominal, and Minimum.
version_added: "2.4"
options:
module:
name:
description:
- The module to provision in BIG-IP.
required: true
@ -40,6 +40,8 @@ options:
- sam
- swg
- vcmp
aliases:
- module
level:
description:
- Sets the provisioning level for the requested modules. Changing the
@ -109,9 +111,9 @@ from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import AnsibleF5Parameters
from ansible.module_utils.f5_utils import HAS_F5SDK
from ansible.module_utils.f5_utils import F5ModuleError
from f5.sdk_exception import LazyAttributesRequired
try:
from f5.sdk_exception import LazyAttributesRequired
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError:
HAS_F5SDK = False
@ -207,11 +209,16 @@ class ModuleManager(object):
return False
if self.client.check_mode:
return True
self.update_on_device()
self._wait_for_module_provisioning()
if self.want.module == 'vcmp':
self._wait_for_reboot()
self._wait_for_module_provisioning()
if self.want.module == 'asm':
self._wait_for_asm_ready()
return True
def should_update(self):
@ -294,6 +301,26 @@ class ModuleManager(object):
pass
return False
def _wait_for_asm_ready(self):
"""Waits specifically for ASM
On older versions, ASM can take longer to actually start up than
all the previous checks take. This check here is specifically waiting for
the Policies API to stop raising errors
:return:
"""
nops = 0
while nops < 3:
try:
policies = self.client.api.tm.asm.policies_s.get_collection()
if len(policies) >= 0:
nops += 1
else:
nops = 0
except Exception:
pass
time.sleep(5)
def _get_last_reboot(self):
output = self.client.api.tm.util.bash.exec_cmd(
'run',
@ -339,7 +366,8 @@ class ArgumentSpec(object):
'afm', 'am', 'sam', 'asm', 'avr', 'fps',
'gtm', 'lc', 'ltm', 'pem', 'swg', 'ilx',
'apm', 'vcmp'
]
],
aliases=['name']
),
level=dict(
default='nominal',

View file

@ -14,7 +14,6 @@ lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py
lib/ansible/modules/cloud/webfaction/webfaction_site.py
lib/ansible/modules/clustering/consul_acl.py
lib/ansible/modules/network/cloudengine/ce_file_copy.py
lib/ansible/modules/network/f5/bigip_provision.py
lib/ansible/modules/network/f5/bigip_qkview.py
lib/ansible/modules/network/f5/bigip_snmp.py
lib/ansible/modules/network/ios/ios_static_route.py

View file

@ -1,21 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type