community.digitalocean.digital_ocean_database_info (1.3.0) — module

Gather information about DigitalOcean databases

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

Authors: Mark Mercado (@mamercad)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.digitalocean
      version: 1.3.0

Description

Gather information about DigitalOcean databases.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather all DigitalOcean databases
  community.digitalocean.digital_ocean_database_info:
    oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_KEY') }}"
  register: my_databases

Inputs

    
id:
    aliases:
    - database_id
    description:
    - A unique ID that can be used to identify and reference a database cluster.
    required: false
    type: int

name:
    description:
    - A unique, human-readable name for the database cluster.
    required: false
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Indicates the desired state of the target.
    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., - 'DO_API_TOKEN', 'DO_API_KEY', 'DO_OAUTH_TOKEN' and 'OAUTH_TOKEN'
    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: List of DigitalOcean databases
  returned: success
  sample:
  - connection:
      database: ''
      host: testdatabase1-do-user-3097135-0.b.db.ondigitalocean.com
      password: REDACTED
      port: 25061
      protocol: rediss
      ssl: true
      uri: rediss://default:REDACTED@testdatabase1-do-user-3097135-0.b.db.ondigitalocean.com:25061
      user: default
    created_at: '2021-04-21T15:41:14Z'
    db_names: null
    engine: redis
    id: 37de10e4-808b-4f4b-b25f-7b5b3fd194ac
    maintenance_window:
      day: monday
      hour: '11:33:47'
      pending: false
    name: testdatabase1
    num_nodes: 1
    private_connection:
      database: ''
      host: private-testdatabase1-do-user-3097135-0.b.db.ondigitalocean.com
      password: REDACTED
      port: 25061
      protocol: rediss
      ssl: true
      uri: rediss://default:REDACTED@private-testdatabase1-do-user-3097135-0.b.db.ondigitalocean.com:25061
      user: default
    private_network_uuid: 0db3519b-9efc-414a-8868-8f2e6934688c
    region: nyc1
    size: db-s-1vcpu-1gb
    status: online
    tags: null
    users: null
    version: '6'
  - '...'
  type: list