ansible.builtin.digital_ocean_certificate (v2.5.15) — module

Manage certificates in DigitalOcean.

| "added in version" 2.5 of ansible.builtin"

Authors: Abhijeet Kasurde (@akasurde)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.5.15

Description

Create, Retrieve and remove certificates DigitalOcean.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create a certificate
  digital_ocean_certificate:
    name: production
    state: present
    private_key: "-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkM8OI7pRpgyj1I
-----END PRIVATE KEY-----"
    leaf_certificate: "-----BEGIN CERTIFICATE-----
MIIFDmg2Iaw==
-----END CERTIFICATE-----"
    oauth_token: b7d03a6947b217efb6f3ec3bd365652
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create a certificate using file lookup plugin
  digital_ocean_certificate:
    name: production
    state: present
    private_key: "{{ lookup('file', 'test.key') }}"
    leaf_certificate: "{{ lookup('file', 'test.cert') }}"
    oauth_token: "{{ oauth_token }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create a certificate with trust chain
  digital_ocean_certificate:
    name: production
    state: present
    private_key: "{{ lookup('file', 'test.key') }}"
    leaf_certificate: "{{ lookup('file', 'test.cert') }}"
    certificate_chain: "{{ lookup('file', 'chain.cert') }}"
    oauth_token: "{{ oauth_token }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove a certificate
  digital_ocean_certificate:
    name: production
    state: absent
    oauth_token: "{{ oauth_token }}"

Inputs

    
name:
    description:
    - The name of the certificate.
    required: true

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the certificate should be present or absent.

oauth_token:
    aliases:
    - DO_API_TOKEN
    - DO_API_KEY
    - DO_OAUTH_TOKEN
    description:
    - DigitalOcean OAuth token.
    required: true

private_key:
    description:
    - A PEM-formatted private key content of SSL Certificate.

leaf_certificate:
    description:
    - A PEM-formatted public SSL Certificate.

certificate_chain:
    description:
    - The full PEM-formatted trust chain between the certificate authority's certificate
      and your domain's SSL certificate.