ngine_io.cloudstack.ssl_cert module – Manages SSL certificates on Apache CloudStack based clouds.

Note

This module is part of the ngine_io.cloudstack collection (version 3.3.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install ngine_io.cloudstack. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: ngine_io.cloudstack.ssl_cert.

New in ngine_io.cloudstack 3.2.0

Synopsis

  • Upload and remove SSL certificates.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 2.6

  • cs >= 0.9.0

Parameters

Parameter

Comments

account

string

Account the SSL certificate is related to.

api_http_method

string

HTTP method used to query the API endpoint.

If not given, the CLOUDSTACK_METHOD env variable is considered.

Choices:

  • "get" ← (default)

  • "post"

api_key

string / required

API key of the CloudStack API.

If not given, the CLOUDSTACK_KEY env variable is considered.

api_secret

string / required

Secret key of the CloudStack API.

If not set, the CLOUDSTACK_SECRET env variable is considered.

api_timeout

integer

HTTP timeout in seconds.

If not given, the CLOUDSTACK_TIMEOUT env variable is considered.

Default: 10

api_url

string / required

URL of the CloudStack API e.g. https://cloud.example.com/client/api.

If not given, the CLOUDSTACK_ENDPOINT env variable is considered.

api_verify_ssl_cert

string

Verify CA authority cert file.

If not given, the CLOUDSTACK_VERIFY env variable is considered.

cert_chain

string

Certificate chain of trust.

certificate

string

SSL certificate.

Required when state=present.

domain

string

Domain the SSL certificate is related to.

enable_revocation_check

boolean

Whether to enable revocation checking for the certificate.

Choices:

  • false

  • true

force

boolean

Whether to force recreation of the SSL certificate if a certificate with the same name already exists.

Choices:

  • false ← (default)

  • true

name

string / required

Name of the SSL certificate.

password

string

Password for the private key.

private_key

string

Private key for the SSL certificate.

Required when state=present.

project

string

Name of the project the SSL certificate is related to.

state

string

State of the SSL certificate.

Choices:

  • "present" ← (default)

  • "absent"

validate_certs

boolean

added in ngine_io.cloudstack 2.4.0

If false, SSL certificates will not be validated.

If not given, the CLOUDSTACK_DANGEROUS_NO_TLS_VERIFY env variable is considered.

This should only be used on personally controlled sites using self-signed certificates.

Choices:

  • false

  • true ← (default)

Notes

Note

  • A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide.

  • This module supports check mode.

Examples

- name: Upload an SSL certificate
  ngine_io.cloudstack.ssl_cert:
    name: my-ssl-cert
    certificate: "{{ lookup('file', 'cert.pem') }}"
    private_key: "{{ lookup('file', 'key.pem') }}"

- name: Upload an SSL certificate with a certificate chain
  ngine_io.cloudstack.ssl_cert:
    name: my-ssl-cert
    certificate: "{{ lookup('file', 'cert.pem') }}"
    private_key: "{{ lookup('file', 'key.pem') }}"
    cert_chain: "{{ lookup('file', 'chain.pem') }}"

- name: Remove an SSL certificate
  ngine_io.cloudstack.ssl_cert:
    name: my-ssl-cert
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

account

string

Account the SSL certificate is related to.

Returned: success

Sample: "example account"

cert_chain

string

Certificate chain of trust.

Returned: success

Sample: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"

certificate

string

SSL certificate.

Returned: success

Sample: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"

domain

string

Domain the SSL certificate is related to.

Returned: success

Sample: "example domain"

fingerprint

string

Fingerprint of the SSL certificate.

Returned: success

Sample: "68:82:16:b8:f6:e6:d8:52:08:21:ac:39:23:8c:3a:53:62:77:90:aa:fb:8f:0c:37:71:c2:a1:10:c9:b2:19:04"

id

string

UUID of the SSL certificate.

Returned: success

Sample: "a6f7a5fc-43f8-11e5-a151-feff819cdc9f"

name

string

Name of the SSL certificate.

Returned: success

Sample: "my-ssl-cert"

project

string

Project the SSL certificate is related to.

Returned: success

Sample: "Production"

Authors

  • René Moser (@resmo)