##### SUMMARY
The file contents that end up as the output of ecs_certificates "full_chain_path" are not a valid format for import into, for example, a PKCS12 store.

This is the result of the return value of the ECS API being an array, and not properly turning that array into concatenated certificates for the resulting PEM file.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
ecs_certificate

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
Applies to ansible 2.9.0.dev0

##### CONFIGURATION
N/A affects all configurations

##### OS / ENVIRONMENT
N/A affects all OS/environment


##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
Populate full_chain_path and inspect output

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->
A properly formatted PEM certificate chain

##### ACTUAL RESULTS
A certificate chain in format ['CERT','CERT']

if module.params['request_type'] == 'reissue':
        if module.params['cert_expiry']:
            module.fail_json(msg='The cert_expiry field is invalid when request_type="reissue".')
        elif module.params['cert_lifetime']:
            module.fail_json(msg='The cert_lifetime field is invalid when request_type="reissue".')
    
    else:
        module_params_csr = module.params['csr']
        if module_params_csr is None:
            module.fail_json(msg='The csr field is required when request_type={0}'.format(module.params['request_type']))
        elif not os.path.exists(module_params_csr):
            module.fail_json(msg='The csr field of {0} was not a valid path. csr is required when request_type={1}'.format(
                module_params_csr, module.params['request_type']))
    if module.params['ou'] and len(module.params['ou']) > 1:
        module.fail_json(msg='Multiple "ou" values are not currently supported.')
    if module.params['end_user_key_storage_agreement']:
        if module.params['cert_type'] != 'CODE_SIGNING' and module.params['cert_type'] != 'EV_CODE_SIGNING':
            module.fail_json(msg='Parameter "end_user_key_storage_agreement" is valid only for cert_types "CODE_SIGNING" and "EV_CODE_SIGNING"')
    if module.params['org'] and module.params['client_id'] != 1 and module.params['cert_type'] != 'PD_SSL':
        module.fail_json(msg='The "org" parameter is not supported when client_id parameter is set to a value other than 1, unless cert_type is "PD_SSL".')
    if module.params['cert_expiry']:
        if not validate_cert_expiry(module.params['cert_expiry']):
            module.fail_json(msg='The "cert_expiry" parameter of "{0}" is not a valid date or date-time'.format(module.params['cert_expiry']))
    certificate = EcsCertificate(module)
    certificate.request_cert(module)
    result = certificate.dump()
    module.exit_json(**result)
if __name__ == '__main__':
    main()