mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Add new parameters to bigip monitor modules (#48520)
This commit is contained in:
parent
240d2baebd
commit
1e57b91c35
19 changed files with 642 additions and 172 deletions
|
@ -355,12 +355,13 @@ try:
|
||||||
from library.module_utils.network.f5.common import fq_name
|
from library.module_utils.network.f5.common import fq_name
|
||||||
from library.module_utils.network.f5.common import f5_argument_spec
|
from library.module_utils.network.f5.common import f5_argument_spec
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
from library.module_utils.network.f5.common import flatten_boolean
|
|
||||||
from library.module_utils.network.f5.common import exit_json
|
from library.module_utils.network.f5.common import exit_json
|
||||||
from library.module_utils.network.f5.common import fail_json
|
from library.module_utils.network.f5.common import fail_json
|
||||||
|
from library.module_utils.network.f5.common import flatten_boolean
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
from library.module_utils.network.f5.ipaddress import validate_ip_v6_address
|
from library.module_utils.network.f5.ipaddress import validate_ip_v6_address
|
||||||
from library.module_utils.network.f5.ipaddress import validate_ip_address
|
from library.module_utils.network.f5.ipaddress import validate_ip_address
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
|
@ -369,12 +370,13 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import fq_name
|
from ansible.module_utils.network.f5.common import fq_name
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
from ansible.module_utils.network.f5.common import flatten_boolean
|
|
||||||
from ansible.module_utils.network.f5.common import exit_json
|
from ansible.module_utils.network.f5.common import exit_json
|
||||||
from ansible.module_utils.network.f5.common import fail_json
|
from ansible.module_utils.network.f5.common import fail_json
|
||||||
|
from ansible.module_utils.network.f5.common import flatten_boolean
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
from ansible.module_utils.network.f5.ipaddress import validate_ip_v6_address
|
from ansible.module_utils.network.f5.ipaddress import validate_ip_v6_address
|
||||||
from ansible.module_utils.network.f5.ipaddress import validate_ip_address
|
from ansible.module_utils.network.f5.ipaddress import validate_ip_address
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -549,10 +551,22 @@ class Parameters(AnsibleF5Parameters):
|
||||||
|
|
||||||
|
|
||||||
class ApiParameters(Parameters):
|
class ApiParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def manual_resume(self):
|
def manual_resume(self):
|
||||||
if self._values['manual_resume'] is None:
|
if self._values['manual_resume'] is None:
|
||||||
|
@ -605,35 +619,19 @@ class UsableChanges(Changes):
|
||||||
class ReportableChanges(Changes):
|
class ReportableChanges(Changes):
|
||||||
@property
|
@property
|
||||||
def manual_resume(self):
|
def manual_resume(self):
|
||||||
if self._values['manual_resume'] is None:
|
return flatten_boolean(self._values['manual_resume'])
|
||||||
return None
|
|
||||||
elif self._values['manual_resume'] == 'enabled':
|
|
||||||
return 'yes'
|
|
||||||
return 'no'
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def reverse(self):
|
def reverse(self):
|
||||||
if self._values['reverse'] is None:
|
return flatten_boolean(self._values['reverse'])
|
||||||
return None
|
|
||||||
elif self._values['reverse'] == 'enabled':
|
|
||||||
return 'yes'
|
|
||||||
return 'no'
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def transparent(self):
|
def transparent(self):
|
||||||
if self._values['transparent'] is None:
|
return flatten_boolean(self._values['transparent'])
|
||||||
return None
|
|
||||||
elif self._values['transparent'] == 'enabled':
|
|
||||||
return 'yes'
|
|
||||||
return 'no'
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def adaptive(self):
|
def adaptive(self):
|
||||||
if self._values['adaptive'] is None:
|
return flatten_boolean(self._values['adaptive'])
|
||||||
return None
|
|
||||||
elif self._values['adaptive'] == 'enabled':
|
|
||||||
return 'yes'
|
|
||||||
return 'no'
|
|
||||||
|
|
||||||
|
|
||||||
class Difference(object):
|
class Difference(object):
|
||||||
|
@ -701,6 +699,10 @@ class Difference(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return attr1
|
return attr1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
@ -998,6 +1000,7 @@ def main():
|
||||||
argument_spec=spec.argument_spec,
|
argument_spec=spec.argument_spec,
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
client = F5RestClient(**module.params)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||||
'status': ['preview'],
|
'status': ['preview'],
|
||||||
'supported_by': 'certified'}
|
'supported_by': 'certified'}
|
||||||
|
@ -176,6 +177,7 @@ try:
|
||||||
from library.module_utils.network.f5.common import fail_json
|
from library.module_utils.network.f5.common import fail_json
|
||||||
from library.module_utils.network.f5.common import compare_dictionary
|
from library.module_utils.network.f5.common import compare_dictionary
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
|
@ -188,6 +190,7 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import exit_json
|
from ansible.module_utils.network.f5.common import exit_json
|
||||||
from ansible.module_utils.network.f5.common import fail_json
|
from ansible.module_utils.network.f5.common import fail_json
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -199,18 +202,35 @@ class Parameters(AnsibleF5Parameters):
|
||||||
}
|
}
|
||||||
|
|
||||||
api_attributes = [
|
api_attributes = [
|
||||||
'defaultsFrom', 'interval', 'timeout', 'destination', 'run', 'args',
|
'defaultsFrom',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'destination',
|
||||||
|
'run',
|
||||||
|
'args',
|
||||||
'description',
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
returnables = [
|
returnables = [
|
||||||
'parent', 'ip', 'port', 'interval', 'timeout', 'variables', 'external_program',
|
'parent',
|
||||||
'arguments', 'description',
|
'ip',
|
||||||
|
'port',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'variables',
|
||||||
|
'external_program',
|
||||||
|
'arguments',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
updatables = [
|
updatables = [
|
||||||
'destination', 'interval', 'timeout', 'variables', 'external_program',
|
'destination',
|
||||||
'arguments', 'description',
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'variables',
|
||||||
|
'external_program',
|
||||||
|
'arguments',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -279,6 +299,12 @@ class Parameters(AnsibleF5Parameters):
|
||||||
|
|
||||||
|
|
||||||
class ApiParameters(Parameters):
|
class ApiParameters(Parameters):
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def variables(self):
|
def variables(self):
|
||||||
if self._values['variables'] is None:
|
if self._values['variables'] is None:
|
||||||
|
@ -297,6 +323,14 @@ class ApiParameters(Parameters):
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def variables(self):
|
def variables(self):
|
||||||
if self._values['variables'] is None:
|
if self._values['variables'] is None:
|
||||||
|
@ -425,6 +459,10 @@ class Difference(object):
|
||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 F5 Networks Inc.
|
# Copyright: (c) 2017, F5 Networks Inc.
|
||||||
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# 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
|
from __future__ import absolute_import, division, print_function
|
||||||
|
@ -85,6 +85,17 @@ options:
|
||||||
target_password:
|
target_password:
|
||||||
description:
|
description:
|
||||||
- Specifies the password, if the monitored target requires authentication.
|
- Specifies the password, if the monitored target requires authentication.
|
||||||
|
reverse:
|
||||||
|
description:
|
||||||
|
- Specifies whether the monitor operates in reverse mode.
|
||||||
|
- When the monitor is in reverse mode, a successful receive string match
|
||||||
|
marks the monitored object down instead of up. You can use the
|
||||||
|
this mode only if you configure the C(receive) option.
|
||||||
|
- This parameter is not compatible with the C(time_until_up) parameter. If
|
||||||
|
C(time_until_up) is specified, it must be C(0). Or, if it already exists, it
|
||||||
|
must be C(0).
|
||||||
|
type: bool
|
||||||
|
version_added: 2.8
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
@ -170,6 +181,11 @@ time_until_up:
|
||||||
returned: changed
|
returned: changed
|
||||||
type: int
|
type: int
|
||||||
sample: 2
|
sample: 2
|
||||||
|
reverse:
|
||||||
|
description: Whether the monitor operates in reverse mode.
|
||||||
|
returned: changed
|
||||||
|
type: bool
|
||||||
|
sample: yes
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
@ -185,7 +201,9 @@ try:
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
from library.module_utils.network.f5.common import exit_json
|
from library.module_utils.network.f5.common import exit_json
|
||||||
from library.module_utils.network.f5.common import fail_json
|
from library.module_utils.network.f5.common import fail_json
|
||||||
|
from library.module_utils.network.f5.common import flatten_boolean
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
|
@ -196,7 +214,9 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
from ansible.module_utils.network.f5.common import exit_json
|
from ansible.module_utils.network.f5.common import exit_json
|
||||||
from ansible.module_utils.network.f5.common import fail_json
|
from ansible.module_utils.network.f5.common import fail_json
|
||||||
|
from ansible.module_utils.network.f5.common import flatten_boolean
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -208,18 +228,46 @@ class Parameters(AnsibleF5Parameters):
|
||||||
}
|
}
|
||||||
|
|
||||||
api_attributes = [
|
api_attributes = [
|
||||||
'timeUntilUp', 'defaultsFrom', 'interval', 'timeout', 'recv', 'send',
|
'timeUntilUp',
|
||||||
'destination', 'username', 'password', 'recvDisable', 'description',
|
'defaultsFrom',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'recv',
|
||||||
|
'send',
|
||||||
|
'destination',
|
||||||
|
'username',
|
||||||
|
'password',
|
||||||
|
'recvDisable',
|
||||||
|
'description',
|
||||||
|
'reverse',
|
||||||
]
|
]
|
||||||
|
|
||||||
returnables = [
|
returnables = [
|
||||||
'parent', 'send', 'receive', 'ip', 'port', 'interval', 'timeout',
|
'parent',
|
||||||
'time_until_up', 'receive_disable', 'description',
|
'send',
|
||||||
|
'receive',
|
||||||
|
'ip',
|
||||||
|
'port',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'receive_disable',
|
||||||
|
'description',
|
||||||
|
'reverse',
|
||||||
]
|
]
|
||||||
|
|
||||||
updatables = [
|
updatables = [
|
||||||
'destination', 'send', 'receive', 'interval', 'timeout', 'time_until_up',
|
'destination',
|
||||||
'target_username', 'target_password', 'receive_disable', 'description',
|
'send',
|
||||||
|
'receive',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'target_username',
|
||||||
|
'target_password',
|
||||||
|
'receive_disable',
|
||||||
|
'description',
|
||||||
|
'reverse',
|
||||||
]
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -300,13 +348,27 @@ class Parameters(AnsibleF5Parameters):
|
||||||
def password(self):
|
def password(self):
|
||||||
return self._values['target_password']
|
return self._values['target_password']
|
||||||
|
|
||||||
|
@property
|
||||||
|
def reverse(self):
|
||||||
|
return flatten_boolean(self._values['reverse'])
|
||||||
|
|
||||||
|
|
||||||
class ApiParameters(Parameters):
|
class ApiParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class Changes(Parameters):
|
class Changes(Parameters):
|
||||||
|
@ -322,11 +384,19 @@ class Changes(Parameters):
|
||||||
|
|
||||||
|
|
||||||
class UsableChanges(Changes):
|
class UsableChanges(Changes):
|
||||||
pass
|
@property
|
||||||
|
def reverse(self):
|
||||||
|
if self._values['reverse'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['reverse'] == 'yes':
|
||||||
|
return 'enabled'
|
||||||
|
return 'disabled'
|
||||||
|
|
||||||
|
|
||||||
class ReportableChanges(Changes):
|
class ReportableChanges(Changes):
|
||||||
pass
|
@property
|
||||||
|
def reverse(self):
|
||||||
|
return flatten_boolean(self._values['reverse'])
|
||||||
|
|
||||||
|
|
||||||
class Difference(object):
|
class Difference(object):
|
||||||
|
@ -395,6 +465,10 @@ class Difference(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return attr1
|
return attr1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
@ -486,6 +560,15 @@ class ModuleManager(object):
|
||||||
self.have = self.read_current_from_device()
|
self.have = self.read_current_from_device()
|
||||||
if not self.should_update():
|
if not self.should_update():
|
||||||
return False
|
return False
|
||||||
|
if self.want.reverse == 'enabled':
|
||||||
|
if not self.want.receive and not self.have.receive:
|
||||||
|
raise F5ModuleError(
|
||||||
|
"A 'receive' string must be specified when setting 'reverse'."
|
||||||
|
)
|
||||||
|
if self.want.time_until_up != 0 and self.have.time_until_up != 0:
|
||||||
|
raise F5ModuleError(
|
||||||
|
"Monitors with the 'reverse' attribute are not currently compatible with 'time_until_up'."
|
||||||
|
)
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self.update_on_device()
|
self.update_on_device()
|
||||||
|
@ -501,6 +584,15 @@ class ModuleManager(object):
|
||||||
|
|
||||||
def create(self):
|
def create(self):
|
||||||
self._set_changed_options()
|
self._set_changed_options()
|
||||||
|
if self.want.reverse == 'enabled':
|
||||||
|
if self.want.time_until_up != 0:
|
||||||
|
raise F5ModuleError(
|
||||||
|
"Monitors with the 'reverse' attribute are not currently compatible with 'time_until_up'."
|
||||||
|
)
|
||||||
|
if not self.want.receive:
|
||||||
|
raise F5ModuleError(
|
||||||
|
"A 'receive' string must be specified when setting 'reverse'."
|
||||||
|
)
|
||||||
self._set_default_creation_values()
|
self._set_default_creation_values()
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
|
@ -608,6 +700,7 @@ class ArgumentSpec(object):
|
||||||
ip=dict(),
|
ip=dict(),
|
||||||
port=dict(type='int'),
|
port=dict(type='int'),
|
||||||
interval=dict(type='int'),
|
interval=dict(type='int'),
|
||||||
|
reverse=dict(type='bool'),
|
||||||
timeout=dict(type='int'),
|
timeout=dict(type='int'),
|
||||||
time_until_up=dict(type='int'),
|
time_until_up=dict(type='int'),
|
||||||
target_username=dict(),
|
target_username=dict(),
|
||||||
|
@ -633,7 +726,9 @@ def main():
|
||||||
argument_spec=spec.argument_spec,
|
argument_spec=spec.argument_spec,
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
client = F5RestClient(**module.params)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mm = ModuleManager(module=module, client=client)
|
mm = ModuleManager(module=module, client=client)
|
||||||
results = mm.exec_module()
|
results = mm.exec_module()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 F5 Networks Inc.
|
# Copyright: (c) 2017, F5 Networks Inc.
|
||||||
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# 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
|
from __future__ import absolute_import, division, print_function
|
||||||
|
@ -85,6 +85,13 @@ options:
|
||||||
target_password:
|
target_password:
|
||||||
description:
|
description:
|
||||||
- Specifies the password, if the monitored target requires authentication.
|
- Specifies the password, if the monitored target requires authentication.
|
||||||
|
ssl_profile:
|
||||||
|
description:
|
||||||
|
- Specifies the SSL profile to use for the HTTPS monitor.
|
||||||
|
- Defining SSL profiles enables refined customization of the SSL attributes
|
||||||
|
for an HTTPS monitor.
|
||||||
|
- This parameter is only supported on BIG-IP versions 13.x and later.
|
||||||
|
version_added: 2.8
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to manage resources on.
|
||||||
|
@ -109,21 +116,23 @@ author:
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r'''
|
||||||
- name: Create HTTPS Monitor
|
- name: Create HTTPS Monitor
|
||||||
bigip_monitor_https:
|
bigip_monitor_https:
|
||||||
|
name: my_http_monitor
|
||||||
state: present
|
state: present
|
||||||
ip: 10.10.10.10
|
ip: 10.10.10.10
|
||||||
server: lb.mydomain.com
|
provider:
|
||||||
user: admin
|
server: lb.mydomain.com
|
||||||
password: secret
|
user: admin
|
||||||
name: my_http_monitor
|
password: secret
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
- name: Remove HTTPS Monitor
|
- name: Remove HTTPS Monitor
|
||||||
bigip_monitor_https:
|
bigip_monitor_https:
|
||||||
state: absent
|
|
||||||
server: lb.mydomain.com
|
|
||||||
user: admin
|
|
||||||
password: secret
|
|
||||||
name: my_http_monitor
|
name: my_http_monitor
|
||||||
|
state: absent
|
||||||
|
provider:
|
||||||
|
server: lb.mydomain.com
|
||||||
|
user: admin
|
||||||
|
password: secret
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -174,6 +183,7 @@ try:
|
||||||
from library.module_utils.network.f5.common import exit_json
|
from library.module_utils.network.f5.common import exit_json
|
||||||
from library.module_utils.network.f5.common import fail_json
|
from library.module_utils.network.f5.common import fail_json
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
||||||
|
@ -187,6 +197,7 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import fail_json
|
from ansible.module_utils.network.f5.common import fail_json
|
||||||
from ansible.module_utils.network.f5.common import f5_argument_spec
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -195,21 +206,50 @@ class Parameters(AnsibleF5Parameters):
|
||||||
'defaultsFrom': 'parent',
|
'defaultsFrom': 'parent',
|
||||||
'recv': 'receive',
|
'recv': 'receive',
|
||||||
'recvDisable': 'receive_disable',
|
'recvDisable': 'receive_disable',
|
||||||
|
'sslProfile': 'ssl_profile',
|
||||||
}
|
}
|
||||||
|
|
||||||
api_attributes = [
|
api_attributes = [
|
||||||
'timeUntilUp', 'defaultsFrom', 'interval', 'timeout', 'recv', 'send',
|
'timeUntilUp',
|
||||||
'destination', 'username', 'password', 'recvDisable', 'description',
|
'defaultsFrom',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'recv',
|
||||||
|
'send',
|
||||||
|
'destination',
|
||||||
|
'username',
|
||||||
|
'password',
|
||||||
|
'recvDisable',
|
||||||
|
'description',
|
||||||
|
'sslProfile',
|
||||||
]
|
]
|
||||||
|
|
||||||
returnables = [
|
returnables = [
|
||||||
'parent', 'send', 'receive', 'ip', 'port', 'interval', 'timeout',
|
'parent',
|
||||||
'time_until_up', 'receive_disable', 'description',
|
'send',
|
||||||
|
'receive',
|
||||||
|
'ip',
|
||||||
|
'port',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'receive_disable',
|
||||||
|
'description',
|
||||||
|
'ssl_profile',
|
||||||
]
|
]
|
||||||
|
|
||||||
updatables = [
|
updatables = [
|
||||||
'destination', 'send', 'receive', 'interval', 'timeout', 'time_until_up',
|
'destination',
|
||||||
'target_username', 'target_password', 'receive_disable', 'description',
|
'send',
|
||||||
|
'receive',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'target_username',
|
||||||
|
'target_password',
|
||||||
|
'receive_disable',
|
||||||
|
'description',
|
||||||
|
'ssl_profile',
|
||||||
]
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -291,11 +331,30 @@ class Parameters(AnsibleF5Parameters):
|
||||||
|
|
||||||
|
|
||||||
class ApiParameters(Parameters):
|
class ApiParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ssl_profile(self):
|
||||||
|
if self._values['ssl_profile'] is None:
|
||||||
|
return None
|
||||||
|
if self._values['ssl_profile'] in ['', 'none']:
|
||||||
|
return ''
|
||||||
|
result = fq_name(self.partition, self._values['ssl_profile'])
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
class Changes(Parameters):
|
class Changes(Parameters):
|
||||||
|
@ -375,6 +434,15 @@ class Difference(object):
|
||||||
if self.want.interval != self.have.interval:
|
if self.want.interval != self.have.interval:
|
||||||
return self.want.interval
|
return self.want.interval
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ssl_profile(self):
|
||||||
|
if self.want.ssl_profile is None:
|
||||||
|
return None
|
||||||
|
if self.want.ssl_profile == '' and self.have.ssl_profile is None:
|
||||||
|
return None
|
||||||
|
if self.want.ssl_profile != self.have.ssl_profile:
|
||||||
|
return self.want.ssl_profile
|
||||||
|
|
||||||
def __default(self, param):
|
def __default(self, param):
|
||||||
attr1 = getattr(self.want, param)
|
attr1 = getattr(self.want, param)
|
||||||
try:
|
try:
|
||||||
|
@ -384,6 +452,10 @@ class Difference(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return attr1
|
return attr1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
@ -601,6 +673,7 @@ class ArgumentSpec(object):
|
||||||
time_until_up=dict(type='int'),
|
time_until_up=dict(type='int'),
|
||||||
target_username=dict(),
|
target_username=dict(),
|
||||||
target_password=dict(no_log=True),
|
target_password=dict(no_log=True),
|
||||||
|
ssl_profile=dict(),
|
||||||
state=dict(
|
state=dict(
|
||||||
default='present',
|
default='present',
|
||||||
choices=['present', 'absent']
|
choices=['present', 'absent']
|
||||||
|
@ -622,6 +695,7 @@ def main():
|
||||||
argument_spec=spec.argument_spec,
|
argument_spec=spec.argument_spec,
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
client = F5RestClient(**module.params)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -241,6 +241,7 @@ try:
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
from library.module_utils.network.f5.common import flatten_boolean
|
from library.module_utils.network.f5.common import flatten_boolean
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
|
@ -253,6 +254,7 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
from ansible.module_utils.network.f5.common import flatten_boolean
|
from ansible.module_utils.network.f5.common import flatten_boolean
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -368,6 +370,12 @@ class ApiParameters(Parameters):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return port
|
return port
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
@property
|
@property
|
||||||
|
@ -425,6 +433,14 @@ class ModuleParameters(Parameters):
|
||||||
def type(self):
|
def type(self):
|
||||||
return 'ldap'
|
return 'ldap'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class Changes(Parameters):
|
class Changes(Parameters):
|
||||||
def to_return(self):
|
def to_return(self):
|
||||||
|
@ -536,6 +552,10 @@ class Difference(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return attr1
|
return attr1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 F5 Networks Inc.
|
# Copyright: (c) 2017, F5 Networks Inc.
|
||||||
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# 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
|
from __future__ import absolute_import, division, print_function
|
||||||
|
@ -135,20 +135,22 @@ author:
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r'''
|
||||||
- name: Create SNMP DCS monitor
|
- name: Create SNMP DCS monitor
|
||||||
bigip_monitor_snmp_dca:
|
bigip_monitor_snmp_dca:
|
||||||
state: present
|
|
||||||
server: lb.mydomain.com
|
|
||||||
user: admin
|
|
||||||
password: secret
|
|
||||||
name: my_monitor
|
name: my_monitor
|
||||||
|
state: present
|
||||||
|
provider:
|
||||||
|
server: lb.mydomain.com
|
||||||
|
user: admin
|
||||||
|
password: secret
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
- name: Remove TCP Echo Monitor
|
- name: Remove TCP Echo Monitor
|
||||||
bigip_monitor_snmp_dca:
|
bigip_monitor_snmp_dca:
|
||||||
state: absent
|
|
||||||
server: lb.mydomain.com
|
|
||||||
user: admin
|
|
||||||
password: secret
|
|
||||||
name: my_monitor
|
name: my_monitor
|
||||||
|
state: absent
|
||||||
|
provider:
|
||||||
|
server: lb.mydomain.com
|
||||||
|
user: admin
|
||||||
|
password: secret
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -238,7 +240,7 @@ try:
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
from library.module_utils.network.f5.common import exit_json
|
from library.module_utils.network.f5.common import exit_json
|
||||||
from library.module_utils.network.f5.common import fail_json
|
from library.module_utils.network.f5.common import fail_json
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
|
@ -249,6 +251,7 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
from ansible.module_utils.network.f5.common import exit_json
|
from ansible.module_utils.network.f5.common import exit_json
|
||||||
from ansible.module_utils.network.f5.common import fail_json
|
from ansible.module_utils.network.f5.common import fail_json
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -265,21 +268,56 @@ class Parameters(AnsibleF5Parameters):
|
||||||
}
|
}
|
||||||
|
|
||||||
api_attributes = [
|
api_attributes = [
|
||||||
'timeUntilUp', 'defaultsFrom', 'interval', 'timeout', 'destination', 'community',
|
'timeUntilUp',
|
||||||
'version', 'agentType', 'cpuCoefficient', 'cpuThreshold', 'memoryCoefficient',
|
'defaultsFrom',
|
||||||
'memoryThreshold', 'diskCoefficient', 'diskThreshold', 'description',
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'destination',
|
||||||
|
'community',
|
||||||
|
'version',
|
||||||
|
'agentType',
|
||||||
|
'cpuCoefficient',
|
||||||
|
'cpuThreshold',
|
||||||
|
'memoryCoefficient',
|
||||||
|
'memoryThreshold',
|
||||||
|
'diskCoefficient',
|
||||||
|
'diskThreshold',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
returnables = [
|
returnables = [
|
||||||
'parent', 'ip', 'interval', 'timeout', 'time_until_up', 'description', 'community',
|
'parent',
|
||||||
'version', 'agent_type', 'cpu_coefficient', 'cpu_threshold', 'memory_coefficient',
|
'ip',
|
||||||
'memory_threshold', 'disk_coefficient', 'disk_threshold',
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'description',
|
||||||
|
'community',
|
||||||
|
'version',
|
||||||
|
'agent_type',
|
||||||
|
'cpu_coefficient',
|
||||||
|
'cpu_threshold',
|
||||||
|
'memory_coefficient',
|
||||||
|
'memory_threshold',
|
||||||
|
'disk_coefficient',
|
||||||
|
'disk_threshold',
|
||||||
]
|
]
|
||||||
|
|
||||||
updatables = [
|
updatables = [
|
||||||
'ip', 'interval', 'timeout', 'time_until_up', 'description', 'community',
|
'ip',
|
||||||
'version', 'agent_type', 'cpu_coefficient', 'cpu_threshold', 'memory_coefficient',
|
'interval',
|
||||||
'memory_threshold', 'disk_coefficient', 'disk_threshold',
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'description',
|
||||||
|
'community',
|
||||||
|
'version',
|
||||||
|
'agent_type',
|
||||||
|
'cpu_coefficient',
|
||||||
|
'cpu_threshold',
|
||||||
|
'memory_coefficient',
|
||||||
|
'memory_threshold',
|
||||||
|
'disk_coefficient',
|
||||||
|
'disk_threshold',
|
||||||
]
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -358,11 +396,21 @@ class Parameters(AnsibleF5Parameters):
|
||||||
|
|
||||||
|
|
||||||
class ApiParameters(Parameters):
|
class ApiParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class Changes(Parameters):
|
class Changes(Parameters):
|
||||||
|
@ -434,6 +482,10 @@ class Difference(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return attr1
|
return attr1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 F5 Networks Inc.
|
# Copyright: (c) 2017, F5 Networks Inc.
|
||||||
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# 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
|
from __future__ import absolute_import, division, print_function
|
||||||
|
@ -105,7 +105,6 @@ EXAMPLES = r'''
|
||||||
user: admin
|
user: admin
|
||||||
password: secret
|
password: secret
|
||||||
name: my_tcp_monitor
|
name: my_tcp_monitor
|
||||||
type: tcp
|
|
||||||
send: tcp string to send
|
send: tcp string to send
|
||||||
receive: tcp string to receive
|
receive: tcp string to receive
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
@ -182,6 +181,7 @@ try:
|
||||||
from library.module_utils.network.f5.common import exit_json
|
from library.module_utils.network.f5.common import exit_json
|
||||||
from library.module_utils.network.f5.common import fail_json
|
from library.module_utils.network.f5.common import fail_json
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
||||||
|
@ -194,6 +194,7 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import exit_json
|
from ansible.module_utils.network.f5.common import exit_json
|
||||||
from ansible.module_utils.network.f5.common import fail_json
|
from ansible.module_utils.network.f5.common import fail_json
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -204,17 +205,35 @@ class Parameters(AnsibleF5Parameters):
|
||||||
}
|
}
|
||||||
|
|
||||||
api_attributes = [
|
api_attributes = [
|
||||||
'timeUntilUp', 'defaultsFrom', 'interval', 'timeout', 'recv', 'send',
|
'timeUntilUp',
|
||||||
'destination', 'description',
|
'defaultsFrom',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'recv',
|
||||||
|
'send',
|
||||||
|
'destination',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
returnables = [
|
returnables = [
|
||||||
'parent', 'send', 'receive', 'ip', 'port', 'interval', 'timeout',
|
'parent',
|
||||||
'time_until_up', 'description',
|
'send',
|
||||||
|
'receive',
|
||||||
|
'ip',
|
||||||
|
'port',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
updatables = [
|
updatables = [
|
||||||
'destination', 'send', 'receive', 'interval', 'timeout', 'time_until_up',
|
'destination',
|
||||||
|
'send',
|
||||||
|
'receive',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
'description',
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -287,11 +306,21 @@ class Parameters(AnsibleF5Parameters):
|
||||||
|
|
||||||
|
|
||||||
class ApiParameters(Parameters):
|
class ApiParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class Changes(Parameters):
|
class Changes(Parameters):
|
||||||
|
@ -380,6 +409,10 @@ class Difference(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return attr1
|
return attr1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 F5 Networks Inc.
|
# Copyright: (c) 2017, F5 Networks Inc.
|
||||||
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# 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
|
from __future__ import absolute_import, division, print_function
|
||||||
|
@ -153,6 +153,7 @@ try:
|
||||||
from library.module_utils.network.f5.common import exit_json
|
from library.module_utils.network.f5.common import exit_json
|
||||||
from library.module_utils.network.f5.common import fail_json
|
from library.module_utils.network.f5.common import fail_json
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
|
@ -163,6 +164,7 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import exit_json
|
from ansible.module_utils.network.f5.common import exit_json
|
||||||
from ansible.module_utils.network.f5.common import fail_json
|
from ansible.module_utils.network.f5.common import fail_json
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -172,16 +174,29 @@ class Parameters(AnsibleF5Parameters):
|
||||||
}
|
}
|
||||||
|
|
||||||
api_attributes = [
|
api_attributes = [
|
||||||
'timeUntilUp', 'defaultsFrom', 'interval', 'timeout', 'destination',
|
'timeUntilUp',
|
||||||
|
'defaultsFrom',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'destination',
|
||||||
'description',
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
returnables = [
|
returnables = [
|
||||||
'parent', 'ip', 'interval', 'timeout', 'time_until_up', 'description',
|
'parent',
|
||||||
|
'ip',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
updatables = [
|
updatables = [
|
||||||
'ip', 'interval', 'timeout', 'time_until_up', 'description',
|
'ip',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -244,11 +259,21 @@ class Parameters(AnsibleF5Parameters):
|
||||||
|
|
||||||
|
|
||||||
class ApiParameters(Parameters):
|
class ApiParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class Changes(Parameters):
|
class Changes(Parameters):
|
||||||
|
@ -327,6 +352,10 @@ class Difference(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return attr1
|
return attr1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
@ -555,6 +584,7 @@ def main():
|
||||||
argument_spec=spec.argument_spec,
|
argument_spec=spec.argument_spec,
|
||||||
supports_check_mode=spec.supports_check_mode,
|
supports_check_mode=spec.supports_check_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
client = F5RestClient(**module.params)
|
client = F5RestClient(**module.params)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 F5 Networks Inc.
|
# Copyright: (c) 2017, F5 Networks Inc.
|
||||||
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# 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
|
from __future__ import absolute_import, division, print_function
|
||||||
|
@ -170,6 +170,7 @@ try:
|
||||||
from library.module_utils.network.f5.common import exit_json
|
from library.module_utils.network.f5.common import exit_json
|
||||||
from library.module_utils.network.f5.common import fail_json
|
from library.module_utils.network.f5.common import fail_json
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ansible.module_utils.network.f5.bigip import F5RestClient
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
|
@ -180,6 +181,7 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import exit_json
|
from ansible.module_utils.network.f5.common import exit_json
|
||||||
from ansible.module_utils.network.f5.common import fail_json
|
from ansible.module_utils.network.f5.common import fail_json
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
|
|
||||||
|
|
||||||
class Parameters(AnsibleF5Parameters):
|
class Parameters(AnsibleF5Parameters):
|
||||||
|
@ -190,17 +192,30 @@ class Parameters(AnsibleF5Parameters):
|
||||||
}
|
}
|
||||||
|
|
||||||
api_attributes = [
|
api_attributes = [
|
||||||
'timeUntilUp', 'defaultsFrom', 'interval', 'timeout', 'destination',
|
'timeUntilUp',
|
||||||
|
'defaultsFrom',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'destination',
|
||||||
'description',
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
returnables = [
|
returnables = [
|
||||||
'parent', 'ip', 'port', 'interval', 'timeout', 'time_until_up',
|
'parent',
|
||||||
|
'ip',
|
||||||
|
'port',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
'description',
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
updatables = [
|
updatables = [
|
||||||
'destination', 'interval', 'timeout', 'time_until_up', 'description',
|
'destination',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -278,11 +293,21 @@ class Parameters(AnsibleF5Parameters):
|
||||||
|
|
||||||
|
|
||||||
class ApiParameters(Parameters):
|
class ApiParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class Changes(Parameters):
|
class Changes(Parameters):
|
||||||
|
@ -371,6 +396,10 @@ class Difference(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return attr1
|
return attr1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
@ -169,6 +169,7 @@ try:
|
||||||
from library.module_utils.network.f5.common import transform_name
|
from library.module_utils.network.f5.common import transform_name
|
||||||
from library.module_utils.network.f5.common import exit_json
|
from library.module_utils.network.f5.common import exit_json
|
||||||
from library.module_utils.network.f5.common import fail_json
|
from library.module_utils.network.f5.common import fail_json
|
||||||
|
from library.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
from library.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -181,6 +182,7 @@ except ImportError:
|
||||||
from ansible.module_utils.network.f5.common import transform_name
|
from ansible.module_utils.network.f5.common import transform_name
|
||||||
from ansible.module_utils.network.f5.common import exit_json
|
from ansible.module_utils.network.f5.common import exit_json
|
||||||
from ansible.module_utils.network.f5.common import fail_json
|
from ansible.module_utils.network.f5.common import fail_json
|
||||||
|
from ansible.module_utils.network.f5.compare import cmp_str_with_none
|
||||||
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
from ansible.module_utils.network.f5.ipaddress import is_valid_ip
|
||||||
|
|
||||||
|
|
||||||
|
@ -192,17 +194,35 @@ class Parameters(AnsibleF5Parameters):
|
||||||
}
|
}
|
||||||
|
|
||||||
api_attributes = [
|
api_attributes = [
|
||||||
'timeUntilUp', 'defaultsFrom', 'interval', 'timeout', 'recv', 'send',
|
'timeUntilUp',
|
||||||
'destination', 'description',
|
'defaultsFrom',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'recv',
|
||||||
|
'send',
|
||||||
|
'destination',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
returnables = [
|
returnables = [
|
||||||
'parent', 'send', 'receive', 'ip', 'port', 'interval', 'timeout',
|
'parent',
|
||||||
'time_until_up', 'description',
|
'send',
|
||||||
|
'receive',
|
||||||
|
'ip',
|
||||||
|
'port',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
updatables = [
|
updatables = [
|
||||||
'destination', 'send', 'receive', 'interval', 'timeout', 'time_until_up',
|
'destination',
|
||||||
|
'send',
|
||||||
|
'receive',
|
||||||
|
'interval',
|
||||||
|
'timeout',
|
||||||
|
'time_until_up',
|
||||||
'description',
|
'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -278,11 +298,21 @@ class Parameters(AnsibleF5Parameters):
|
||||||
|
|
||||||
|
|
||||||
class ApiParameters(Parameters):
|
class ApiParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] in [None, 'none']:
|
||||||
|
return None
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class ModuleParameters(Parameters):
|
class ModuleParameters(Parameters):
|
||||||
pass
|
@property
|
||||||
|
def description(self):
|
||||||
|
if self._values['description'] is None:
|
||||||
|
return None
|
||||||
|
elif self._values['description'] in ['none', '']:
|
||||||
|
return ''
|
||||||
|
return self._values['description']
|
||||||
|
|
||||||
|
|
||||||
class Changes(Parameters):
|
class Changes(Parameters):
|
||||||
|
@ -371,6 +401,10 @@ class Difference(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return attr1
|
return attr1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return cmp_str_with_none(self.want.description, self.have.description)
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
@ -8,16 +8,12 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import pytest
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from nose.plugins.skip import SkipTest
|
from nose.plugins.skip import SkipTest
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from units.compat import unittest
|
|
||||||
from units.compat.mock import Mock
|
|
||||||
from units.compat.mock import patch
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -25,17 +21,25 @@ try:
|
||||||
from library.modules.bigip_monitor_dns import ModuleParameters
|
from library.modules.bigip_monitor_dns import ModuleParameters
|
||||||
from library.modules.bigip_monitor_dns import ModuleManager
|
from library.modules.bigip_monitor_dns import ModuleManager
|
||||||
from library.modules.bigip_monitor_dns import ArgumentSpec
|
from library.modules.bigip_monitor_dns import ArgumentSpec
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
# In Ansible 2.8, Ansible changed import paths.
|
||||||
from test.unit.modules.utils import set_module_args
|
from test.units.compat import unittest
|
||||||
|
from test.units.compat.mock import Mock
|
||||||
|
from test.units.compat.mock import patch
|
||||||
|
|
||||||
|
from test.units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_monitor_dns import ApiParameters
|
from ansible.modules.network.f5.bigip_monitor_dns import ApiParameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_dns import ModuleParameters
|
from ansible.modules.network.f5.bigip_monitor_dns import ModuleParameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_dns import ModuleManager
|
from ansible.modules.network.f5.bigip_monitor_dns import ModuleManager
|
||||||
from ansible.modules.network.f5.bigip_monitor_dns import ArgumentSpec
|
from ansible.modules.network.f5.bigip_monitor_dns import ArgumentSpec
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
# Ansible 2.8 imports
|
||||||
|
from units.compat import unittest
|
||||||
|
from units.compat.mock import Mock
|
||||||
|
from units.compat.mock import patch
|
||||||
|
|
||||||
from units.modules.utils import set_module_args
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
|
@ -8,16 +8,12 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import pytest
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from nose.plugins.skip import SkipTest
|
from nose.plugins.skip import SkipTest
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from units.compat import unittest
|
|
||||||
from units.compat.mock import Mock
|
|
||||||
from units.compat.mock import patch
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -25,17 +21,25 @@ try:
|
||||||
from library.modules.bigip_monitor_external import ModuleParameters
|
from library.modules.bigip_monitor_external import ModuleParameters
|
||||||
from library.modules.bigip_monitor_external import ModuleManager
|
from library.modules.bigip_monitor_external import ModuleManager
|
||||||
from library.modules.bigip_monitor_external import ArgumentSpec
|
from library.modules.bigip_monitor_external import ArgumentSpec
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
# In Ansible 2.8, Ansible changed import paths.
|
||||||
from test.unit.modules.utils import set_module_args
|
from test.units.compat import unittest
|
||||||
|
from test.units.compat.mock import Mock
|
||||||
|
from test.units.compat.mock import patch
|
||||||
|
|
||||||
|
from test.units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_monitor_external import ApiParameters
|
from ansible.modules.network.f5.bigip_monitor_external import ApiParameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_external import ModuleParameters
|
from ansible.modules.network.f5.bigip_monitor_external import ModuleParameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_external import ModuleManager
|
from ansible.modules.network.f5.bigip_monitor_external import ModuleManager
|
||||||
from ansible.modules.network.f5.bigip_monitor_external import ArgumentSpec
|
from ansible.modules.network.f5.bigip_monitor_external import ArgumentSpec
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
# Ansible 2.8 imports
|
||||||
|
from units.compat import unittest
|
||||||
|
from units.compat.mock import Mock
|
||||||
|
from units.compat.mock import patch
|
||||||
|
|
||||||
from units.modules.utils import set_module_args
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
|
@ -15,25 +15,34 @@ from nose.plugins.skip import SkipTest
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from units.compat import unittest
|
|
||||||
from units.compat.mock import Mock
|
|
||||||
from units.compat.mock import patch
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.modules.bigip_monitor_http import Parameters
|
from library.modules.bigip_monitor_http import Parameters
|
||||||
from library.modules.bigip_monitor_http import ModuleManager
|
from library.modules.bigip_monitor_http import ModuleManager
|
||||||
from library.modules.bigip_monitor_http import ArgumentSpec
|
from library.modules.bigip_monitor_http import ArgumentSpec
|
||||||
|
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
from test.unit.modules.utils import set_module_args
|
# In Ansible 2.8, Ansible changed import paths.
|
||||||
|
from test.units.compat import unittest
|
||||||
|
from test.units.compat.mock import Mock
|
||||||
|
from test.units.compat.mock import patch
|
||||||
|
|
||||||
|
from test.units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_monitor_http import Parameters
|
from ansible.modules.network.f5.bigip_monitor_http import Parameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_http import ModuleManager
|
from ansible.modules.network.f5.bigip_monitor_http import ModuleManager
|
||||||
from ansible.modules.network.f5.bigip_monitor_http import ArgumentSpec
|
from ansible.modules.network.f5.bigip_monitor_http import ArgumentSpec
|
||||||
|
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
|
# Ansible 2.8 imports
|
||||||
|
from units.compat import unittest
|
||||||
|
from units.compat.mock import Mock
|
||||||
|
from units.compat.mock import patch
|
||||||
|
|
||||||
from units.modules.utils import set_module_args
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
|
@ -15,25 +15,34 @@ from nose.plugins.skip import SkipTest
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from units.compat import unittest
|
|
||||||
from units.compat.mock import Mock
|
|
||||||
from units.compat.mock import patch
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.modules.bigip_monitor_https import Parameters
|
from library.modules.bigip_monitor_https import Parameters
|
||||||
from library.modules.bigip_monitor_https import ModuleManager
|
from library.modules.bigip_monitor_https import ModuleManager
|
||||||
from library.modules.bigip_monitor_https import ArgumentSpec
|
from library.modules.bigip_monitor_https import ArgumentSpec
|
||||||
|
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
from test.unit.modules.utils import set_module_args
|
# In Ansible 2.8, Ansible changed import paths.
|
||||||
|
from test.units.compat import unittest
|
||||||
|
from test.units.compat.mock import Mock
|
||||||
|
from test.units.compat.mock import patch
|
||||||
|
|
||||||
|
from test.units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_monitor_https import Parameters
|
from ansible.modules.network.f5.bigip_monitor_https import Parameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_https import ModuleManager
|
from ansible.modules.network.f5.bigip_monitor_https import ModuleManager
|
||||||
from ansible.modules.network.f5.bigip_monitor_https import ArgumentSpec
|
from ansible.modules.network.f5.bigip_monitor_https import ArgumentSpec
|
||||||
|
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
|
# Ansible 2.8 imports
|
||||||
|
from units.compat import unittest
|
||||||
|
from units.compat.mock import Mock
|
||||||
|
from units.compat.mock import patch
|
||||||
|
|
||||||
from units.modules.utils import set_module_args
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
|
@ -8,32 +8,36 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import pytest
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from nose.plugins.skip import SkipTest
|
from nose.plugins.skip import SkipTest
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from units.compat import unittest
|
|
||||||
from units.compat.mock import Mock
|
|
||||||
from units.compat.mock import patch
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.modules.bigip_monitor_snmp_dca import Parameters
|
from library.modules.bigip_monitor_snmp_dca import Parameters
|
||||||
from library.modules.bigip_monitor_snmp_dca import ModuleManager
|
from library.modules.bigip_monitor_snmp_dca import ModuleManager
|
||||||
from library.modules.bigip_monitor_snmp_dca import ArgumentSpec
|
from library.modules.bigip_monitor_snmp_dca import ArgumentSpec
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
# In Ansible 2.8, Ansible changed import paths.
|
||||||
from test.unit.modules.utils import set_module_args
|
from test.units.compat import unittest
|
||||||
|
from test.units.compat.mock import Mock
|
||||||
|
from test.units.compat.mock import patch
|
||||||
|
|
||||||
|
from test.units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_monitor_snmp_dca import Parameters
|
from ansible.modules.network.f5.bigip_monitor_snmp_dca import Parameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_snmp_dca import ModuleManager
|
from ansible.modules.network.f5.bigip_monitor_snmp_dca import ModuleManager
|
||||||
from ansible.modules.network.f5.bigip_monitor_snmp_dca import ArgumentSpec
|
from ansible.modules.network.f5.bigip_monitor_snmp_dca import ArgumentSpec
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
# Ansible 2.8 imports
|
||||||
|
from units.compat import unittest
|
||||||
|
from units.compat.mock import Mock
|
||||||
|
from units.compat.mock import patch
|
||||||
|
|
||||||
from units.modules.utils import set_module_args
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
|
@ -15,25 +15,34 @@ from nose.plugins.skip import SkipTest
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from units.compat import unittest
|
|
||||||
from units.compat.mock import Mock
|
|
||||||
from units.compat.mock import patch
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.modules.bigip_monitor_tcp import Parameters
|
from library.modules.bigip_monitor_tcp import Parameters
|
||||||
from library.modules.bigip_monitor_tcp import ModuleManager
|
from library.modules.bigip_monitor_tcp import ModuleManager
|
||||||
from library.modules.bigip_monitor_tcp import ArgumentSpec
|
from library.modules.bigip_monitor_tcp import ArgumentSpec
|
||||||
|
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
from test.unit.modules.utils import set_module_args
|
# In Ansible 2.8, Ansible changed import paths.
|
||||||
|
from test.units.compat import unittest
|
||||||
|
from test.units.compat.mock import Mock
|
||||||
|
from test.units.compat.mock import patch
|
||||||
|
|
||||||
|
from test.units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp import Parameters
|
from ansible.modules.network.f5.bigip_monitor_tcp import Parameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp import ModuleManager
|
from ansible.modules.network.f5.bigip_monitor_tcp import ModuleManager
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp import ArgumentSpec
|
from ansible.modules.network.f5.bigip_monitor_tcp import ArgumentSpec
|
||||||
|
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
|
# Ansible 2.8 imports
|
||||||
|
from units.compat import unittest
|
||||||
|
from units.compat.mock import Mock
|
||||||
|
from units.compat.mock import patch
|
||||||
|
|
||||||
from units.modules.utils import set_module_args
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
|
@ -15,27 +15,34 @@ from nose.plugins.skip import SkipTest
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from units.compat import unittest
|
|
||||||
from units.compat.mock import Mock
|
|
||||||
from units.compat.mock import patch
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.modules.bigip_monitor_tcp_echo import Parameters
|
from library.modules.bigip_monitor_tcp_echo import Parameters
|
||||||
from library.modules.bigip_monitor_tcp_echo import ModuleManager
|
from library.modules.bigip_monitor_tcp_echo import ModuleManager
|
||||||
from library.modules.bigip_monitor_tcp_echo import ArgumentSpec
|
from library.modules.bigip_monitor_tcp_echo import ArgumentSpec
|
||||||
from library.modules.bigip_monitor_tcp_echo import HAS_F5SDK
|
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
from test.unit.modules.utils import set_module_args
|
# In Ansible 2.8, Ansible changed import paths.
|
||||||
|
from test.units.compat import unittest
|
||||||
|
from test.units.compat.mock import Mock
|
||||||
|
from test.units.compat.mock import patch
|
||||||
|
|
||||||
|
from test.units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp_echo import Parameters
|
from ansible.modules.network.f5.bigip_monitor_tcp_echo import Parameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp_echo import ModuleManager
|
from ansible.modules.network.f5.bigip_monitor_tcp_echo import ModuleManager
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp_echo import ArgumentSpec
|
from ansible.modules.network.f5.bigip_monitor_tcp_echo import ArgumentSpec
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp_echo import HAS_F5SDK
|
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
|
# Ansible 2.8 imports
|
||||||
|
from units.compat import unittest
|
||||||
|
from units.compat.mock import Mock
|
||||||
|
from units.compat.mock import patch
|
||||||
|
|
||||||
from units.modules.utils import set_module_args
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
|
@ -15,27 +15,34 @@ from nose.plugins.skip import SkipTest
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from units.compat import unittest
|
|
||||||
from units.compat.mock import Mock
|
|
||||||
from units.compat.mock import patch
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.modules.bigip_monitor_tcp_half_open import Parameters
|
from library.modules.bigip_monitor_tcp_half_open import Parameters
|
||||||
from library.modules.bigip_monitor_tcp_half_open import ModuleManager
|
from library.modules.bigip_monitor_tcp_half_open import ModuleManager
|
||||||
from library.modules.bigip_monitor_tcp_half_open import ArgumentSpec
|
from library.modules.bigip_monitor_tcp_half_open import ArgumentSpec
|
||||||
from library.modules.bigip_monitor_tcp_half_open import HAS_F5SDK
|
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
from test.unit.modules.utils import set_module_args
|
# In Ansible 2.8, Ansible changed import paths.
|
||||||
|
from test.units.compat import unittest
|
||||||
|
from test.units.compat.mock import Mock
|
||||||
|
from test.units.compat.mock import patch
|
||||||
|
|
||||||
|
from test.units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import Parameters
|
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import Parameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ModuleManager
|
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ModuleManager
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ArgumentSpec
|
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ArgumentSpec
|
||||||
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import HAS_F5SDK
|
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
|
# Ansible 2.8 imports
|
||||||
|
from units.compat import unittest
|
||||||
|
from units.compat.mock import Mock
|
||||||
|
from units.compat.mock import patch
|
||||||
|
|
||||||
from units.modules.utils import set_module_args
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
|
@ -15,25 +15,34 @@ from nose.plugins.skip import SkipTest
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from units.compat import unittest
|
|
||||||
from units.compat.mock import Mock
|
|
||||||
from units.compat.mock import patch
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.modules.bigip_monitor_udp import Parameters
|
from library.modules.bigip_monitor_udp import Parameters
|
||||||
from library.modules.bigip_monitor_udp import ModuleManager
|
from library.modules.bigip_monitor_udp import ModuleManager
|
||||||
from library.modules.bigip_monitor_udp import ArgumentSpec
|
from library.modules.bigip_monitor_udp import ArgumentSpec
|
||||||
|
|
||||||
from library.module_utils.network.f5.common import F5ModuleError
|
from library.module_utils.network.f5.common import F5ModuleError
|
||||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
from test.unit.modules.utils import set_module_args
|
# In Ansible 2.8, Ansible changed import paths.
|
||||||
|
from test.units.compat import unittest
|
||||||
|
from test.units.compat.mock import Mock
|
||||||
|
from test.units.compat.mock import patch
|
||||||
|
|
||||||
|
from test.units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_monitor_udp import Parameters
|
from ansible.modules.network.f5.bigip_monitor_udp import Parameters
|
||||||
from ansible.modules.network.f5.bigip_monitor_udp import ModuleManager
|
from ansible.modules.network.f5.bigip_monitor_udp import ModuleManager
|
||||||
from ansible.modules.network.f5.bigip_monitor_udp import ArgumentSpec
|
from ansible.modules.network.f5.bigip_monitor_udp import ArgumentSpec
|
||||||
|
|
||||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
|
||||||
|
# Ansible 2.8 imports
|
||||||
|
from units.compat import unittest
|
||||||
|
from units.compat.mock import Mock
|
||||||
|
from units.compat.mock import patch
|
||||||
|
|
||||||
from units.modules.utils import set_module_args
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue