community.general.digital_ocean_certificate (0.2.1) — module

Manage certificates in DigitalOcean.

Authors: Abhijeet Kasurde (@Akasurde)

Install collection

Install with ansible-galaxy collection install community.general:==0.2.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.2.1

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.

timeout:
    default: 30
    description:
    - The timeout in seconds used for polling DigitalOcean's API.
    type: int

oauth_token:
    aliases:
    - api_token
    description:
    - DigitalOcean OAuth token.
    - There are several other environment variables which can be used to provide this
      value.
    - i.e., - 'DO_API_TOKEN', 'DO_API_KEY', 'DO_OAUTH_TOKEN' and 'OAUTH_TOKEN'
    type: str

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

validate_certs:
    default: true
    description:
    - If set to C(no), the SSL certificates will not be validated.
    - This should only set to C(no) used on personally controlled sites using self-signed
      certificates.
    type: bool

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.