certificate

Synopsis

Requirements

  • pydo >= 0.1.3
  • azure-core >= 1.26.1

Parameters

Parameter Choices Default Comments
certificate_chain
(str)
The full PEM-formatted trust chain between the certificate authority's certificate and your domain's SSL certificate.
client_override_options
(dict)
Client override options (developer use). For example, can be used to override the DigitalOcean API endpoint for an internal test suite. If provided, these options will knock out existing options.
dns_names
(list)
An array of fully qualified domain names (FQDNs) for which the certificate was issued. A certificate covering all subdomains can be issued using a wildcard (e.g. *.example.com).
leaf_certificate
(str)
The contents of a PEM-formatted public SSL certificate.
module_override_options
(dict)
Module override options (developer use). Can be used to override module options to support experimental or future options. If provided, these options will knock out existing options.
name
(str)
A unique human-readable name referring to a certificate. To create a certificate from Let's Encrypt, provide dns_names. To create a custom certificate, provide private_key, leaf_certificate, and optionally certificate_chain. View API documentation at https://docs.digitalocean.com/reference/api/api-reference/#operation/certificates_create.
private_key
(str)
The contents of a PEM-formatted private-key corresponding to the SSL certificate.
state
(str)
  • present
  • absent
present State of the resource, present to create, absent to destroy.
timeout
(int)
300 Polling timeout in seconds.
token
(str)
DigitalOcean API token. There are several environment variables which can be used to provide this value. DIGITALOCEAN_ACCESS_TOKEN, DIGITALOCEAN_TOKEN, DO_API_TOKEN, DO_API_KEY, DO_OAUTH_TOKEN and OAUTH_TOKEN

Examples

- name: Create custom certificate
  digitalocean.cloud.certificate:
    token: "{{ token }}"
    name: custom.example.com
    private_key: |
      -----BEGIN PRIVATE KEY-----
      MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDE39Eyyp2QJIp6
      IvXELS4L+Wa8dAM4Uk0enV3PJKm2a674Ys0WSle2dzsd1EfpRXMNTt+iPZCyZQIS
      ...      
    leaf_certificate: |
      -----BEGIN CERTIFICATE-----
      MIIF8jCCA9oCCQDHvZvzJneVuzANBgkqhkiG9w0BAQsFADCBujELMAkGA1UEBhMC
      VVMxETAPBgNVBAgMCE1pY2hpZ2FuMRQwEgYDVQQHDAtHcmFuZCBCbGFuYzETMBEG
      ...      

- name: Create Let's Encrypt certificate
  digitalocean.cloud.certificate:
    token: "{{ token }}"
    name: letsencrypt.example.com
    dns_names:
      - letsencrypt.example.com

Return Values

Key Returned Description
certificate
(dict)
always Certificate.

Sample:

{
  "created_at": "2017-02-08T16:02:37Z",
  "dns_names": [],
  "id": "892071a0-bb95-49bc-8021-3afd67a210bf",
  "name": "web-cert-01",
  "not_after": "2017-02-22T00:23:00Z",
  "sha1_fingerprint": "dfcc9f57d86bf58e321c2c6c31c7a971be244ac7",
  "state": "verified",
  "type": "custom"
}
error
(dict)
failure DigitalOcean API error.

Sample:

{
  "Message": "Informational error message.",
  "Reason": "Unauthorized",
  "Status Code": 401
}
msg
(str)
always Certificate result information.

Sample:

[
  "Certificate web-cert-01 not found",
  "Certificate web-cert-01 ID not found",
  "Certificate web-cert-01 created",
  "Certificate web-cert-01 created but not found yet",
  "Certificate web-cert-01 not created",
  "Certificate web-cert-01 deleted",
  "Certificate web-cert-01 exists"
]
In this article...