|
|
|
@ -56,6 +56,14 @@ options:
|
|
|
|
|
default: null
|
|
|
|
|
choices: []
|
|
|
|
|
aliases: []
|
|
|
|
|
validate_certs:
|
|
|
|
|
description:
|
|
|
|
|
- If C(no), SSL certificates will not be validated. This should only be used
|
|
|
|
|
on personally controlled sites using self-signed certificates.
|
|
|
|
|
required: false
|
|
|
|
|
default: 'yes'
|
|
|
|
|
choices: ['yes', 'no']
|
|
|
|
|
version_added: 1.9.1
|
|
|
|
|
state:
|
|
|
|
|
description:
|
|
|
|
|
- Pool member state
|
|
|
|
@ -189,6 +197,12 @@ def bigip_api(bigip, user, password):
|
|
|
|
|
api = bigsuds.BIGIP(hostname=bigip, username=user, password=password)
|
|
|
|
|
return api
|
|
|
|
|
|
|
|
|
|
def disable_ssl_cert_validation():
|
|
|
|
|
# You probably only want to do this for testing and never in production.
|
|
|
|
|
# From https://www.python.org/dev/peps/pep-0476/#id29
|
|
|
|
|
import ssl
|
|
|
|
|
ssl._create_default_https_context = ssl._create_unverified_context
|
|
|
|
|
|
|
|
|
|
def pool_exists(api, pool):
|
|
|
|
|
# hack to determine if pool exists
|
|
|
|
|
result = False
|
|
|
|
@ -282,6 +296,7 @@ def main():
|
|
|
|
|
server = dict(type='str', required=True),
|
|
|
|
|
user = dict(type='str', required=True),
|
|
|
|
|
password = dict(type='str', required=True),
|
|
|
|
|
validate_certs = dict(default='yes', type='bool'),
|
|
|
|
|
state = dict(type='str', default='present', choices=['present', 'absent']),
|
|
|
|
|
pool = dict(type='str', required=True),
|
|
|
|
|
partition = dict(type='str', default='Common'),
|
|
|
|
@ -301,6 +316,7 @@ def main():
|
|
|
|
|
server = module.params['server']
|
|
|
|
|
user = module.params['user']
|
|
|
|
|
password = module.params['password']
|
|
|
|
|
validate_certs = module.params['validate_certs']
|
|
|
|
|
state = module.params['state']
|
|
|
|
|
partition = module.params['partition']
|
|
|
|
|
pool = "/%s/%s" % (partition, module.params['pool'])
|
|
|
|
@ -312,6 +328,9 @@ def main():
|
|
|
|
|
address = "/%s/%s" % (partition, host)
|
|
|
|
|
port = module.params['port']
|
|
|
|
|
|
|
|
|
|
if not validate_certs:
|
|
|
|
|
disable_ssl_cert_validation()
|
|
|
|
|
|
|
|
|
|
# sanity check user supplied values
|
|
|
|
|
|
|
|
|
|
if (host and not port) or (port and not host):
|
|
|
|
|