community.digitalocean.digital_ocean_cdn_endpoints (1.26.0) — module

Create, update, and delete DigitalOcean CDN Endpoints

| "added in version" 1.10.0 of community.digitalocean"

Authors: Mark Mercado (@mamercad)

Install collection

Install with ansible-galaxy collection install community.digitalocean:==1.26.0


Add to requirements.yml

  collections:
    - name: community.digitalocean
      version: 1.26.0

Description

Create, update, and delete DigitalOcean CDN Endpoints

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create DigitalOcean CDN Endpoint
  community.digitalocean.digital_ocean_cdn_endpoints:
    state: present
    oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
    origin: mamercad.nyc3.digitaloceanspaces.com
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update DigitalOcean CDN Endpoint (change ttl to 600, default is 3600)
  community.digitalocean.digital_ocean_cdn_endpoints:
    state: present
    oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
    origin: mamercad.nyc3.digitaloceanspaces.com
    ttl: 600
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete DigitalOcean CDN Endpoint
  community.digitalocean.digital_ocean_cdn_endpoints:
    state: absent
    oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
    origin: mamercad.nyc3.digitaloceanspaces.com

Inputs

    
ttl:
    choices:
    - 60
    - 600
    - 3600
    - 86400
    - 604800
    default: 3600
    description:
    - The amount of time the content is cached by the CDN's edge servers in seconds.
    - TTL must be one of 60, 600, 3600, 86400, or 604800.
    - Defaults to 3600 (one hour) when excluded.
    required: false
    type: int

state:
    choices:
    - present
    - absent
    default: present
    description:
    - The usual, C(present) to create, C(absent) to destroy
    type: str

origin:
    description:
    - The fully qualified domain name (FQDN) for the origin server which provides the
      content for the CDN.
    - This is currently restricted to a Space.
    required: true
    type: str

baseurl:
    default: https://api.digitalocean.com/v2
    description:
    - DigitalOcean API base url.
    type: str

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., - C(DO_API_TOKEN), C(DO_API_KEY), C(DO_OAUTH_TOKEN) and C(OAUTH_TOKEN).
    type: str

custom_domain:
    default: ''
    description:
    - The fully qualified domain name (FQDN) of the custom subdomain used with the CDN
      endpoint.
    required: false
    type: str

certificate_id:
    default: ''
    description:
    - The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain
      is provided.
    required: false
    type: str

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

Outputs

data:
  description: DigitalOcean CDN Endpoints
  returned: success
  sample:
    data:
      endpoint:
        created_at: '2021-09-05T13:47:23Z'
        endpoint: mamercad.nyc3.cdn.digitaloceanspaces.com
        id: 01739563-3f50-4da4-a451-27f6d59d7573
        origin: mamercad.nyc3.digitaloceanspaces.com
        ttl: 3600
  type: dict