|
|
|
|
@ -691,6 +691,18 @@ class Certificate(crypto_utils.OpenSSLObject):
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def dump(self, check_mode=False):
|
|
|
|
|
# Use only for absent
|
|
|
|
|
|
|
|
|
|
result = {
|
|
|
|
|
'changed': self.changed,
|
|
|
|
|
'filename': self.path,
|
|
|
|
|
'privatekey': self.privatekey_path,
|
|
|
|
|
'csr': self.csr_path
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SelfSignedCertificateCryptography(Certificate):
|
|
|
|
|
"""Generate the self-signed certificate, using the cryptography backend"""
|
|
|
|
|
@ -1841,6 +1853,11 @@ def main():
|
|
|
|
|
add_file_common_args=True,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if module.params['state'] == 'absent':
|
|
|
|
|
# backend doesn't matter
|
|
|
|
|
certificate = Certificate(module, 'cryptography')
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
if module.params['provider'] != 'assertonly' and module.params['csr_path'] is None:
|
|
|
|
|
module.fail_json(msg='csr_path is required when provider is not assertonly')
|
|
|
|
|
|
|
|
|
|
|