|
|
|
|
@ -23,17 +23,20 @@ options:
|
|
|
|
|
name:
|
|
|
|
|
description:
|
|
|
|
|
- Specifies the name of the profile.
|
|
|
|
|
type: str
|
|
|
|
|
required: True
|
|
|
|
|
parent:
|
|
|
|
|
description:
|
|
|
|
|
- The parent template of this monitor template. Once this value has
|
|
|
|
|
been set, it cannot be changed. By default, this value is the C(clientssl)
|
|
|
|
|
parent on the C(Common) partition.
|
|
|
|
|
type: str
|
|
|
|
|
default: /Common/clientssl
|
|
|
|
|
ciphers:
|
|
|
|
|
description:
|
|
|
|
|
- Specifies the list of ciphers that the system supports. When creating a new
|
|
|
|
|
profile, the default cipher list is provided by the parent profile.
|
|
|
|
|
type: str
|
|
|
|
|
cert_key_chain:
|
|
|
|
|
description:
|
|
|
|
|
- One or more certificates and keys to associate with the SSL profile. This
|
|
|
|
|
@ -47,25 +50,31 @@ options:
|
|
|
|
|
cert:
|
|
|
|
|
description:
|
|
|
|
|
- Specifies a cert name for use.
|
|
|
|
|
type: str
|
|
|
|
|
required: True
|
|
|
|
|
key:
|
|
|
|
|
description:
|
|
|
|
|
- Contains a key name.
|
|
|
|
|
type: str
|
|
|
|
|
required: True
|
|
|
|
|
chain:
|
|
|
|
|
description:
|
|
|
|
|
- Contains a certificate chain that is relevant to the certificate and key
|
|
|
|
|
mentioned earlier.
|
|
|
|
|
- This key is optional.
|
|
|
|
|
type: str
|
|
|
|
|
passphrase:
|
|
|
|
|
description:
|
|
|
|
|
- Contains the passphrase of the key file, should it require one.
|
|
|
|
|
- Passphrases are encrypted on the remote BIG-IP device. Therefore, there is no way
|
|
|
|
|
to compare them when updating a client SSL profile. Due to this, if you specify a
|
|
|
|
|
passphrase, this module will always register a C(changed) event.
|
|
|
|
|
type: str
|
|
|
|
|
type: list
|
|
|
|
|
partition:
|
|
|
|
|
description:
|
|
|
|
|
- Device partition to manage resources on.
|
|
|
|
|
type: str
|
|
|
|
|
default: Common
|
|
|
|
|
version_added: 2.5
|
|
|
|
|
options:
|
|
|
|
|
@ -73,6 +82,7 @@ options:
|
|
|
|
|
- Options that the system uses for SSL processing in the form of a list. When
|
|
|
|
|
creating a new profile, the list is provided by the parent profile.
|
|
|
|
|
- When a C('') or C(none) value is provided all options for SSL processing are disabled.
|
|
|
|
|
type: list
|
|
|
|
|
choices:
|
|
|
|
|
- netscape-reuse-cipher-change-bug
|
|
|
|
|
- microsoft-big-sslv3-buffer
|
|
|
|
|
@ -111,6 +121,7 @@ options:
|
|
|
|
|
- The C(require-strict) setting the system requires strict renegotiation of SSL
|
|
|
|
|
connections. In this mode the system refuses connections to insecure servers,
|
|
|
|
|
and terminates existing SSL connections to insecure servers.
|
|
|
|
|
type: str
|
|
|
|
|
choices:
|
|
|
|
|
- require
|
|
|
|
|
- require-strict
|
|
|
|
|
@ -138,8 +149,15 @@ options:
|
|
|
|
|
version_added: 2.8
|
|
|
|
|
sni_require:
|
|
|
|
|
description:
|
|
|
|
|
- Requires that the network peers also provide SNI support. This setting only takes effect when C(sni_default) is
|
|
|
|
|
set to C(true). When creating a new profile, the setting is provided by the parent profile.
|
|
|
|
|
- Requires that the network peers also provide SNI support, this setting only takes effect when C(sni_default) is
|
|
|
|
|
set to C(true).
|
|
|
|
|
- When creating a new profile, the setting is provided by the parent profile.
|
|
|
|
|
type: bool
|
|
|
|
|
version_added: 2.8
|
|
|
|
|
strict_resume:
|
|
|
|
|
description:
|
|
|
|
|
- Enables or disables the resumption of SSL sessions after an unclean shutdown.
|
|
|
|
|
- When creating a new profile, the setting is provided by the parent profile.
|
|
|
|
|
type: bool
|
|
|
|
|
version_added: 2.8
|
|
|
|
|
client_certificate:
|
|
|
|
|
@ -151,6 +169,7 @@ options:
|
|
|
|
|
valid certificate.
|
|
|
|
|
- When C(request), specifies that the system requests a valid certificate from a
|
|
|
|
|
client but always authenticate the client.
|
|
|
|
|
type: str
|
|
|
|
|
choices:
|
|
|
|
|
- ignore
|
|
|
|
|
- require
|
|
|
|
|
@ -163,10 +182,17 @@ options:
|
|
|
|
|
SSL session.
|
|
|
|
|
- When C(always), specifies that the system authenticates the client once for an
|
|
|
|
|
SSL session and also upon reuse of that session.
|
|
|
|
|
type: str
|
|
|
|
|
choices:
|
|
|
|
|
- once
|
|
|
|
|
- always
|
|
|
|
|
version_added: 2.8
|
|
|
|
|
renegotiation:
|
|
|
|
|
description:
|
|
|
|
|
- Enables or disables SSL renegotiation.
|
|
|
|
|
- When creating a new profile, the setting is provided by the parent profile.
|
|
|
|
|
type: bool
|
|
|
|
|
version_added: 2.8
|
|
|
|
|
retain_certificate:
|
|
|
|
|
description:
|
|
|
|
|
- When C(yes), client certificate is retained in SSL session.
|
|
|
|
|
@ -176,19 +202,23 @@ options:
|
|
|
|
|
description:
|
|
|
|
|
- Specifies the maximum number of certificates to be traversed in a client
|
|
|
|
|
certificate chain.
|
|
|
|
|
type: int
|
|
|
|
|
version_added: 2.8
|
|
|
|
|
trusted_cert_authority:
|
|
|
|
|
description:
|
|
|
|
|
- Specifies a client CA that the system trusts.
|
|
|
|
|
type: str
|
|
|
|
|
version_added: 2.8
|
|
|
|
|
advertised_cert_authority:
|
|
|
|
|
description:
|
|
|
|
|
- Specifies that the CAs that the system advertises to clients is being trusted
|
|
|
|
|
by the profile.
|
|
|
|
|
type: str
|
|
|
|
|
version_added: 2.8
|
|
|
|
|
client_auth_crl:
|
|
|
|
|
description:
|
|
|
|
|
- Specifies the name of a file containing a list of revoked client certificates.
|
|
|
|
|
type: str
|
|
|
|
|
version_added: 2.8
|
|
|
|
|
allow_expired_crl:
|
|
|
|
|
description:
|
|
|
|
|
@ -199,10 +229,11 @@ options:
|
|
|
|
|
description:
|
|
|
|
|
- When C(present), ensures that the profile exists.
|
|
|
|
|
- When C(absent), ensures the profile is removed.
|
|
|
|
|
default: present
|
|
|
|
|
type: str
|
|
|
|
|
choices:
|
|
|
|
|
- present
|
|
|
|
|
- absent
|
|
|
|
|
default: present
|
|
|
|
|
version_added: 2.5
|
|
|
|
|
notes:
|
|
|
|
|
- Requires BIG-IP software version >= 12
|
|
|
|
|
@ -251,7 +282,7 @@ EXAMPLES = r'''
|
|
|
|
|
bigip_profile_client_ssl:
|
|
|
|
|
state: present
|
|
|
|
|
name: my_profile
|
|
|
|
|
secure_renegotation: request
|
|
|
|
|
secure_renegotiation: request
|
|
|
|
|
provider:
|
|
|
|
|
server: lb.mydomain.com
|
|
|
|
|
user: admin
|
|
|
|
|
@ -284,7 +315,7 @@ options:
|
|
|
|
|
returned: changed
|
|
|
|
|
type: list
|
|
|
|
|
sample: ['no-sslv2', 'no-sslv3']
|
|
|
|
|
secure_renegotation:
|
|
|
|
|
secure_renegotiation:
|
|
|
|
|
description: The method of secure SSL renegotiation.
|
|
|
|
|
returned: changed
|
|
|
|
|
type: str
|
|
|
|
|
@ -294,6 +325,16 @@ allow_non_ssl:
|
|
|
|
|
returned: changed
|
|
|
|
|
type: bool
|
|
|
|
|
sample: yes
|
|
|
|
|
strict_resume:
|
|
|
|
|
description: Resumption of SSL sessions after an unclean shutdown.
|
|
|
|
|
returned: changed
|
|
|
|
|
type: bool
|
|
|
|
|
sample: yes
|
|
|
|
|
renegotiation:
|
|
|
|
|
description: Renegotiation of SSL sessions.
|
|
|
|
|
returned: changed
|
|
|
|
|
type: bool
|
|
|
|
|
sample: yes
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
@ -306,25 +347,19 @@ try:
|
|
|
|
|
from library.module_utils.network.f5.bigip import F5RestClient
|
|
|
|
|
from library.module_utils.network.f5.common import F5ModuleError
|
|
|
|
|
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
|
|
|
|
from library.module_utils.network.f5.common import cleanup_tokens
|
|
|
|
|
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 flatten_boolean
|
|
|
|
|
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 fail_json
|
|
|
|
|
from library.module_utils.network.f5.common import is_empty_list
|
|
|
|
|
except ImportError:
|
|
|
|
|
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 AnsibleF5Parameters
|
|
|
|
|
from ansible.module_utils.network.f5.common import cleanup_tokens
|
|
|
|
|
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 flatten_boolean
|
|
|
|
|
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 fail_json
|
|
|
|
|
from ansible.module_utils.network.f5.common import is_empty_list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -346,6 +381,8 @@ class Parameters(AnsibleF5Parameters):
|
|
|
|
|
'clientCertCa': 'advertised_cert_authority',
|
|
|
|
|
'crlFile': 'client_auth_crl',
|
|
|
|
|
'allowExpiredCrl': 'allow_expired_crl',
|
|
|
|
|
'strictResume': 'strict_resume',
|
|
|
|
|
'renegotiation': 'renegotiation',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
api_attributes = [
|
|
|
|
|
@ -366,6 +403,8 @@ class Parameters(AnsibleF5Parameters):
|
|
|
|
|
'clientCertCa',
|
|
|
|
|
'crlFile',
|
|
|
|
|
'allowExpiredCrl',
|
|
|
|
|
'strictResume',
|
|
|
|
|
'renegotiation',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
returnables = [
|
|
|
|
|
@ -386,6 +425,8 @@ class Parameters(AnsibleF5Parameters):
|
|
|
|
|
'advertised_cert_authority',
|
|
|
|
|
'client_auth_crl',
|
|
|
|
|
'allow_expired_crl',
|
|
|
|
|
'strict_resume',
|
|
|
|
|
'renegotiation',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
updatables = [
|
|
|
|
|
@ -405,6 +446,8 @@ class Parameters(AnsibleF5Parameters):
|
|
|
|
|
'advertised_cert_authority',
|
|
|
|
|
'client_auth_crl',
|
|
|
|
|
'allow_expired_crl',
|
|
|
|
|
'strict_resume',
|
|
|
|
|
'renegotiation',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
@ -485,6 +528,24 @@ class ModuleParameters(Parameters):
|
|
|
|
|
return 'enabled'
|
|
|
|
|
return 'disabled'
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def strict_resume(self):
|
|
|
|
|
result = flatten_boolean(self._values['strict_resume'])
|
|
|
|
|
if result is None:
|
|
|
|
|
return None
|
|
|
|
|
if result == 'yes':
|
|
|
|
|
return 'enabled'
|
|
|
|
|
return 'disabled'
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def renegotiation(self):
|
|
|
|
|
result = flatten_boolean(self._values['renegotiation'])
|
|
|
|
|
if result is None:
|
|
|
|
|
return None
|
|
|
|
|
if result == 'yes':
|
|
|
|
|
return 'enabled'
|
|
|
|
|
return 'disabled'
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def options(self):
|
|
|
|
|
options = self._values['options']
|
|
|
|
|
@ -634,6 +695,14 @@ class ReportableChanges(Changes):
|
|
|
|
|
return 'yes'
|
|
|
|
|
return 'no'
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def strict_resume(self):
|
|
|
|
|
if self._values['strict_resume'] is None:
|
|
|
|
|
return None
|
|
|
|
|
elif self._values['strict_resume'] == 'enabled':
|
|
|
|
|
return 'yes'
|
|
|
|
|
return 'no'
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def retain_certificate(self):
|
|
|
|
|
return flatten_boolean(self._values['retain_certificate'])
|
|
|
|
|
@ -757,7 +826,7 @@ class Difference(object):
|
|
|
|
|
class ModuleManager(object):
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
|
self.module = kwargs.get('module', None)
|
|
|
|
|
self.client = kwargs.get('client', None)
|
|
|
|
|
self.client = F5RestClient(**self.module.params)
|
|
|
|
|
self.want = ModuleParameters(params=self.module.params)
|
|
|
|
|
self.have = ApiParameters()
|
|
|
|
|
self.changes = UsableChanges()
|
|
|
|
|
@ -1008,6 +1077,8 @@ class ArgumentSpec(object):
|
|
|
|
|
advertised_cert_authority=dict(),
|
|
|
|
|
client_auth_crl=dict(),
|
|
|
|
|
allow_expired_crl=dict(type='bool'),
|
|
|
|
|
strict_resume=dict(type='bool'),
|
|
|
|
|
renegotiation=dict(type='bool'),
|
|
|
|
|
partition=dict(
|
|
|
|
|
default='Common',
|
|
|
|
|
fallback=(env_fallback, ['F5_PARTITION'])
|
|
|
|
|
@ -1026,16 +1097,12 @@ def main():
|
|
|
|
|
supports_check_mode=spec.supports_check_mode,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
client = F5RestClient(**module.params)
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
mm = ModuleManager(module=module, client=client)
|
|
|
|
|
mm = ModuleManager(module=module)
|
|
|
|
|
results = mm.exec_module()
|
|
|
|
|
cleanup_tokens(client)
|
|
|
|
|
exit_json(module, results, client)
|
|
|
|
|
module.exit_json(**results)
|
|
|
|
|
except F5ModuleError as ex:
|
|
|
|
|
cleanup_tokens(client)
|
|
|
|
|
fail_json(module, ex, client)
|
|
|
|
|
module.fail_json(msg=str(ex))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|