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

Merge pull request #11142 from Etienne-Carriere/factor_f5

Add common fonctions for F5 modules (FQ Name functions)
This commit is contained in:
Brian Coca 2015-06-03 16:27:57 -04:00
commit f3ccff42e5

View file

@ -50,7 +50,7 @@ def f5_parse_arguments(module):
module.fail_json(msg="the python bigsuds module is required")
if not module.params['validate_certs']:
disable_ssl_cert_validation()
return (module.params['server'],module.params['user'],module.params['password'],module.params['state'],module.params['partition'])
return (module.params['server'],module.params['user'],module.params['password'],module.params['state'],module.params['partition'],module.params['validate_certs'])
def bigip_api(bigip, user, password):
api = bigsuds.BIGIP(hostname=bigip, username=user, password=password)
@ -62,3 +62,16 @@ def disable_ssl_cert_validation():
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
# Fully Qualified name (with the partition)
def fq_name(partition,name):
if name is not None and not name.startswith('/'):
return '/%s/%s' % (partition,name)
return name
# Fully Qualified name (with partition) for a list
def fq_list_names(partition,list_names):
if list_names is None:
return None
return map(lambda x: fq_name(partition,x),list_names)