@ -768,17 +768,19 @@ class EcsCertificate(object):
if self . backup :
if self . backup :
self . backup_file = module . backup_local ( self . path )
self . backup_file = module . backup_local ( self . path )
crypto_utils . write_file ( module , to_bytes ( self . cert_details . get ( ' endEntityCert ' ) ) )
crypto_utils . write_file ( module , to_bytes ( self . cert_details . get ( ' endEntityCert ' ) ) )
if self . full_chain_path :
if self . full_chain_path and self . cert_details . get ( ' chainCerts ' ) :
if self . backup :
if self . backup :
self . backup_full_chain_file = module . backup_local ( self . full_chain_path )
self . backup_full_chain_file = module . backup_local ( self . full_chain_path )
crypto_utils . write_file ( module , to_bytes ( self . cert_details . get ( ' chainCerts ' ) ) , path = self . full_chain_path )
chain_string = ' \n ' . join ( self . cert_details . get ( ' chainCerts ' ) ) + ' \n '
crypto_utils . write_file ( module , to_bytes ( chain_string ) , path = self . full_chain_path )
self . changed = True
self . changed = True
# If there is no certificate present in path but a tracking ID was specified, save it to disk
# If there is no certificate present in path but a tracking ID was specified, save it to disk
elif not os . path . exists ( self . path ) and self . tracking_id :
elif not os . path . exists ( self . path ) and self . tracking_id :
if not module . check_mode :
if not module . check_mode :
crypto_utils . write_file ( module , to_bytes ( self . cert_details . get ( ' endEntityCert ' ) ) )
crypto_utils . write_file ( module , to_bytes ( self . cert_details . get ( ' endEntityCert ' ) ) )
if self . full_chain_path :
if self . full_chain_path and self . cert_details . get ( ' chainCerts ' ) :
crypto_utils . write_file ( module , to_bytes ( self . cert_details . get ( ' chainCerts ' ) ) , path = self . full_chain_path )
chain_string = ' \n ' . join ( self . cert_details . get ( ' chainCerts ' ) ) + ' \n '
crypto_utils . write_file ( module , to_bytes ( chain_string ) , path = self . full_chain_path )
self . changed = True
self . changed = True
def dump ( self ) :
def dump ( self ) :